Advertisement
dcomicboy

hook

Nov 7th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. int D3D (void)
  2.  
  3. {
  4. HMODULE CBBase = NULL;
  5. for (;CBBase == NULL;Sleep(100))
  6. CBBase = LoadLibrary("d3d8.dll");
  7. DWORD* VTableS = 0;
  8. DWORD hD3D8 = (DWORD)GetModuleHandle("d3d8.dll");
  9. DWORD table = FindPattern(hD3D8, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
  10. memcpy(&VTableS, (void*)(table+2), 4);
  11. DWORD dwDrawIndexedPrimitive = VTableS[71];
  12. DWORD dwSetStreamSource = VTableS[83];
  13. DWORD dwPresent = VTableS[15];
  14. MessageBox( NULL, "Made By KaptinBoxxi", "Success!",MB_ICONINFORMATION | MB_SERVICE_NOTIFICATION);
  15. {
  16. pDrawIndexedPrimitive = (oDrawIndexedPrimitive)DetourCreate((PBYTE)dwDrawIndexedPrimitive, (PBYTE)myDrawIndexedPrimitive, 7);
  17. pSetStreamSource = (oSetStreamSource)DetourCreate((PBYTE)dwSetStreamSource, (PBYTE)mySetStreamSource, 7);
  18. pPresent = (oPresent)DetourCreate((PBYTE)dwPresent, (PBYTE)myPresent, 7);
  19. return 0;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement