use hooking utils invoke

This commit is contained in:
m 2022-03-03 07:07:37 -06:00
parent 597549df52
commit 8f9c663321
4 changed files with 9 additions and 9 deletions

View File

@ -96,8 +96,7 @@ namespace colors
const size_t unk, const size_t unk2) const size_t unk, const size_t unk2)
{ {
// CL_GetClientName (CL_GetClientNameAndClantag?) // CL_GetClientName (CL_GetClientNameAndClantag?)
const auto result = reinterpret_cast<size_t(*)(int, int, char*, int, size_t, size_t)>(0x14025BAA0)( // H1 (1.4) const auto result = utils::hook::invoke<size_t>(0x14025BAA0, local_client_num, index, buf, size, unk, unk2);
local_client_num, index, buf, size, unk, unk2);
utils::string::strip(buf, buf, size); utils::string::strip(buf, buf, size);

View File

@ -91,7 +91,7 @@ namespace command
void parse_commandline_stub() void parse_commandline_stub()
{ {
parse_command_line(); parse_command_line();
reinterpret_cast<void(*)()>(0x1400D8210)(); // mwr: test utils::hook::invoke<void>(0x1400D8210);
} }
game::dvar_t* dvar_command_stub() game::dvar_t* dvar_command_stub()

View File

@ -26,7 +26,7 @@ namespace dedicated
initialized = true; initialized = true;
// R_LoadGraphicsAssets // R_LoadGraphicsAssets
reinterpret_cast<void(*)()>(0x1405DF4B0)(); utils::hook::invoke<void>(0x1405DF4B0);
} }
void send_heartbeat() void send_heartbeat()

View File

@ -119,7 +119,7 @@ namespace party
} }
// This function either does Dvar_SetString or Dvar_RegisterString for the given dvar // 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() void disconnect_stub()
@ -129,12 +129,12 @@ namespace party
if (game::CL_IsCgameInitialized()) if (game::CL_IsCgameInitialized())
{ {
// CL_ForwardCommandToServer // CL_ForwardCommandToServer
reinterpret_cast<void (*)(int, const char*)>(0x140253480)(0, "disconnect"); utils::hook::invoke<void>(0x140253480, 0, "disconnect");
// CL_WritePacket // CL_WritePacket
reinterpret_cast<void (*)(int)>(0x14024DB10)(0); utils::hook::invoke<void>(0x14024DB10, 0);
} }
// CL_Disconnect // 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*>(0x14A3A91D0) = 1; // sv_map_restart
*reinterpret_cast<int*>(0x14A3A91D4) = 1; // sv_loadScripts *reinterpret_cast<int*>(0x14A3A91D4) = 1; // sv_loadScripts
*reinterpret_cast<int*>(0x14A3A91D8) = 0; // sv_migrate *reinterpret_cast<int*>(0x14A3A91D8) = 0; // sv_migrate
reinterpret_cast<void(*)()>(0x14047E7F0)(); // SV_CheckLoadGame
utils::hook::invoke<void>(0x14047E7F0); // SV_CheckLoadGame
}); });
command::add("fast_restart", []() command::add("fast_restart", []()