small cleanup

This commit is contained in:
Skull Merlin 2022-03-09 19:33:00 +02:00
parent 3259abaf6c
commit 33852cfb84
9 changed files with 70 additions and 75 deletions

View File

@ -537,34 +537,29 @@ namespace demonware
void post_unpack() override void post_unpack() override
{ {
/* utils::hook::jump(SELECT_VALUE(0x140610320, 0x1407400B0), bd_logger_stub);
mwr has upgraded some networking methods and the gethostbyname import from winsock library is no longer used
gethostbyname has been replaced with getaddrinfo
btw, still you can't get online..
*/
utils::hook::jump(SELECT_VALUE(0x140610320, 0x1407400B0), bd_logger_stub); // H1MP64(1.4)
if (game::environment::is_sp()) if (game::environment::is_sp())
{ {
utils::hook::set<uint8_t>(0x1405FCA00, 0xC3); // bdAuthSteam H1(1.4) utils::hook::set<uint8_t>(0x1405FCA00, 0xC3); // bdAuthSteam
utils::hook::set<uint8_t>(0x140333A00, 0xC3); // dwNet H1(1.4) utils::hook::set<uint8_t>(0x140333A00, 0xC3); // dwNet
return; return;
} }
utils::hook::set<uint8_t>(0x140715039, 0x0); // CURLOPT_SSL_VERIFYPEER H1MP64(1.4) utils::hook::set<uint8_t>(0x140715039, 0x0); // CURLOPT_SSL_VERIFYPEER
utils::hook::set<uint8_t>(0x140715025, 0xAF); // CURLOPT_SSL_VERIFYHOST H1MP64(1.4) utils::hook::set<uint8_t>(0x140715025, 0xAF); // CURLOPT_SSL_VERIFYHOST
utils::hook::set<uint8_t>(0x14095433C, 0x0); // HTTPS -> HTTP [MWR OK][S1X: 0x14088D0E8] utils::hook::set<uint8_t>(0x14095433C, 0x0); // HTTPS -> HTTP
//HTTPS -> HTTP //HTTPS -> HTTP
utils::hook::inject(0x14006DDA9, "http://prod.umbrella.demonware.net/v1.0/"); // ---> [H1MP1.4 - S1X: 0x14003852E] utils::hook::inject(0x14006DDA9, "http://prod.umbrella.demonware.net/v1.0/");
utils::hook::inject(0x14006E11C, "http://prod.umbrella.demonware.net/v1.0/"); // ---> [H1MP1.4 - S1X: 0x14003884F] utils::hook::inject(0x14006E11C, "http://prod.umbrella.demonware.net/v1.0/");
utils::hook::inject(0x14006E2FB, "http://prod.umbrella.demonware.net/v1.0/"); // ---> [H1MP1.4 - S1X: 0x140038A07] utils::hook::inject(0x14006E2FB, "http://prod.umbrella.demonware.net/v1.0/");
utils::hook::inject(0x14006E9A9, "http://prod.uno.demonware.net/v1.0/"); utils::hook::inject(0x14006E9A9, "http://prod.uno.demonware.net/v1.0/");
utils::hook::inject(0x14006ED49, "http://prod.uno.demonware.net/v1.0/"); utils::hook::inject(0x14006ED49, "http://prod.uno.demonware.net/v1.0/");
utils::hook::inject(0x140728170, "http://%s:%d/auth/"); utils::hook::inject(0x140728170, "http://%s:%d/auth/");
utils::hook::set<uint8_t>(0x14047F290, 0xC3); // SV_SendMatchData H1MP64(1.4) utils::hook::set<uint8_t>(0x14047F290, 0xC3); // SV_SendMatchData
utils::hook::set<uint8_t>(0x140598990, 0xC3); // Live_CheckForFullDisconnect H1MP64(1.4) utils::hook::set<uint8_t>(0x140598990, 0xC3); // Live_CheckForFullDisconnect
#ifdef DEBUG #ifdef DEBUG
// yes // yes

View File

@ -88,7 +88,7 @@ namespace fps
perf_calc_fps(&cg_perf, cg_perf.frame_ms); perf_calc_fps(&cg_perf, cg_perf.frame_ms);
utils::hook::invoke<void>(SELECT_VALUE(0x1405487A0, 0x1406575A0)); // H1(1.4) utils::hook::invoke<void>(SELECT_VALUE(0x1405487A0, 0x1406575A0));
} }
void cg_draw_fps() void cg_draw_fps()

View File

@ -45,8 +45,8 @@ namespace input
return; return;
} }
cl_char_event_hook.create(SELECT_VALUE(0x1401871A0, 0x14024E810), cl_char_event_stub); // H1(1.4) cl_char_event_hook.create(SELECT_VALUE(0x1401871A0, 0x14024E810), cl_char_event_stub);
cl_key_event_hook.create(SELECT_VALUE(0x1401874D0, 0x14024EA60), cl_key_event_stub); // H1(1.4) cl_key_event_hook.create(SELECT_VALUE(0x1401874D0, 0x14024EA60), cl_key_event_stub);
} }
}; };
} }

View File

@ -16,7 +16,7 @@ namespace lui
void post_unpack() override void post_unpack() override
{ {
// Don't show create cod account popup // Don't show create cod account popup
//utils::hook::set<uint32_t>(0x14017C957, 0); // H1(1.4) //utils::hook::set<uint32_t>(0x14017C957, 0);
//#ifdef _DEBUG //#ifdef _DEBUG
// Enable development menus (causes issues in sp) // Enable development menus (causes issues in sp)

View File

@ -67,11 +67,11 @@ namespace network
// Command handled // Command handled
a.popad64(); a.popad64();
a.mov(al, 1); a.mov(al, 1);
a.jmp(0x140252AF8); // H1MP64(1.4) a.jmp(0x140252AF8);
a.bind(return_unhandled); a.bind(return_unhandled);
a.popad64(); a.popad64();
a.jmp(0x14025234C); // H1MP64(1.4) a.jmp(0x14025234C);
} }
int net_compare_base_address(const game::netadr_s* a1, const game::netadr_s* a2) int net_compare_base_address(const game::netadr_s* a1, const game::netadr_s* a2)
@ -237,46 +237,46 @@ namespace network
// redirect dw_sendto to raw socket // redirect dw_sendto to raw socket
//utils::hook::jump(0x1404D850A, reinterpret_cast<void*>(0x1404D849A)); //utils::hook::jump(0x1404D850A, reinterpret_cast<void*>(0x1404D849A));
utils::hook::call(0x140513467, dw_send_to_stub); // H1MP64(1.4) utils::hook::call(0x140513467, dw_send_to_stub);
utils::hook::jump(game::Sys_SendPacket, dw_send_to_stub); // H1MP64(1.4) utils::hook::jump(game::Sys_SendPacket, dw_send_to_stub);
// intercept command handling // intercept command handling
utils::hook::jump(0x140252327, utils::hook::assemble(handle_command_stub), true); // H1MP64(1.4) utils::hook::jump(0x140252327, utils::hook::assemble(handle_command_stub), true);
// handle xuid without secure connection // handle xuid without secure connection
utils::hook::nop(0x140486AAF, 6); // H1MP64(1.4) utils::hook::nop(0x140486AAF, 6);
utils::hook::jump(0x140424F20, net_compare_address); // H1MP64(1.4) utils::hook::jump(0x140424F20, net_compare_address);
utils::hook::jump(0x140424F70, net_compare_base_address); // H1MP64(1.4) utils::hook::jump(0x140424F70, net_compare_base_address);
// don't establish secure conenction // don't establish secure conenction
utils::hook::set<uint8_t>(0x14027EA4D, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14027EA4D, 0xEB);
utils::hook::set<uint8_t>(0x14027EB1E, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14027EB1E, 0xEB);
utils::hook::set<uint8_t>(0x14027EF8D, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14027EF8D, 0xEB);
utils::hook::set<uint8_t>(0x14025081F, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14025081F, 0xEB);
// ignore unregistered connection // ignore unregistered connection
utils::hook::jump(0x140480F46, 0x140480EE5); // H1MP64(1.4) utils::hook::jump(0x140480F46, 0x140480EE5);
utils::hook::set<uint8_t>(0x140480F3B, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x140480F3B, 0xEB);
// disable xuid verification // disable xuid verification
utils::hook::set<uint8_t>(0x14005B62D, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14005B62D, 0xEB);
utils::hook::set<uint8_t>(0x14005B649, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14005B649, 0xEB);
// disable xuid verification // disable xuid verification
utils::hook::nop(0x14048382C, 2); utils::hook::nop(0x14048382C, 2);
utils::hook::set<uint8_t>(0x140483889, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x140483889, 0xEB);
// ignore configstring mismatch // ignore configstring mismatch
utils::hook::set<uint8_t>(0x1402591C9, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x1402591C9, 0xEB);
// ignore dw handle in SV_PacketEvent // ignore dw handle in SV_PacketEvent
utils::hook::set<uint8_t>(0x1404898E2, 0xEB); utils::hook::set<uint8_t>(0x1404898E2, 0xEB);
utils::hook::call(0x1404898D6, &net_compare_address); // H1MP64(1.4) utils::hook::call(0x1404898D6, &net_compare_address);
// ignore dw handle in SV_FindClientByAddress // ignore dw handle in SV_FindClientByAddress
utils::hook::set<uint8_t>(0x140488EFD, 0xEB); utils::hook::set<uint8_t>(0x140488EFD, 0xEB);
utils::hook::call(0x140488EF1, &net_compare_address); // H1MP64(1.4) utils::hook::call(0x140488EF1, &net_compare_address);
// ignore dw handle in SV_DirectConnect // ignore dw handle in SV_DirectConnect
utils::hook::set<uint8_t>(0x140480C58, 0xEB); utils::hook::set<uint8_t>(0x140480C58, 0xEB);
@ -291,32 +291,32 @@ namespace network
dvars::override::register_int("sv_remote_client_snapshot_msec", 33, 33, 100, game::DVAR_FLAG_NONE); dvars::override::register_int("sv_remote_client_snapshot_msec", 33, 33, 100, game::DVAR_FLAG_NONE);
// ignore impure client // ignore impure client
utils::hook::jump(0x140481B58, reinterpret_cast<void*>(0x140481BEE)); // H1MP64(1.4) utils::hook::jump(0x140481B58, reinterpret_cast<void*>(0x140481BEE));
// don't send checksum // don't send checksum
utils::hook::set<uint8_t>(0x140513433, 0); // H1MP64(1.4) mov: r8d, edi ; LEN utils::hook::set<uint8_t>(0x140513433, 0);
utils::hook::set<uint8_t>(0x14051345A, 0); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14051345A, 0);
// don't read checksum // don't read checksum
utils::hook::set(0x1404F6620, 0xC301B0); // H1MP64(1.4) utils::hook::set(0x1404F6620, 0xC301B0);
// don't try to reconnect client // don't try to reconnect client
utils::hook::call(0x140480DFF, reconnect_migratated_client); // H1MP64(1.4) utils::hook::call(0x140480DFF, reconnect_migratated_client);
utils::hook::nop(0x140480DDB, 4); // H1MP64(1.4) this crashes when reconnecting for some reason utils::hook::nop(0x140480DDB, 4); // this crashes when reconnecting for some reason
// allow server owner to modify net_port before the socket bind // allow server owner to modify net_port before the socket bind
utils::hook::call(0x140512BE5, register_netport_stub); // H1MP64(1.4) utils::hook::call(0x140512BE5, register_netport_stub);
utils::hook::call(0x140512D20, register_netport_stub); // H1MP64(1.4) utils::hook::call(0x140512D20, register_netport_stub);
// increase allowed packet size // increase allowed packet size
const auto max_packet_size = 0x20000; const auto max_packet_size = 0x20000;
utils::hook::set<int>(0x1404255F1, max_packet_size); // H1MP64(1.4) utils::hook::set<int>(0x1404255F1, max_packet_size);
utils::hook::set<int>(0x140425630, max_packet_size); // H1MP64(1.4) utils::hook::set<int>(0x140425630, max_packet_size);
utils::hook::set<int>(0x140425522, max_packet_size); // H1MP64(1.4) utils::hook::set<int>(0x140425522, max_packet_size);
utils::hook::set<int>(0x140425545, max_packet_size); // H1MP64(1.4) utils::hook::set<int>(0x140425545, max_packet_size);
// ignore built in "print" oob command and add in our own // ignore built in "print" oob command and add in our own
utils::hook::set<uint8_t>(0x14025280E, 0xEB); // H1MP64(1.4) utils::hook::set<uint8_t>(0x14025280E, 0xEB);
on("print", [](const game::netadr_s&, const std::string_view& data) on("print", [](const game::netadr_s&, const std::string_view& data)
{ {
const std::string message{data}; const std::string message{data};

View File

@ -161,10 +161,10 @@ namespace patches
void post_unpack() override void post_unpack() override
{ {
// Register dvars // Register dvars
com_register_dvars_hook.create(SELECT_VALUE(0x140351B80, 0x1400D9320), &com_register_dvars_stub); // H1(1.4) com_register_dvars_hook.create(SELECT_VALUE(0x140351B80, 0x1400D9320), &com_register_dvars_stub);
// Unlock fps in main menu // Unlock fps in main menu
utils::hook::set<BYTE>(SELECT_VALUE(0x14018D47B, 0x14025B86B), 0xEB); // H1(1.4) utils::hook::set<BYTE>(SELECT_VALUE(0x14018D47B, 0x14025B86B), 0xEB);
if (!game::environment::is_dedi()) if (!game::environment::is_dedi())
{ {
@ -197,16 +197,16 @@ namespace patches
static void patch_mp() static void patch_mp()
{ {
// Use name dvar // Use name dvar
utils::hook::jump(0x14050FF90, &live_get_local_client_name); // H1(1.4) utils::hook::jump(0x14050FF90, &live_get_local_client_name);
// Patch SV_KickClientNum // Patch SV_KickClientNum
sv_kick_client_num_hook.create(0x14047ED00, &sv_kick_client_num); // H1(1.4) sv_kick_client_num_hook.create(0x14047ED00, &sv_kick_client_num);
// block changing name in-game // block changing name in-game
utils::hook::set<uint8_t>(0x14047FC90, 0xC3); // H1(1.4) utils::hook::set<uint8_t>(0x14047FC90, 0xC3);
// patch "Couldn't find the bsp for this map." error to not be fatal in mp // patch "Couldn't find the bsp for this map." error to not be fatal in mp
utils::hook::call(0x1402BA26B, bsp_sys_error_stub); // H1(1.4) utils::hook::call(0x1402BA26B, bsp_sys_error_stub);
// client side aim assist dvar // client side aim assist dvar
dvars::aimassist_enabled = dvars::register_bool("aimassist_enabled", true, dvars::aimassist_enabled = dvars::register_bool("aimassist_enabled", true,
@ -215,12 +215,12 @@ namespace patches
utils::hook::call(0x14009EE9E, aim_assist_add_to_target_list); utils::hook::call(0x14009EE9E, aim_assist_add_to_target_list);
// unlock all items // unlock all items
utils::hook::jump(0x140413E60, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable_LocalClient H1(1.4) utils::hook::jump(0x140413E60, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable_LocalClient
utils::hook::jump(0x140413860, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable H1(1.4) utils::hook::jump(0x140413860, is_item_unlocked); // LiveStorage_IsItemUnlockedFromTable
utils::hook::jump(0x140412B70, is_item_unlocked); // idk ( unlocks loot etc ) H1(1.4) utils::hook::jump(0x140412B70, is_item_unlocked); // idk ( unlocks loot etc )
// isProfanity // isProfanity
utils::hook::set(0x1402877D0, 0xC3C033); // MAY BE WRONG H1(1.4) utils::hook::set(0x1402877D0, 0xC3C033);
// disable emblems // disable emblems
dvars::override::register_int("emblems_active", 0, 0, 0, game::DVAR_FLAG_NONE); dvars::override::register_int("emblems_active", 0, 0, 0, game::DVAR_FLAG_NONE);
@ -228,16 +228,16 @@ namespace patches
// disable elite_clan // disable elite_clan
dvars::override::register_int("elite_clan_active", 0, 0, 0, game::DVAR_FLAG_NONE); dvars::override::register_int("elite_clan_active", 0, 0, 0, game::DVAR_FLAG_NONE);
utils::hook::set<uint8_t>(0x140585680, 0xC3); // don't register commands H1(1.4) utils::hook::set<uint8_t>(0x140585680, 0xC3); // don't register commands
// disable codPointStore // disable codPointStore
dvars::override::register_int("codPointStore_enabled", 0, 0, 0, game::DVAR_FLAG_NONE); dvars::override::register_int("codPointStore_enabled", 0, 0, 0, game::DVAR_FLAG_NONE);
// don't register every replicated dvar as a network dvar // don't register every replicated dvar as a network dvar
utils::hook::nop(0x14039E58E, 5); // dvar_foreach H1(1.4) utils::hook::nop(0x14039E58E, 5); // dvar_foreach
// patch "Server is different version" to show the server client version // patch "Server is different version" to show the server client version
utils::hook::inject(0x140480952, VERSION); // H1(1.4) utils::hook::inject(0x140480952, VERSION);
// prevent servers overriding our fov // prevent servers overriding our fov
utils::hook::call(0x14023279E, set_client_dvar_from_server_stub); utils::hook::call(0x14023279E, set_client_dvar_from_server_stub);
@ -246,8 +246,8 @@ namespace patches
utils::hook::set<uint8_t>(0x14021D22A, 0xEB); utils::hook::set<uint8_t>(0x14021D22A, 0xEB);
// unlock safeArea_* // unlock safeArea_*
utils::hook::jump(0x1402624F5, 0x140262503); // H1(1.4) utils::hook::jump(0x1402624F5, 0x140262503);
utils::hook::jump(0x14026251C, 0x140262547); // H1(1.4) utils::hook::jump(0x14026251C, 0x140262547);
dvars::override::register_int("safeArea_adjusted_horizontal", 1, 0, 1, game::DVAR_FLAG_SAVED); dvars::override::register_int("safeArea_adjusted_horizontal", 1, 0, 1, game::DVAR_FLAG_SAVED);
dvars::override::register_int("safeArea_adjusted_vertical", 1, 0, 1, game::DVAR_FLAG_SAVED); dvars::override::register_int("safeArea_adjusted_vertical", 1, 0, 1, game::DVAR_FLAG_SAVED);
dvars::override::register_int("safeArea_horizontal", 1, 0, 1, game::DVAR_FLAG_SAVED); dvars::override::register_int("safeArea_horizontal", 1, 0, 1, game::DVAR_FLAG_SAVED);
@ -269,10 +269,10 @@ namespace patches
dvars::override::register_int("com_maxfps", 0, 0, 1000, game::DVAR_FLAG_SAVED); dvars::override::register_int("com_maxfps", 0, 0, 1000, game::DVAR_FLAG_SAVED);
// Prevent clients from ending the game as non host by sending 'end_game' lui notification // Prevent clients from ending the game as non host by sending 'end_game' lui notification
// cmd_lui_notify_server_hook.create(0x140335A70, cmd_lui_notify_server_stub); // H1(1.4) // cmd_lui_notify_server_hook.create(0x140335A70, cmd_lui_notify_server_stub);
// Prevent clients from sending invalid reliableAcknowledge // Prevent clients from sending invalid reliableAcknowledge
// utils::hook::call(0x1404899C6, sv_execute_client_message_stub); // H1(1.4) // utils::hook::call(0x1404899C6, sv_execute_client_message_stub);
// "fix" for rare 'Out of memory error' error // "fix" for rare 'Out of memory error' error
if (utils::flags::has_flag("memoryfix")) if (utils::flags::has_flag("memoryfix"))

View File

@ -45,7 +45,7 @@ namespace slowmotion
return; return;
} }
utils::hook::jump(0x140365480, scr_cmd_set_slow_motion); // H1(1.4) utils::hook::jump(0x140365480, scr_cmd_set_slow_motion);
} }
}; };
} }

View File

@ -30,9 +30,9 @@ namespace splash
void post_unpack() override void post_unpack() override
{ {
// Disable native splash screen // Disable native splash screen
utils::hook::nop(SELECT_VALUE(0x1403E192E, 0x1405123E2), 5); // H1(1.4) utils::hook::nop(SELECT_VALUE(0x1403E192E, 0x1405123E2), 5);
utils::hook::jump(SELECT_VALUE(0x1403E2E70, 0x140513AF0), destroy_stub); // H1(1.4) utils::hook::jump(SELECT_VALUE(0x1403E2E70, 0x140513AF0), destroy_stub);
utils::hook::jump(SELECT_VALUE(0x1403E2EB0, 0x140513B30), destroy_stub); // H1(1.4) utils::hook::jump(SELECT_VALUE(0x1403E2EB0, 0x140513B30), destroy_stub);
} }
void pre_destroy() override void pre_destroy() override

View File

@ -35,7 +35,7 @@ namespace videos
public: public:
void post_unpack() override void post_unpack() override
{ {
playvid_hook.create(SELECT_VALUE(0x1404A9D00, 0x1405B0AF0), &playvid); // H1(1.4) playvid_hook.create(SELECT_VALUE(0x1404A9D00, 0x1405B0AF0), &playvid);
if (game::environment::is_mp()) if (game::environment::is_mp())
{ {