Device Pointer

Posts 1–15 of 24 · Page 1 of 2
Device Pointer
Ok, so I just started hacking MW2. I found the device pointer with Hell_Demon's tutorial. What do I have to do now, to actually be able to mess around with the graphics?

First I want to be able to draw a menu then work with chams.
Look in @Void Sig - Hooking members of IDirect3DDevice9
Quote Originally Posted by whit++ View Post
Look in @Void Sig - Hooking members of IDirect3DDevice9
Hey you Shaddup

This is what i did for Combat arms

Code:
void HookingIsFun()
{
   DWORD *deviceP = **(DWORD***)Device Pionter Here;
   
   pEndscene = (oEndscene)Detour( (PBYTE)deviceP[42], (PBYTE)myEndscene);
}
Quote Originally Posted by whit View Post
Hey you Shaddup

This is what i did for Combat arms

Code:
void HookingIsFun()
{
   DWORD *deviceP = **(DWORD***)Device Pionter Here;
   
   pEndscene = (oEndscene)Detour( (PBYTE)deviceP[42], (PBYTE)myEndscene);
}
LOL your talking to yourself. You that lonely boi? OT: Yea try using whittys function or look in David's tutorial.
Quote Originally Posted by fukojr2 View Post


LOL your talking to yourself. You that lonely boi? OT: Yea try using whittys function or look in David's tutorial.
Yesh
I need Friends
Quote Originally Posted by whit View Post
Hey you Shaddup

This is what i did for Combat arms

Code:
void HookingIsFun()
{
   DWORD *deviceP = **(DWORD***)Device Pionter Here;
   
   pEndscene = (oEndscene)Detour( (PBYTE)deviceP[42], (PBYTE)myEndscene);
}
This is similiar to what I do for AVA, except I just use PatternFinder for VTable. This way I dont need dPointer
Ok, this is my device pointer: 01C8ED88

Would it then be 0x01C8ED88?
Quote Originally Posted by aanthonyz View Post
Ok, this is my device pointer: 01C8ED88

Would it then be 0x01C8ED88?
A yesh Sir....
Code:
void HookingIsFun()
{
   DWORD *deviceP = **(DWORD***)Device Pionter Here;
   
   pEndscene = (oEndscene)Detour( (PBYTE)deviceP[42], (PBYTE)myEndscene);
}
Gonna try this. If it works then the org. creator is going to get so so many thanks
Quote Originally Posted by user590177 View Post
Code:
void HookingIsFun()
{
   DWORD *deviceP = **(DWORD***)Device Pionter Here;
   
   pEndscene = (oEndscene)Detour( (PBYTE)deviceP[42], (PBYTE)myEndscene);
}
Gonna try this. If it works then the org. creator is going to get so so many thanks
i dont know who first thought of Hooking via Device Pionter
How would I use code like this:
Code:
src[0] = 0x90; //50
src[1] = 0x90; // 58
src[2] = 0xE9;
I get:

error preprocessor command must start as first nonwhite space
Quote Originally Posted by aanthonyz View Post
How would I use code like this:
Code:
src[0] = 0x90; //50
src[1] = 0x90; // 58
src[2] = 0xE9;
I get:

error preprocessor command must start as first nonwhite space
are you doing that in Global Scope?
This is my code:
Code:
#include <windows.h>
#include "Detour.h"
#include <d3d9.h>

typedef HRESULT(__stdcall* Real_EndScene)(LPDIRECT3DDEVICE9);
Real_EndScene oEndScene = NULL;

HRESULT __stdcall hook_EndScene(LPDIRECT3DDEVICE9 pDevice)
{
	MessageBox(NULL,"Hooked","Hooked",MB_OK);
	pDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME);
	return oEndScene(pDevice);
}

DWORD GetPointerDereference(int index)
{
	DWORD *DevicePointer = **(DWORD***)0x01C8ED88;
	return DevicePointer[index];
}

DWORD GetPointerInlineAssembly(int index)
{
	DWORD DevicePointer = 0x01C8ED88;
	__asm
	{
		mov eax,[DevicePointer]
		mov ebx,[eax]
		mov ecx,[ebx]
		mov eax,index
		mov ebx,4
		mul ebx
		mov edx,[ecx+eax]
		mov DevicePointer,edx
	}
return DevicePointer;
}

void Hook()
{
	while(!GetModuleHandle("d3d9.dll"))
	{
		Sleep(100);
	}
	while( *(DWORD*)0x01C8ED88 == 0)
	{
		Sleep(100);
	}
	oEndScene = (Real_EndScene)DetourFunc((PBYTE)GetPointerInlineAssembly(42),(PBYTE)hook_EndScene,5);
}

bool __stdcall DllMain(HINSTANCE hInstance,DWORD reason, void* useless)
{
if(reason == DLL_PROCESS_ATTACH)
	{
	CreateThread(0,0,(LPTHREAD_START_ROUTINE)Hook,0,0,0);
	}
if(reason == DLL_PROCESS_DETACH)
	{
	}
return true;
}
Detour.h

Code:
void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
{
BYTE *jmp = (BYTE*)malloc(len+5);
DWORD dwBack;
VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
memcpy(jmp, src, len);
jmp += len;
jmp&#91;0] = 0xE9;
*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
src&#91;0] = 0x90; //50
src&#91;1] = 0x90; // 58
src&#91;2] = 0xE9;
*(DWORD*)(&src&#91;3]) = (DWORD)(dst - src) - 7;
for (int i=7; i<len; i++) src&#91;i] = 0x90;
VirtualProtect(src, len, dwBack, &dwBack);
return (jmp-len);
}
I get that error in main.cpp and the header
Try putting DetourFunc in the cpp that sometime Fix alot of badboys
No difference, same number of problems...
Code:
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(14) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(15) : error C2296: '&' : illegal, left operand has type 'BYTE *'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(16) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(17) : error C2296: '&' : illegal, left operand has type 'BYTE *'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(17) : error C2297: '&' : illegal, right operand has type 'BYTE *'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(17) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(18) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(19) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2059: syntax error : 'for'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2143: syntax error : missing ')' before ';'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2065: 'i' : undeclared identifier
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2065: 'i' : undeclared identifier
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2143: syntax error : missing ';' before ')'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2143: syntax error : missing ';' before ')'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(20) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(35) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(36) : error C2059: syntax error : '}'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(43) : error C2400: inline assembler syntax error in 'second operand'; found 'AND'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(43) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(44) : error C2400: inline assembler syntax error in 'second operand'; found 'AND'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(44) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(45) : error C2400: inline assembler syntax error in 'second operand'; found 'AND'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(45) : error C2014: preprocessor command must start as first nonwhite space
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(49) : error C2400: inline assembler syntax error in 'second operand'; found 'AND'
1>c:\documents and settings\administrator\my documents\visual studio 2008\projects\mw2\mw2\main.cpp(49) : error C2014: preprocessor command must start as first nonwhite space
Posts 1–15 of 24 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Need help?