Исходник Doubletap / write_usercmd_delta_to_buffer

jesus fuck my eyes help
 
bool write_usercmd_delta_to_buffer(void* ecx, int nSlot, bf_write* buf, int from, int to, bool isNewCmd)
{
using write_usercmd_delta_to_buffer_t = bool(__thiscall*)(void*, int, void*, int, int, bool);

if (exploits.tickbaseshift <= 0)
return ((write_usercmd_delta_to_buffer_t)((*(void***)base_client())[24]))(base_client(), nSlot, buf, from, to, isNewCmd);

if (from != -1)
return true;

auto CL_SendMove = []() {
using CL_SendMove_t = void(__fastcall*)(void);
static CL_SendMove_t CL_SendMoveF = (CL_SendMove_t)sig("engine.dll", "55 8B EC A1 ? ? ? ? 81 EC ? ? ? ? B9 ? ? ? ? 53 8B 98");

CL_SendMoveF();
};
auto WriteUsercmd = [](bf_write* buf, c_user_cmd* in, c_user_cmd* out) {
using WriteUsercmd_t = void(__fastcall*)(bf_write*, c_user_cmd*, c_user_cmd*);
static WriteUsercmd_t WriteUsercmdF = (WriteUsercmd_t)sig("client.dll", "55 8B EC 83 E4 F8 51 53 56 8B D9 8B 0D");
WriteUsercmdF(buf, in, out);

};
int* pNumBackupCommands = (int*)(reinterpret_cast <uintptr_t> (buf) - 0x30);
int* pNumNewCommands = (int*)(reinterpret_cast <uintptr_t> (buf) - 0x2C);
auto net_channelxd = *reinterpret_cast <c_net_channel**> (reinterpret_cast <uintptr_t> (client_state) + 0x9C);
int32_t new_commands = *pNumNewCommands;

int32_t next_cmdnr = client_state->last_command + client_state->choked_commands + 1;
int32_t total_new_commands = min(exploits.tickbaseshift, 16);
exploits.tickbaseshift -= total_new_commands;

from = -1;
*pNumNewCommands = total_new_commands;
*pNumBackupCommands = 0;

for (to = next_cmdnr - new_commands + 1; to <= next_cmdnr; to++) {
if (!((write_usercmd_delta_to_buffer_t)((*(void***)base_client())[24]))(base_client(), nSlot, buf, from, to, isNewCmd));
return false;

from = to;
}

c_user_cmd* last_realCmd = input->GetUserCmd(nSlot, from);
c_user_cmd fromCmd;

if (last_realCmd)
fromCmd = *last_realCmd;

c_user_cmd toCmd = fromCmd;
toCmd.command_number++;
toCmd.tick_count += 200;

for (int i = new_commands; i <= total_new_commands; i++) {
WriteUsercmd(buf, &toCmd, &fromCmd);
fromCmd = toCmd;
toCmd.command_number++;
toCmd.tick_count++;
}

return true;
}

void BypassChokeLimit(CCLCMsg_Move_t* CL_Move, c_net_channel* pNetChan)
{
// not shifting or dont need do extra fakelag
if (exploits.tickbaseshift == 0 && (CL_Move->m_nNewCommands != 15 || client_state->choked_commands <= 14))
return;

using assign_lol = std::string & (__thiscall*)(void*, uint8_t*, size_t);
auto assign_std_autistic_string = (assign_lol)sig("client.dll", "55 8B EC 53 8B 5D 08 56 8B F1 85 DB 74 57 8B 4E 14 83 F9 10 72 04 8B 06 EB 02");

// rebuild CL_SendMove
uint8_t data[4000];
bf_write buf;
buf.m_nDataBytes = 4000;
buf.m_nDataBits = 32000;
buf.m_pData = data;
buf.m_iCurBit = false;
buf.m_bOverflow = false;
buf.m_bAssertOnOverflow = false;
buf.m_pDebugName = false;

int numCmd = client_state->choked_commands + 1;
int nextCmdNr = client_state->last_command + numCmd;
if (numCmd > 62)
numCmd = 62;

bool bOk = true;

auto to = nextCmdNr - numCmd + 1;
auto from = -1;
if (to <= nextCmdNr) {
int newcmdnr = to >= (nextCmdNr - numCmd + 1);
do {
bOk = bOk && write_usercmd_delta_to_buffer(base_client(), 0, &buf, from, to, to >= newcmdnr);
from = to++;
} while (to <= nextCmdNr);
}

if (bOk) {
if (exploits.tickbaseshift > 0) {
c_user_cmd from_cmd, to_cmd;
from_cmd = *input->GetUserCmd(0, nextCmdNr);
to_cmd = from_cmd;
to_cmd.tick_count = INT_MAX;

do {
if (numCmd >= 62) {
exploits.tickbaseshift = 0;
break;
}

to_cmd.command_number++;
WriteUsercmd(&buf, &to_cmd, &from_cmd);

exploits.tickbaseshift--;
numCmd++;
} while (exploits.tickbaseshift > 0);
}
else {
exploits.tickbaseshift = 0;
}

// bypass choke limit
CL_Move->m_nNewCommands = numCmd;
CL_Move->m_nBackupCommands = 0;

int curbit = (buf.m_iCurBit + 7) >> 3;
assign_std_autistic_string(CL_Move->m_data, buf.m_pData, curbit);
}
}

Replace client_panorama.dll to client.dll please.
 
and don't give me angry wtf man
 
oh shit here we go to paste
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Not right.
 
theres lots of fucking missing shit on this code, did you even looked at the code you were trying to upload?
 
Назад
Сверху Снизу