use hooking utils invoke
This commit is contained in:
parent
41172e10e6
commit
8bf28416e7
@ -96,8 +96,7 @@ namespace colors
|
||||
const size_t unk, const size_t unk2)
|
||||
{
|
||||
// CL_GetClientName (CL_GetClientNameAndClantag?)
|
||||
const auto result = reinterpret_cast<size_t(*)(int, int, char*, int, size_t, size_t)>(0x14025BAA0)( // H1 (1.4)
|
||||
local_client_num, index, buf, size, unk, unk2);
|
||||
const auto result = utils::hook::invoke<size_t>(0x14025BAA0, local_client_num, index, buf, size, unk, unk2);
|
||||
|
||||
utils::string::strip(buf, buf, size);
|
||||
|
||||
|
@ -91,7 +91,7 @@ namespace command
|
||||
void parse_commandline_stub()
|
||||
{
|
||||
parse_command_line();
|
||||
reinterpret_cast<void(*)()>(0x1400D8210)(); // mwr: test
|
||||
utils::hook::invoke<void>(0x1400D8210);
|
||||
}
|
||||
|
||||
game::dvar_t* dvar_command_stub()
|
||||
|
@ -26,7 +26,7 @@ namespace dedicated
|
||||
initialized = true;
|
||||
|
||||
// R_LoadGraphicsAssets
|
||||
reinterpret_cast<void(*)()>(0x1405DF4B0)();
|
||||
utils::hook::invoke<void>(0x1405DF4B0);
|
||||
}
|
||||
|
||||
void send_heartbeat()
|
||||
|
@ -119,7 +119,7 @@ namespace party
|
||||
}
|
||||
|
||||
// This function either does Dvar_SetString or Dvar_RegisterString for the given dvar
|
||||
reinterpret_cast<void(*)(const char*, const char*)>(0x1404FB210)(dvar_name, string);
|
||||
utils::hook::invoke<void>(0x1404FB210, dvar_name, string);
|
||||
}
|
||||
|
||||
void disconnect_stub()
|
||||
@ -129,12 +129,12 @@ namespace party
|
||||
if (game::CL_IsCgameInitialized())
|
||||
{
|
||||
// CL_ForwardCommandToServer
|
||||
reinterpret_cast<void (*)(int, const char*)>(0x140253480)(0, "disconnect");
|
||||
utils::hook::invoke<void>(0x140253480, 0, "disconnect");
|
||||
// CL_WritePacket
|
||||
reinterpret_cast<void (*)(int)>(0x14024DB10)(0);
|
||||
utils::hook::invoke<void>(0x14024DB10, 0);
|
||||
}
|
||||
// CL_Disconnect
|
||||
reinterpret_cast<void (*)(int)>(0x140252060)(0);
|
||||
utils::hook::invoke<void>(0x140252060, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,7 +337,8 @@ namespace party
|
||||
*reinterpret_cast<int*>(0x14A3A91D0) = 1; // sv_map_restart
|
||||
*reinterpret_cast<int*>(0x14A3A91D4) = 1; // sv_loadScripts
|
||||
*reinterpret_cast<int*>(0x14A3A91D8) = 0; // sv_migrate
|
||||
reinterpret_cast<void(*)()>(0x14047E7F0)(); // SV_CheckLoadGame
|
||||
|
||||
utils::hook::invoke<void>(0x14047E7F0); // SV_CheckLoadGame
|
||||
});
|
||||
|
||||
command::add("fast_restart", []()
|
||||
|
Loading…
Reference in New Issue
Block a user