-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
хз может кому то надо
Дт стал тепать лучше)
credits defnot
C++:
bool __fastcall hooks::hooked_writeusercmddeltatobuffer(void* ecx_, void* edx_, int nslot, bf_write* buf, int from, int to, bool isnewcmd)
{
static auto sendmovecall = (void*)util::FindSignature(crypt_str("engine.dll"), crypt_str("84 C0 74 04 B0 01 EB 02 32 C0 8B FE 46 3B F3 7E C9 84 C0 0F 84"));
static auto original_fn = client_hook->get_func_address <WriteUsercmdDeltaToBuffer_t>(24);
if (!g_ctx.globals.tickbase_shift)
return original_fn(ecx_, nslot, buf, from, to, isnewcmd);
uintptr_t stackbase;
__asm mov stackbase, ebp;
auto m_pnNewCmds = reinterpret_cast <int*> (stackbase + 0xFCC);
int m_nNewCmds = *m_pnNewCmds;
int m_nTickbase = g_ctx.globals.tickbase_shift;
int m_nTotalNewCmds = min(m_nNewCmds + abs(m_nTickbase), 62);
if (from != -1)
return true;
int m_nNewCommands = m_nTotalNewCmds;
int m_nBackupCommands = 0;
int m_nNextCmd = m_clientstate()->m_last_outgoing_command + m_clientstate()->m_choked_commands + 1;
if (to > m_nNextCmd)
{
Run:
CUserCmd* m_pCmd = m_input()->GetUserCmd(from);
if (m_pCmd)
{
CUserCmd m_nToCmd = *m_pCmd, m_nFromCmd = *m_pCmd;
m_nToCmd.m_command_number++;
m_nToCmd.m_tickcount += m_globals()->m_tickcount + 2 * m_globals()->m_tickcount;
for (int i = m_nNewCmds; i <= m_nTotalNewCmds; i++)
{
int m_shift = m_nTotalNewCmds - m_nNewCmds + 1;
do
{
// WriteUserŃmd(buf, &m_nToCmd, &m_nFromCmd);
m_nFromCmd.m_buttons = m_nToCmd.m_buttons;
m_nFromCmd.m_viewangles.x = m_nToCmd.m_viewangles.x;
m_nFromCmd.m_impulse = m_nToCmd.m_impulse;
m_nFromCmd.m_weaponselect = m_nToCmd.m_weaponselect;
m_nFromCmd.m_aimdirection.y = m_nToCmd.m_aimdirection.y;
m_nFromCmd.m_weaponsubtype = m_nToCmd.m_weaponsubtype;
m_nFromCmd.m_upmove = m_nToCmd.m_upmove;
m_nFromCmd.m_random_seed = m_nToCmd.m_random_seed;
m_nFromCmd.m_mousedx = m_nToCmd.m_mousedx;
m_nFromCmd.pad_0x4C[3] = m_nToCmd.pad_0x4C[3];
m_nFromCmd.m_command_number = m_nToCmd.m_command_number;
m_nFromCmd.m_tickcount = m_nToCmd.m_tickcount;
m_nFromCmd.m_mousedy = m_nToCmd.m_mousedy;
m_nFromCmd.pad_0x4C[19] = m_nToCmd.pad_0x4C[19];
m_nFromCmd.m_predicted = m_nToCmd.m_predicted;
m_nFromCmd.pad_0x4C[23] = m_nToCmd.pad_0x4C[23];
m_nToCmd.m_command_number++;
m_nToCmd.m_tickcount++;
--m_shift;
} while (m_shift);
}
return true;
}
}
else
{
while (original_fn(ecx_, nslot, buf, from, to, true))
{
from = to++;
if (to > m_nNextCmd)
goto Run;
}
return false;
}
return true;
}
void WriteUserŃmd(void* buf, CUserCmd* incmd, CUserCmd* outcmd)
{
using WriteUserCmd_t = void(__fastcall*)(void*, CUserCmd*, CUserCmd*);
static auto Fn = (WriteUserCmd_t)util::FindSignature(crypt_str("client.dll"), crypt_str("55 8B EC 83 E4 F8 51 53 56 8B D9"));
__asm
{
mov ecx, buf
mov edx, incmd
push outcmd
call Fn
add esp, 4
}
}
credits defnot