| View previous topic :: View next topic |
| Author |
Message |
peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Thu Feb 02, 2012 9:34 pm Post subject: [Help] - D3D8 Vtable Hook |
|
|
D3D8 Vtable Hook
I found this and want to test in delphi, but don't know some syntax in delphi. Could anyone help please..TY
DWORD dwEndScene = VTableHook[35]; <====== What's syntax in delphi ?
//=======================================Vtable Hook====================================================================//
int D3D8BASE (void)
{
HMODULE D3D8BASE = NULL;
for (;D3D8BASE == NULL;Sleep(100))
D3D8BASE = LoadLibrary("d3d8.dll");
DWORD* VTableHook = 0;
DWORD hD3D8 = (DWORD)GetModuleHandle("d3d8.dll");
DWORD VIRTUALTABLE = FindPattern(hD3D8, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
memcpy(&VTableHook, (void*)(VIRTUALTABLE+2), 4);
DWORD dwEndScene = VTableHook[35]; // <-------------------- Here
DWORD dwDrawIndexedPrimitive = VTableHook[71];
DWORD dwSetStreamSource = VTableHook[83];
DWORD dwSetViewport = VTableHook[40];
DWORD dwSetRenderState = VTableHook[50];
pDrawIndexedPrimitive = (oDrawIndexedPrimitive)DetourFunc((PBYTE)dwDrawIndexedPrimitive, (PBYTE)myDrawIndexedPrimitive, 7);
pSetStreamSource = (oSetStreamSource)DetourFunc((PBYTE)dwSetStreamSource, (PBYTE)mySetStreamSource, 7);
pEndScene = (oEndScene)DetourFunc((PBYTE)dwEndScene, (PBYTE)myEndScene, 7);
pSetViewport = (oSetViewport)DetourFunc((PBYTE)dwSetViewport, (PBYTE)mySetViewport, 7);
pSetRenderState = (oSetRenderState)DetourFunc((PBYTE)dwSetRenderState, (PBYTE)mySetRenderState, 7);
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D8BASE, NULL, NULL, NULL);
}
return TRUE;
}
_________________
my name is peter4d5 |
|
| Back to top |
|
 |
peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Fri Feb 03, 2012 11:00 am Post subject: |
|
|
no one?. DarkByte please... Only one sentence, not all..
_________________
my name is peter4d5 |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25956 Location: The netherlands
|
Posted: Fri Feb 03, 2012 1:11 pm Post subject: |
|
|
| Code: |
DWORD dwEndScene = VTableHook[35];
|
is in delphi
| Code: |
var dwEndcene: DWORD
...
begin
dwEndScene := VTableHook[35];
|
and before you ask: dword *VTableHook is VTableHook: PDwordArray;
(note that if you have FPC and use native fpc syntax you can just use PDWORD instead of PDWORDARRAY)
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Fri Feb 03, 2012 7:18 pm Post subject: |
|
|
Thank you verymuch. I will test it tonight.
_________________
my name is peter4d5 |
|
| Back to top |
|
 |
peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Mon Feb 06, 2012 4:50 am Post subject: |
|
|
Case Closed...
But i have some question..
Why game freeze when exit, since i already hook reset and this problem occurs in some games and
may be d3d8 or d3d9 (specific games). In this case is Delta force : Black Hawk Down.
and please guide me how to hook window mode and Increase resolution in d3d8,d3d9.
Thank you.
Peter4d5.
----------------------------------------------------
hD3D8 = 6D9A0000
VIRTUALTABLE Base = 6D9C942C
VTableHook = 6D9A8308
dwReset = 6D9EE3B0
dwEndScene = 6D9D93A0
@OnResetCallBack = 13159930
@EndScene8Callback = 1315998C
pdword(VTableHook[14])^ := 8B55FF8B
pdword(VTableHook[35])^ := 8B55FF8B
@dwReset Hooked success
@EndScene8 Hooked success
pdword(VTableHook[14])^ := 76B57BE9
pdword(VTableHook[35])^ := 7805E7E9
[/url]
_________________
my name is peter4d5 |
|
| Back to top |
|
 |
peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Mon Feb 06, 2012 6:38 pm Post subject: |
|
|
sorry, if my post don't follow site's rule, i can't edit it,
next time, i will correct it.
_________________
my name is peter4d5 |
|
| Back to top |
|
 |
|