//CHLClient::WriteUsercmdDeltaToBuffer index == 23 bool __stdcall HookedWriteUsercmdDeltaToBuffer(int slot, void* buf, int from, int to, bool isnewcommand) { int* pBackupCommands = reinterpret_cast(reinterpret_cast(buf) - 0x30); int* pNewCommands = reinterpret_cast(reinterpret_cast(buf) - 0x2C); int cl_cmdbackup = 0; *pBackupCommands = cl_cmdbackup; static bool firstcmd = false; if (from == -1) firstcmd = true; if (to > g_pClientState->lastoutgoingcommand - cl_cmdbackup) { if (firstcmd) from = -1; firstcmd = false; CUserCmd nullCmd; CUserCmd* cmdFrom; CUserCmd* cmdTo; if (from == -1) { cmdFrom = &nullCmd; } else { cmdFrom = g_pInput->GetUserCmd(from); } if (to == -1) { cmdTo = &nullCmd; } else { cmdTo = g_pInput->GetUserCmd(to); } static auto WriteUsercmd = reinterpret_cast((uintptr_t)GetModuleHandleA("client.dll") + 0x34FA10); __asm { mov ecx, buf; mov edx, cmdTo; push cmdFrom; call WriteUsercmd; add esp, 4h; } } return true; }