flameswor10 (05-07-2011),markoj (05-07-2011),pashak (05-06-2011),Stephen (05-07-2011),The Real Red (06-05-2013)
After many hours trying to get D3d functions working in delphi finally worked it out. When I first came to this forum I couldn't find anything related to d3d in delphi, after searching many months, days, hours on google looking for something in delphi for d3d I decided to bite the bullet and try it my self with assistance from some C++ examples. Here is a simple CrossHair , I know you guys find nothing special about this as its common in C++, but us delphi users never have any examples to learn from so this is kinda a big step towards D3D hack menus in Delphi.
XHair:
[highlight=delphi]
procedure DrawXhair (const Device: IDirect3DDevice9; color: D3DCOLOR);
var
viewP: D3DVIEWPORT9;
ScreenCenterX,ScreenCenterY: DWORD;
rec1,rec2: D3DRECT;
begin
// Get screen
Device.GetViewport(viewP);
ScreenCenterX:= ((viewP.Width div 2) - 1);
ScreenCenterY:= ((viewP.Height div 2) - 1);
//Set xhair params
rec1.x1:= ScreenCenterX-20;
rec1.y1:= ScreenCenterY;
rec1.x2:= ScreenCenterX+ 20;
rec1.y2:= ScreenCenterY+1;
rec2.x1:= ScreenCenterX;
rec2.y1:= ScreenCenterY-20;
rec2.x2:= ScreenCenterX+ 1;
rec2.y2:= ScreenCenterY+20;
//Draw crosshair
Device.Clear(1, @rec1, D3DCLEAR_TARGET, color, 0, 0);
Device.Clear(1, @rec2, D3DCLEAR_TARGET, color, 0, 0);
end;
[/highlight]
Example Use:
[highlight=delphi]
function PresentCallBack(const Self: IDirect3DDevice9; pSourceRect, pDestRect: PRect; hDestWindowOverride: HWND; pDirtyRegion: PRgnData): HResult; stdcall;
begin
asm
pushad
end;
pD3Ddev:= Pointer(Self);
//Write Some Text
WriteText(pD3Ddev, 'Test');
//Draw a crosshair($0000ffff = Blue)
DrawXhair(Self,$0000ffff); //$ffff0000 <-- Red
asm
popad
end;
Result := PresentNext( Self,pSourceRect, pDestRect, hDestWindowOverride,pDirtyRegion);
end;
[/highlight]
I hope it saves some delphi coder some time so they dont have spend months searching...
flameswor10 (05-07-2011),markoj (05-07-2011),pashak (05-06-2011),Stephen (05-07-2011),The Real Red (06-05-2013)
The Real Red (06-07-2013)
A small update to have multiple colors, Just adding the following to your unit
Change to this in Present....Code:var iXColor : Integer = 0; const bXColors : array[0..7] of DWord = ($0,$FFA34674,$FF6746A3,$FF6D8CF3,$FF238240,$FFE5dC73,$FFCB7018,$FFA90A0A);
Now have a thread monotoring for keystrokes(this one will use the Add key on the number Pad)....Code:DrawXhair(Self,bXColors[iXColor]);
Use the "+" on NumberPad to cycle through the different colour crosshairsCode:if (GetAsyncKeyState(VK_ADD) <> 0) then begin Inc(iXColor); iXColor:= iXColor mod 8; sleep(10); end;
The Real Red (06-07-2013)
Holy crap dude..
It's fking epic
No I do not make game hacks anymore, please stop asking.
Im sure your just being sarcastic, Anyway I am in the process of making a Menu Unit, I think I got this D3D stuff pimped, Drawing Alpha blended boxes now should have a nice little demo menu by tomorrow code in Delphi.....
I am going to start looking at adding images after I have done a basic menu, D3D supports alpha blending so there is no reason why it shouldn't load a .png and display it..
@Departure
Good luck dude.
And I was not being sarcastic.
I never thought Delphi can do that
Last edited by flameswor10; 05-07-2011 at 06:36 AM.
No I do not make game hacks anymore, please stop asking.
Delphi can do everything that C++ can do except for driver development, But saying that there are SDK's for delphi to build drivers. Yeah its ashame there is no resources out there for Delphi d3d hacks it seems everyone turns to C++ when it comes D3D. Hopefully I can get a well coded base released with lots of comments to encourage other Delphi users to make these...
flameswor10 (05-07-2011),The Real Red (06-07-2013)
Making me read Delphi books now.
Yay... converting people to delphi, Actually if you think about it using delphi to code your hacks is original and no one can say you stole there hacks ect, also has the less detected side effect due to the way delphi compiles...
The Real Red (06-07-2013)
D*mn thats good! *begins searching Delphi tutorials*
My TO-DO list
Yes= No=
Make a hack:
Make my hack WORK: (kind of, it crashed every 5 mins, but it did work )
Get called a hacker while hacking:
Get Called a hacker while legit:
Get banned for hacking(CA,CF,MS,RS):
Get 10 posts:
50:
100:
500:
1000:
Proud member of the High Council of Time Lords
Nice...
Epic Delphi =}