Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. *personal message cut out*
  2.  
  3. //CHLClient::WriteUsercmdDeltaToBuffer index == 23
  4.  
  5. bool __stdcall HookedWriteUsercmdDeltaToBuffer(int slot, void* buf, int from, int to, bool isnewcommand)
  6. {
  7. int* pBackupCommands = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(buf) - 0x30);
  8. int* pNewCommands = reinterpret_cast<int*>(reinterpret_cast<uintptr_t>(buf) - 0x2C);
  9.  
  10. int cl_cmdbackup = 0;
  11. *pBackupCommands = cl_cmdbackup;
  12.  
  13. static bool firstcmd = false;
  14. if (from == -1) firstcmd = true;
  15.  
  16. if (to > g_pClientState->lastoutgoingcommand - cl_cmdbackup)
  17. {
  18. if (firstcmd) from = -1;
  19. firstcmd = false;
  20.  
  21. CUserCmd nullCmd;
  22. CUserCmd* cmdFrom;
  23. CUserCmd* cmdTo;
  24.  
  25. if (from == -1)
  26. {
  27. cmdFrom = &nullCmd;
  28. }
  29. else
  30. {
  31. cmdFrom = g_pInput->GetUserCmd(from);
  32. }
  33.  
  34. if (to == -1)
  35. {
  36. cmdTo = &nullCmd;
  37. }
  38. else
  39. {
  40. cmdTo = g_pInput->GetUserCmd(to);
  41. }
  42.  
  43. static auto WriteUsercmd = reinterpret_cast<void (__fastcall*)(void* buffer, CUserCmd* from, CUserCmd* to)>((uintptr_t)GetModuleHandleA("client.dll") + 0x34FA10);
  44.  
  45. __asm
  46. {
  47. mov ecx, buf;
  48. mov edx, cmdTo;
  49. push cmdFrom;
  50. call WriteUsercmd;
  51. add esp, 4h;
  52. }
  53. }
  54.  
  55. return true;
  56. }
  57.  
  58.  
  59. if (bLagExploit)
  60. {
  61. sendpacket = (sequence_number % 10) == 0;
  62.  
  63. //use multiples of 150 because thats the size of the command-buffer
  64. pCmd->command_number += 3 * 150;
  65. g_pClientState->lastoutgoingcommand += 3 * 150;
  66. g_pClientState->m_NetChannel->m_nOutSequenceNr += 3 * 150;
  67.  
  68. Best Regards,
  69. Kljaky
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement