Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › [Help] I need help with my first c++ program

[Help] I need help with my first c++ program

Posts 1–7 of 7 · Page 1 of 1
yodaliketaco
yodaliketaco
[Help] I need help with my first c++ program
As my first c++ program, I am making a crosshair that will show on top of all other programs. I finished designing a cool shape pixel by pixel and coded it to show up, but whenever I go fullscreen, it dissapears. This means I can't use it for it's original purpose: FPS games. Here is the source, tell me if you have any ideas to fix this problem.

#include<windows.h>
#include<iostream>
int main()
{
int x = 960; /*This is just 1/2 the horizontal resolution, for possible development to work on multiple resolutions*/
int y = 600; /*same as previous but for y*/
HDC hdc=GetDC(NULL);
while(1)
{
SetPixel(hdc,x,y,255);
Sleep(1);
SetPixel(hdc,x+1,y,255);
Sleep(1);
SetPixel(hdc,x-1,y,255);
Sleep(1);
SetPixel(hdc,x,y+1,255);
Sleep(1);
SetPixel(hdc,x,y-1,255);
Sleep(1);
SetPixel(hdc,x+2,y,255);
Sleep(1);
SetPixel(hdc,x-2,y,255);
Sleep(1);
SetPixel(hdc,x,y+2,255);
Sleep(1);
SetPixel(hdc,x,y-2,255);
Sleep(1);
SetPixel(hdc,x-1,y-1,255);
Sleep(1);
SetPixel(hdc,x+1,y+1,255);
Sleep(1);
SetPixel(hdc,x+1,y-1,255);
Sleep(1);
SetPixel(hdc,x-1,y+1,255);
Sleep(1);
SetPixel(hdc,x-3,y,255);
Sleep(1);
SetPixel(hdc,x-2,y,255);
Sleep(1);
SetPixel(hdc,x-4,y,255);
Sleep(1);
SetPixel(hdc,x-3,y+1,255);
Sleep(1);
SetPixel(hdc,x-3,y-1,255);
Sleep(1);
SetPixel(hdc,x-1,y,255);
Sleep(1);
SetPixel(hdc,x-5,y,255);
Sleep(1);
SetPixel(hdc,x-3,y+2,255);
Sleep(1);
SetPixel(hdc,x-3,y-2,255);
Sleep(1);
SetPixel(hdc,x-4,y-1,255);
Sleep(1);
SetPixel(hdc,x-2,y+1,255);
Sleep(1);
SetPixel(hdc,x-2,y-1,255);
Sleep(1);
SetPixel(hdc,x-4,y+1,255);
Sleep(1);
SetPixel(hdc,x+3,y,255);
Sleep(1);
SetPixel(hdc,x+4,y,255);
Sleep(1);
SetPixel(hdc,x+2,y,255);
Sleep(1);
SetPixel(hdc,x+3,y+1,255);
Sleep(1);
SetPixel(hdc,x+3,y-1,255);
Sleep(1);
SetPixel(hdc,x+5,y,255);
Sleep(1);
SetPixel(hdc,x+1,y,255);
Sleep(1);
SetPixel(hdc,x+3,y+2,255);
Sleep(1);
SetPixel(hdc,x+3,y-2,255);
Sleep(1);
SetPixel(hdc,x+2,y-1,255);
Sleep(1);
SetPixel(hdc,x+4,y+1,255);
Sleep(1);
SetPixel(hdc,x+4,y-1,255);
Sleep(1);
SetPixel(hdc,x+2,y+1,255);
Sleep(1);
SetPixel(hdc,x,y+3,255);
Sleep(1);
SetPixel(hdc,x+1,y+3,255);
Sleep(1);
SetPixel(hdc,x-1,y+3,255);
Sleep(1);
SetPixel(hdc,x,y+4,255);
Sleep(1);
SetPixel(hdc,x,y+2,255);
Sleep(1);
SetPixel(hdc,x+2,y+3,255);
Sleep(1);
SetPixel(hdc,x-2,y+3,255);
Sleep(1);
SetPixel(hdc,x,y+5,255);
Sleep(1);
SetPixel(hdc,x,y+1,255);
Sleep(1);
SetPixel(hdc,x-1,y+2,255);
Sleep(1);
SetPixel(hdc,x+1,y+4,255);
Sleep(1);
SetPixel(hdc,x+1,y+2,255);
Sleep(1);
SetPixel(hdc,x-1,y+4,255);
Sleep(1);
SetPixel(hdc,x,y-3,255);
Sleep(1);
SetPixel(hdc,x+1,y-3,255);
Sleep(1);
SetPixel(hdc,x-1,y-3,255);
Sleep(1);
SetPixel(hdc,x,y-2,255);
Sleep(1);
SetPixel(hdc,x,y-4,255);
Sleep(1);
SetPixel(hdc,x+2,y-3,255);
Sleep(1);
SetPixel(hdc,x-2,y-3,255);
Sleep(1);
SetPixel(hdc,x,y-1,255);
Sleep(1);
SetPixel(hdc,x,y-5,255);
Sleep(1);
SetPixel(hdc,x-1,y-4,255);
Sleep(1);
SetPixel(hdc,x+1,y-2,255);
Sleep(1);
SetPixel(hdc,x+1,y-4,255);
Sleep(1);
SetPixel(hdc,x-1,y-2,255);
Sleep(1);
SetPixel(hdc,x+6,y,255);
Sleep(1);
SetPixel(hdc,x+7,y,255);
Sleep(1);
SetPixel(hdc,x+5,y,255);
Sleep(1);
SetPixel(hdc,x+6,y+1,255);
Sleep(1);
SetPixel(hdc,x+6,y-1,255);
Sleep(1);
SetPixel(hdc,x+8,y,255);
Sleep(1);
SetPixel(hdc,x+4,y,255);
Sleep(1);
SetPixel(hdc,x+6,y+2,255);
Sleep(1);
SetPixel(hdc,x+6,y-2,255);
Sleep(1);
SetPixel(hdc,x+5,y-1,255);
Sleep(1);
SetPixel(hdc,x+7,y+1,255);
Sleep(1);
SetPixel(hdc,x+7,y-1,255);
Sleep(1);
SetPixel(hdc,x+5,y+1,255);
Sleep(1);
SetPixel(hdc,x-6,y,255);
Sleep(1);
SetPixel(hdc,x-5,y,255);
Sleep(1);
SetPixel(hdc,x-7,y,255);
Sleep(1);
SetPixel(hdc,x-6,y+1,255);
Sleep(1);
SetPixel(hdc,x-6,y-1,255);
Sleep(1);
SetPixel(hdc,x-4,y,255);
Sleep(1);
SetPixel(hdc,x-8,y,255);
Sleep(1);
SetPixel(hdc,x-6,y+2,255);
Sleep(1);
SetPixel(hdc,x-6,y-2,255);
Sleep(1);
SetPixel(hdc,x-7,y-1,255);
Sleep(1);
SetPixel(hdc,x-5,y+1,255);
Sleep(1);
SetPixel(hdc,x-5,y-1,255);
Sleep(1);
SetPixel(hdc,x-7,y+1,255);
Sleep(1);
SetPixel(hdc,x,y+6,255);
Sleep(1);
SetPixel(hdc,x+1,y+6,255);
Sleep(1);
SetPixel(hdc,x-1,y+6,255);
Sleep(1);
SetPixel(hdc,x,y+7,255);
Sleep(1);
SetPixel(hdc,x,y+5,255);
Sleep(1);
SetPixel(hdc,x+2,y+6,255);
Sleep(1);
SetPixel(hdc,x-2,y+6,255);
Sleep(1);
SetPixel(hdc,x,y+8,255);
Sleep(1);
SetPixel(hdc,x,y+4,255);
Sleep(1);
SetPixel(hdc,x-1,y+5,255);
Sleep(1);
SetPixel(hdc,x+1,y+7,255);
Sleep(1);
SetPixel(hdc,x+1,y+5,255);
Sleep(1);
SetPixel(hdc,x-1,y+7,255);
Sleep(1);
SetPixel(hdc,x,y-6,255);
Sleep(1);
SetPixel(hdc,x+1,y-6,255);
Sleep(1);
SetPixel(hdc,x-1,y-6,255);
Sleep(1);
SetPixel(hdc,x,y-5,255);
Sleep(1);
SetPixel(hdc,x,y-7,255);
Sleep(1);
SetPixel(hdc,x+2,y-6,255);
Sleep(1);
SetPixel(hdc,x-2,y-6,255);
Sleep(1);
SetPixel(hdc,x,y-4,255);
Sleep(1);
SetPixel(hdc,x,y-8,255);
Sleep(1);
SetPixel(hdc,x-1,y-7,255);
Sleep(1);
SetPixel(hdc,x+1,y-5,255);
Sleep(1);
SetPixel(hdc,x+1,y-7,255);
Sleep(1);
SetPixel(hdc,x-1,y-5,255);
Sleep(1);
}
return 0;
}
#1 · 16y ago
'Bruno
'Bruno
using

Code:
This
might get you help faster
#2 · 16y ago
Void
Void
Most games block trying to draw topmost. You're going to have to hook onto the functions the game uses to draw and use it to draw your crosshair. Well, as far as I know, that's the only way.
#3 · 16y ago
why06
why06
This is why programmers invented loops. :L

Try using a drawline function as well as it would be a lot easier, also not sure if this will work for Games since they write directly to the screen buffer.
#4 · 16y ago
Void
Void
Quote Originally Posted by why06 View Post
This is why programmers invented loops. :L

Try using a drawline function as well as it would be a lot easier, also not sure if this will work for Games since they write directly to the screen buffer.
Pshh, who uses loops these days? Insufficient code for the win.

Is this seriously your first C++ program? If it is, it's pretty good. I can't seem to believe it though.
#5 · 16y ago
KABLE
KABLE
My "Hello World" pwns his crosshair
#6 · 16y ago
Retoxified
Retoxified
Notepad tells me you have 234 lines within your while loop.
234/2 = 117 Sleep(1)'s.
That would be about 120 miliseconds per draw loop, 1000/120 = 8.34 per second.
Lag up your game so you have less then 8 fps and you should see it just fine(or just remove all Sleep(1)'s except for the very last one :P)
#7 · 16y ago
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

  • help with my first stamina hackBy berki69 in WarRock - International Hacks
    5Last post 18y ago
  • Help with my First Hack C++ No MenuBy killerld in C++/C Programming
    4Last post 17y ago
  • Need help with AlterIW? READ HERE FIRST!By master131 in Call of Duty Modern Warfare 2 Private Servers
    0Last post 15y ago
  • need help with moddingBy BayBee Alyn in Combat Arms Help
    0Last post 15y ago
  • Need help with visual basic PHISHING programBy mariofan901 in Visual Basic Programming
    14Last post 16y ago

Tags for this Thread

None