Code: __declspec(naked) void MyEndscene( ) { static LPDIRECT3DDEVICE9 pDevice; __asm { mov esi,[ebp+0x08] xor ebx,ebx mov pDevice, esi; } //Blalbalbalbalbalb __asm { jmp dwEndscene_ret; } } /*=============================================*/ /**/void HOOK_Endscene_Detour() /**/{ /**/ DWORD HD3D9 = (DWORD)LoadLibrary(egamed3d9); /**/ DWORD * VTable; /**/ DWORD pDevice = FindPattern((DWORD)HD3D9, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx"); /**/ if(pDevice) /**/ { /**/ memcpy(&VTable, (void *)(pDevice+2),4); /**/ dwEndscene_hook = VTable[42] + 0x1F; /**/ dwEndscene_ret = dwEndscene_hook + 0x5; /**/ MakeJMP((BYTE *)dwEndscene_hook, (DWORD)MyEndscene,0x5); /**/ }Variable[ 2 ] = 1; /**/} /*=============================================*/