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 › MultiPlayer Game Hacks & Cheats › Combat Arms Hacks & Cheats › Combat Arms Hack Coding / Programming / Source Code › [Tutorial] D3D Crosshairs

[Tutorial] D3D Crosshairs

Posts 1–15 of 80 · Page 1 of 6
…
★Rusty
★Rusty
[Tutorial] D3D Crosshairs
D3D Crosshairs

Ive seen the same basic/boring crosshair in public hacks and not many threads on how to do crosshairs.
So i thought id share how to create different styles.
Many of you may already know how to do this im just helping out the noobs.
If you don't understand something just post and i will try and help.
Enjoy

Globals:(Top of Code)
Code:
#define PI 3.14159265//Defining what PI is. PI is a Circle 
int CenterX = GetSystemMetrics( 0 ) / 2-1;//Gets screen X resolution then cutting it in half to get the center.
int CenterY = GetSystemMetrics( 1 ) / 2-1;//Gets screen Y resolution then cutting it in half to get the center.
LPDIRECT3DDEVICE9 pDevice;
ID3DXLine *pLine;
Basic Crosshair:
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/4.jpg[/IMG]
Notes:
When you see "CenterX-15" it means CenterX Minus 15 pixels.
Code:
//FillRGB(XPosition,YPosition,Width,Height,Color);
Function:
void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}
Drawing it:
FillRGB(CenterX-15, CenterY, 30, 1,Red,pDevice);//Diagonal line
FillRGB(CenterX, CenterY-15, 1, 30,Red,pDevice);//Vertical line
Circle Crosshair:
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/1.jpg[/IMG]

Code:
//DrawCircle(XPosition,YPosition,Radius,numSides,Color);
Function:
void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color) 
{ 

    D3DXVECTOR2 Line[128]; 
    float Step = PI * 2.0 / numSides; 
    int Count = 0; 
    for (float a=0; a < PI*2.0; a += Step) 
    { 
        float X1 = radius * cos(a) + X; 
        float Y1 = radius * sin(a) + Y; 
        float X2 = radius * cos(a+Step) + X; 
        float Y2 = radius * sin(a+Step) + Y; 
        Line[Count].x = X1; 
        Line[Count].y = Y1; 
        Line[Count+1].x = X2; 
        Line[Count+1].y = Y2; 
        Count += 2; 
    } 
    pLine->Begin(); 
    pLine->Draw(Line,Count,Color); 
    pLine->End(); 
}
Drawing it:
DrawCircle(CenterX,CenterY,8,8,Red);
Dot:
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/5.jpg[/IMG]
Notes:
If you adjust the size you will have to adjust the position to suit.
Example:
DrawPoint(CenterX-10,CenterY-10, 10, 10, Green);
The size is now 10 so i -10 off the XY position to suit.
Code:
//DrawPoint(XPosition,YPosition,Width,Height,Color);
Function:
void DrawPoint(int x, int y, int w, int h, DWORD color)
{
    FillRGB((int)x, (int)y, (int)w, (int)h, color);

} 
Drawing it:
DrawPoint(CenterX-1,CenterY-1, 1, 1, Green);
Cross Crosshair:
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/3.jpg[/IMG]
Notes:
XPosStart YPosStart starts the line and then XPosFinish YPosFinish is where the line will be drawn too.
Code:
//DrawLine(XPosStart,YPosStart,XPosFinish,YPosFinish,Width,Color);
Function:
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
    D3DXVECTOR2 vLine[2];
    pLine->SetWidth( width );
    pLine->SetAntialias( false );
    pLine->SetGLLines( true );
    vLine[0].x = x;
    vLine[0].y = y;
    vLine[1].x = x2;
    vLine[1].y = y2;
    pLine->Begin();
    pLine->Draw( vLine, 2, color );
    pLine->End();
}
Drawing it:
DrawLine(CenterX+10,CenterY+10,CenterX-10,CenterY-10,1,Red);
DrawLine(CenterX-10,CenterY+10,CenterX+10,CenterY-10,1,Red);
Now that we have the main ones you can start merging them and making your own ones.
You have all the functions so ill just give your a picture and the drawing code.
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/6.jpg[/IMG]
Code:
DrawCircle(CenterX,CenterY,8,8,Red);//Circle
FillRGB(CenterX-17, CenterY, 10, 1,Red,pDevice);//Left line
FillRGB(CenterX+9, CenterY, 10, 1,Red,pDevice); // Right line
FillRGB(CenterX, CenterY-17, 1, 10,Red,pDevice);//Top line
FillRGB(CenterX, CenterY+9, 1, 10,Red,pDevice);//Bottom line
DrawPoint(CenterX, CenterY, 1, 1, Green);//Dot point
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/7.jpg[/IMG]
Code:
FillRGB(CenterX-15, CenterY, 10, 1,Red,pDevice);//Left line
FillRGB(CenterX+6, CenterY, 10, 1,Red,pDevice);//Right line
FillRGB(CenterX, CenterY-15, 1, 10,Red,pDevice);//Top line
FillRGB(CenterX, CenterY+6, 1, 10,Red,pDevice);//Bottom line
DrawPoint(CenterX-1 , CenterY-1, 1, 1, Green);//Dot point
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/8.jpg[/IMG]
Code:
DrawCircle(CenterX-1,CenterY-1,8,8,Red);//Circle
FillRGB(CenterX-13, CenterY, 10, 1,Red,pDevice);//Left line
FillRGB(CenterX+4, CenterY, 10, 1,Red,pDevice);//Right line
FillRGB(CenterX, CenterY-13, 1, 10,Red,pDevice);//Top line
FillRGB(CenterX, CenterY+4, 1, 10,Red,pDevice);//Bottom line
DrawPoint(CenterX-1 , CenterY-1, 1, 1, Green);//Dot point
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/9.jpg[/IMG]
Code:
DrawLine(CenterX+15,CenterY+15,CenterX+3,CenterY+3,2,Red);// Bottom right to center
DrawLine(CenterX-15,CenterY+15,CenterX-3,CenterY+3,2,Red);//Bottom left to center
DrawLine(CenterX+15,CenterY-15,CenterX+3,CenterY-3,2,Red);//Top right to center
DrawLine(CenterX-15,CenterY-15,CenterX-3,CenterY-3,2,Red);//Top left to center
DrawPoint(CenterX,CenterY,1,1,Green);//Dot point
[IMG]http://i238.photobucke*****m/albums/ff101/wes0001/10.jpg[/IMG]
Code:
FillRGB(CenterX-20, CenterY, 40, 1,Purple,pDevice);//Purple
FillRGB(CenterX, CenterY-20, 1, 40,Purple,pDevice);

FillRGB(CenterX-17, CenterY, 34, 1,Blue,pDevice);//Blue
FillRGB(CenterX, CenterY-17, 1, 34,Blue,pDevice);

FillRGB(CenterX-14, CenterY, 28, 1,Cyan,pDevice);//Cyan
FillRGB(CenterX, CenterY-14, 1, 28,Cyan,pDevice);

FillRGB(CenterX-11, CenterY, 22, 1,Green,pDevice);//Green
FillRGB(CenterX, CenterY-11, 1, 22,Green,pDevice);

FillRGB(CenterX-9, CenterY, 18, 1,Yellow,pDevice);//Yellow
FillRGB(CenterX, CenterY-9, 1, 18,Yellow,pDevice);

FillRGB(CenterX-6, CenterY, 12, 1,Orange,pDevice);//Orange
FillRGB(CenterX, CenterY-6, 1, 12,Orange,pDevice);

FillRGB(CenterX-3, CenterY, 6, 1,Red,pDevice);//Red
FillRGB(CenterX, CenterY-3, 1, 6,Red,pDevice);


Credits:
★Rusty
ac1d_buRn - Some Functions
CodeDemon - Some Functions
Other people(dont know who) - Some Functions
#1 · edited 15y ago · 15y ago
Physcadelic
Physcadelic
Nice.
It's nice to see a crosshair tut.
#2 · 15y ago
ac1d_buRn
ac1d_buRn
Looks good.
#3 · 15y ago
Mr.Magicman
Mr.Magicman
Good tutorial but explain to the unknowing what you are doing instead of just supplying code...

Like tell them what GetSystemMetrics realy do its just a tip
#4 · 15y ago
wassup40
wassup40
Wow amazing tut thank's dude.
#5 · 15y ago
Jàzzà_
Jàzzà_
Great tut interesting...
#6 · 15y ago
freedompeace
freedompeace
Quote Originally Posted by Mr.Magicman View Post
Good tutorial but explain to the unknowing what you are doing instead of just supplying code...

Like tell them what GetSystemMetrics realy do its just a tip
They can Google it. It's not that hard - it's actually incredibly easy D:
#7 · 15y ago
seeplusplus
seeplusplus
I was going to call you a leecher, but then I saw the credits. Great post!
#8 · 15y ago
Sydney
Sydney
Some fails in there.Its at the wrong pos. And there are many pDevice errors.
#9 · 15y ago
IN
inliner
wow thanks this tut looks great maybe ill add some new crosshairs to my hack
#10 · 15y ago
ST
Stephen
Now, /me doesnt have to write it out
#11 · 15y ago
Amatowarrior
Amatowarrior
Finally! A tutorial for this! Thank you!
#12 · 15y ago
UGodly
UGodly
very nice tut will try it on my other hack
#13 · 15y ago
dontcrymore15
dontcrymore15
Wo0w Thank Rusty, Good JOB::::!!! :@
#14 · 15y ago
Disturbed
[MPGH]Disturbed
Not really a tutorial, more like source code.

Tutorial for people who know what they are doing.
#15 · 15y ago
Posts 1–15 of 80 · Page 1 of 6
…

Post a Reply

Similar Threads

  • d3d crosshairBy qsc in C++/C Programming
    17Last post 17y ago
  • A vidtut for d3d crosshairs?By Lolland in Programming Tutorial Requests
    1Last post 16y ago
  • [Undetected] D3D CrosshairBy AeroMan in WarRock - International Hacks
    79Last post 16y ago
  • D3D Crosshair V3.0 - (Uprade + Release)By AeroMan in WarRock - International Hacks
    27Last post 16y ago
  • My New D3D Crosshair SOURCECODEBy HerrArkanes in CrossFire Hacks & Cheats
    28Last post 16y ago

Tags for this Thread

None