Guest User

Untitled

a guest
Sep 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. bool isReady = false;
  2.  
  3. typedef struct
  4. {
  5. BYTE Data[0x3000];
  6. } WeaponMgrCopy;
  7.  
  8. WeaponMgrCopy* Weapons[670];
  9.  
  10. void backup(DWORD cshell,DWORD WeaponMgr)
  11. {
  12. DWORD pWeaponMgr = *(DWORD*)(cshell+WeaponMgr );
  13. for(int i=0;i<=999;i++)
  14. {
  15. DWORD Weapon = (*(DWORD*)(pWeaponMgr + (4*i)));
  16. if (Weapon != NULL)
  17. {
  18. Weapons[i] = new WeaponMgrCopy;
  19. memcpy(Weapons[i], (void*)(Weapon), 0x1400);
  20. }
  21. }
  22. }
  23.  
  24. WeaponMgrCopy* bypass (int GunIndexNR)
  25. {
  26. return Weapons[GunIndexNR];
  27. }
  28.  
  29. void MakeCall(BYTE* paddress, DWORD yourfunction, DWORD dwlen)
  30. {
  31. DWORD dwOldProtect, dwBkup, dwRelAddr;
  32. VirtualProtect(paddress, dwlen, PAGE_EXECUTE_READWRITE, &dwOldProtect);
  33. dwRelAddr = (DWORD) (yourfunction - (DWORD) paddress) - 5;
  34. *paddress = 0xE8;
  35. *((DWORD*) (paddress + 0x1)) = dwRelAddr;
  36. for(DWORD x = 0x5; x < dwlen; x++) *(paddress + x) = 0x90;
  37. VirtualProtect(paddress, dwlen, dwOldProtect, &dwBkup);
  38. return;
  39. }
  40.  
  41.  
  42. //put this under this
  43. void Hack (void)
  44. {
  45. while (1)
  46. {
  47. if (isReady == false)
  48. {
  49. backup(dw_Cshell,weaponMgr);
  50. if (*(BYTE*)(dw_Cshell+0x2B5C75)) // string : Crossfire
  51. {
  52. MakeCall((BYTE*)(dw_Cshell+0x2B5C75), (DWORD)bypass, 5);
  53. isReady = true;
  54. }
  55. else continue;
  56. }
  57. }
  58. }
Add Comment
Please, Sign In to add comment