Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <Windows.h>
  2.  
  3. typedef int(__thiscall *createGameObject)(void* sObj1);
  4. createGameObject createEmptyObject = (createGameObject)0xA09C62;
  5.  
  6. VOID(__cdecl* spawnCode_o)(void*, DWORD, DWORD, DWORD);
  7.  
  8. VOID __cdecl spawnCode(void* a1, DWORD a2, DWORD a3, DWORD a4)
  9. {
  10. cScriptObject* scriptDataObject = (cScriptObject*)a4;
  11. cArmAString* aString = (cArmAString*)scriptDataObject->cDataPointer->scriptData; ) // 0x0] -> 0x4] -> 0x12
  12.  
  13. if (!aString)
  14. return spawnCode_o(a1, a2, a3, a4);
  15.  
  16. char* foundStr = strstr(aString->szFinalString, "PVAHR");
  17.  
  18. if (foundStr != NULL)
  19. {
  20. createEmptyObject(a1);
  21. }
  22. else
  23. {
  24. return spawnCode_o(a1, a2, a3, a4);
  25. }
  26.  
  27. }
  28.  
  29. bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD Reason, LPVOID lpReserved)
  30. {
  31. if (Reason == DLL_PROCESS_ATTACH)
  32. {
  33. DWORD dwOld = 0;
  34. spawnCode_o = (VOID(__cdecl*)(void*, DWORD, DWORD, DWORD))DetourFunc((BYTE*)0x7A411E, (BYTE*)spawnCode, 5);
  35. VirtualProtect(spawnCode_o, 2, PAGE_EXECUTE_READWRITE, &dwOld);
  36. }
  37. return true;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement