[Question] FindPattern in CodeDemons D3D Base

Posts 1–5 of 5 · Page 1 of 1
[Question] FindPattern in CodeDemons D3D Base
The Basis of CodeDemon, giving this DC / Crash after a while, I think this is part of the code:

Code:
int D3Dinit(void) //Just a hook I used for testing, got it from Marko I believe.
{
	DWORD		hD3D, adr, *vtbl;

	// wait for the d3dx dll
	hD3D=0;
	do {
		hD3D = (DWORD)GetModuleHandle("d3d9.dll");
		Sleep(10);
	} while(!hD3D);
	adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");

	if (adr) {
		memcpy(&vtbl,(void *)(adr+2),4);
		pReset	  = (oReset)	DetourFunction((PBYTE)vtbl[16]   , (PBYTE)Reset   ,5);
 		pEndScene = (oEndScene)	DetourFunction((PBYTE)vtbl[42], (PBYTE)EndScene,5);
 	}
	return 0;
}
The problem of this DC in Bytes, I think lol

Code:
adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
Experitmenting, that's the keyword of coding. It's the source of Trial-and-Error. You will learn more if you do so. No one is going to help you do everything in life.
Well actually mate its not the byte its the detours prolly..
Quote Originally Posted by Alessandro10 View Post
The Basis of CodeDemon, giving this DC / Crash after a while, I think this is part of the code:

Code:
int D3Dinit(void) //Just a hook I used for testing, got it from Marko I believe.
{
	DWORD		hD3D, adr, *vtbl;

	// wait for the d3dx dll
	hD3D=0;
	do {
		hD3D = (DWORD)GetModuleHandle("d3d9.dll");
		Sleep(10);
	} while(!hD3D);
	adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");

	if (adr) {
		memcpy(&vtbl,(void *)(adr+2),4);
		pReset	  = (oReset)	DetourFunction((PBYTE)vtbl[16]   , (PBYTE)Reset   ,5);
 		pEndScene = (oEndScene)	DetourFunction((PBYTE)vtbl[42], (PBYTE)EndScene,5);
 	}
	return 0;
}
The problem of this DC in Bytes, I think lol

Code:
adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
How is that the problem? That's a separate hook used for Test Environment. I believe in his base , he does not hook Cshell. Obviously you will crash without hooking it.
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us