This commit is contained in:
Skull Merlin 2022-05-19 01:32:00 +03:00
parent 42bdb0c1f5
commit 309fdfb999
6 changed files with 90 additions and 90 deletions

View File

@ -26,7 +26,7 @@ namespace dedicated
initialized = true; initialized = true;
// R_LoadGraphicsAssets // R_LoadGraphicsAssets
utils::hook::invoke<void>(0x1405DF4B0); utils::hook::invoke<void>(0x686310_b);
} }
void send_heartbeat() void send_heartbeat()
@ -197,96 +197,96 @@ namespace dedicated
dvars::override::register_bool("r_preloadShaders", false, game::DVAR_FLAG_READ); dvars::override::register_bool("r_preloadShaders", false, game::DVAR_FLAG_READ);
// Stop crashing from sys_errors // Stop crashing from sys_errors
utils::hook::jump(0x140511520, sys_error_stub); utils::hook::jump(0x1D8710_b, sys_error_stub);
// Hook R_SyncGpu // Hook R_SyncGpu
utils::hook::jump(0x1405E12F0, sync_gpu_stub); utils::hook::jump(0x688620_b, sync_gpu_stub);
utils::hook::jump(0x140254800, init_dedicated_server); utils::hook::jump(0x135600_b, init_dedicated_server);
// delay startup commands until the initialization is done // delay startup commands until the initialization is done
utils::hook::call(0x1400D72D6, execute_startup_command); utils::hook::call(0x157DDA_b, execute_startup_command);
// delay console commands until the initialization is done // delay console commands until the initialization is done // COULDN'T FOUND
utils::hook::call(0x1400D808C, execute_console_command); //utils::hook::call(0x1400D808C, execute_console_command);
utils::hook::nop(0x1400D80A4, 5); //utils::hook::nop(0x1400D80A4, 5);
// patch GScr_SetDynamicDvar to behave better // patch GScr_SetDynamicDvar to behave better
gscr_set_dynamic_dvar_hook.create(0x14036B600, &gscr_set_dynamic_dvar); gscr_set_dynamic_dvar_hook.create(0x43CF60_b, &gscr_set_dynamic_dvar);
utils::hook::nop(0x1404ED90E, 5); // don't load config file //utils::hook::nop(0x1404ED90E, 5); // don't load config file // NOT FOUND
utils::hook::nop(0x140403D92, 5); // ^ utils::hook::nop(0x156C46_b, 5); // ^ // NOT SURE
utils::hook::set<uint8_t>(0x1400DC1D0, 0xC3); // don't save config file utils::hook::set<uint8_t>(0x17F470_b, 0xC3); // don't save config file
utils::hook::set<uint8_t>(0x140274710, 0xC3); // disable self-registration utils::hook::set<uint8_t>(0x351AA0_b, 0xC3); // disable self-registration
utils::hook::set<uint8_t>(0x140515890, 0xC3); // init sound system (1) utils::hook::set<uint8_t>(0x5BF4E0_b, 0xC3); // init sound system (1)
utils::hook::set<uint8_t>(0x1406574F0, 0xC3); // init sound system (2) utils::hook::set<uint8_t>(0x702650_b, 0xC3); // init sound system (2) NOT SURE
utils::hook::set<uint8_t>(0x140620D10, 0xC3); // render thread //utils::hook::set<uint8_t>(0x140620D10, 0xC3); // render thread ARXAN'D
utils::hook::set<uint8_t>(0x14025B850, 0xC3); // called from Com_Frame, seems to do renderer stuff utils::hook::set<uint8_t>(0x343950_b, 0xC3); // called from Com_Frame, seems to do renderer stuff
utils::hook::set<uint8_t>(0x1402507B0, 0xC3); // CL_CheckForResend, which tries to connect to the local server constantly utils::hook::set<uint8_t>(0x12CCA0_b, 0xC3); // CL_CheckForResend, which tries to connect to the local server constantly
utils::hook::set<uint8_t>(0x1405D5178, 0x00); // r_loadForRenderer default to 0 utils::hook::set<uint8_t>(0x67ADCE_b, 0x00); // r_loadForRenderer default to 0 NOT SURE
utils::hook::set<uint8_t>(0x14050C2D0, 0xC3); // recommended settings check - TODO: Check hook utils::hook::set<uint8_t>(0x5B7AF0_b, 0xC3); // recommended settings check - TODO: Check hook
utils::hook::set<uint8_t>(0x140514C00, 0xC3); // some mixer-related function called on shutdown utils::hook::set<uint8_t>(0x5BE850_b, 0xC3); // some mixer-related function called on shutdown
utils::hook::set<uint8_t>(0x140409830, 0xC3); // dont load ui gametype stuff utils::hook::set<uint8_t>(0x4DEA50_b, 0xC3); // dont load ui gametype stuff
utils::hook::nop(0x140481B06, 6); // unknown check in SV_ExecuteClientMessage utils::hook::nop(0x54ED81_b, 6); // unknown check in SV_ExecuteClientMessage
utils::hook::nop(0x140480FAC, 4); // allow first slot to be occupied utils::hook::nop(0x54E337_b, 4); // allow first slot to be occupied
utils::hook::nop(0x14025619B, 2); // properly shut down dedicated servers utils::hook::nop(0x13ABCB_b, 2); // properly shut down dedicated servers
utils::hook::nop(0x14025615E, 2); // ^ utils::hook::nop(0x13AB8E_b, 2); // ^
utils::hook::nop(0x1402561C0, 5); // don't shutdown renderer utils::hook::nop(0x13ABF0_b, 5); // don't shutdown renderer
utils::hook::set<uint8_t>(0x140091840, 0xC3); // something to do with blendShapeVertsView utils::hook::set<uint8_t>(0xAA290_b, 0xC3); // something to do with blendShapeVertsView
utils::hook::nop(0x140659A0D, 8); // sound thing utils::hook::nop(0x70465D_b, 8); // sound thing
// (COULD NOT FIND IN H1) // (COULD NOT FIND IN H1)
// utils::hook::set<uint8_t>(0x1404D6960, 0xC3); // cpu detection stuff? // utils::hook::set<uint8_t>(0x1404D6960, 0xC3); // cpu detection stuff?
utils::hook::set<uint8_t>(0x1405E97F0, 0xC3); // gfx stuff during fastfile loading utils::hook::set<uint8_t>(0x690F30_b, 0xC3); // gfx stuff during fastfile loading
utils::hook::set<uint8_t>(0x1405E9700, 0xC3); // ^ utils::hook::set<uint8_t>(0x690E00_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405E9790, 0xC3); // ^ utils::hook::set<uint8_t>(0x690ED0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1402C1180, 0xC3); // ^ //utils::hook::set<uint8_t>(0x1402C1180, 0xC3); // ^ NOT FOUND?
utils::hook::set<uint8_t>(0x1405E9750, 0xC3); // ^ utils::hook::set<uint8_t>(0x690E50_b, 0xC3); // ^ MAAAAAAAAAAAYBE NOTTTT
utils::hook::set<uint8_t>(0x1405AD5B0, 0xC3); // directx stuff utils::hook::set<uint8_t>(0x651BA0_b, 0xC3); // directx stuff
utils::hook::set<uint8_t>(0x1405DB150, 0xC3); // ^ utils::hook::set<uint8_t>(0x681950_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x140625220, 0xC3); // ^ - mutex utils::hook::set<uint8_t>(0x6CE390_b, 0xC3); // ^ - mutex
utils::hook::set<uint8_t>(0x1405DB650, 0xC3); // ^ utils::hook::set<uint8_t>(0x681ED0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x14008B5F0, 0xC3); // rendering stuff utils::hook::set<uint8_t>(0xA3CD0_b, 0xC3); // rendering stuff
utils::hook::set<uint8_t>(0x1405DB8B0, 0xC3); // ^ utils::hook::set<uint8_t>(0x682150_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405DB9C0, 0xC3); // ^ utils::hook::set<uint8_t>(0x682260_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405DC050, 0xC3); // ^ utils::hook::set<uint8_t>(0x6829C0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405DCBA0, 0xC3); // ^ utils::hook::set<uint8_t>(0x6834A0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405DD240, 0xC3); // ^ utils::hook::set<uint8_t>(0x683B40_b, 0xC3); // ^
// shaders // shaders
utils::hook::set<uint8_t>(0x1400916A0, 0xC3); // ^ utils::hook::set<uint8_t>(0xAA090_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x140091610, 0xC3); // ^ utils::hook::set<uint8_t>(0xA9FE0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x14061ACC0, 0xC3); // ^ - mutex utils::hook::set<uint8_t>(0x6C38D0_b, 0xC3); // ^ - mutex
utils::hook::set<uint8_t>(0x140516080, 0xC3); // idk utils::hook::set<uint8_t>(0x5BFD10_b, 0xC3); // idk
utils::hook::set<uint8_t>(0x1405AE5F0, 0xC3); // ^ utils::hook::set<uint8_t>(0x652E10_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405E0B30, 0xC3); // R_Shutdown utils::hook::set<uint8_t>(0x687D20_b, 0xC3); // R_Shutdown
utils::hook::set<uint8_t>(0x1405AE400, 0xC3); // shutdown stuff utils::hook::set<uint8_t>(0x652BA0_b, 0xC3); // shutdown stuff
utils::hook::set<uint8_t>(0x1405E0C00, 0xC3); // ^ utils::hook::set<uint8_t>(0x687DF0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x1405DFE50, 0xC3); // ^ //utils::hook::set<uint8_t>(0x1405DFE50, 0xC3); // ^ COULDN'T FOUND
// utils::hook::set<uint8_t>(0x1404B67E0, 0xC3); // sound crashes (H1 - questionable, function looks way different) // utils::hook::set<uint8_t>(0x1404B67E0, 0xC3); // sound crashes (H1 - questionable, function looks way different)
utils::hook::set<uint8_t>(0x14048B660, 0xC3); // disable host migration utils::hook::set<uint8_t>(0x556250_b, 0xC3); // disable host migration
utils::hook::set<uint8_t>(0x14042B2E0, 0xC3); // render synchronization lock utils::hook::set<uint8_t>(0x4F7C10_b, 0xC3); // render synchronization lock
utils::hook::set<uint8_t>(0x14042B210, 0xC3); // render synchronization unlock utils::hook::set<uint8_t>(0x42B210_b, 0xC3); // render synchronization unlock
utils::hook::set<uint8_t>(0x140176D2D, 0xEB); // LUI: Unable to start the LUI system due to errors in main.lua utils::hook::set<uint8_t>(0x27AA9D_b, 0xEB); // LUI: Unable to start the LUI system due to errors in main.lua
utils::hook::nop(0x140506ECE, 5); // Disable sound pak file loading utils::hook::nop(0x5B25BE_b, 5); // Disable sound pak file loading
utils::hook::nop(0x140506ED6, 2); // ^ utils::hook::nop(0x5B25C6_b, 2); // ^
utils::hook::set<uint8_t>(0x1402C5910, 0xC3); // Disable image pak file loading utils::hook::set<uint8_t>(0x3A0BA0_b, 0xC3); // Disable image pak file loading
// Reduce min required memory // Reduce min required memory
utils::hook::set<uint64_t>(0x14050C717, 0x80000000); utils::hook::set<uint64_t>(0x5B7F37_b, 0x80000000);
utils::hook::set(0x1402BF7F0, 0xC3); // some loop utils::hook::set(0x399E10_b, 0xC3); // some loop
utils::hook::set(0x14007E150, 0xC3); // related to shader caching / techsets / fastfiles utils::hook::set(0x1D48B0_b, 0xC3); // related to shader caching / techsets / fastfiles
// initialize the game after onlinedataflags is 32 (workaround) // initialize the game after onlinedataflags is 32 (workaround)
scheduler::schedule([=]() scheduler::schedule([=]()
@ -318,14 +318,14 @@ namespace dedicated
execute_startup_command_queue(); execute_startup_command_queue();
execute_console_command_queue(); execute_console_command_queue();
// Send heartbeat to dpmaster // Send heartbeat to master
scheduler::once(send_heartbeat, scheduler::pipeline::server); scheduler::once(send_heartbeat, scheduler::pipeline::server);
scheduler::loop(send_heartbeat, scheduler::pipeline::server, 10min); scheduler::loop(send_heartbeat, scheduler::pipeline::server, 10min);
command::add("heartbeat", send_heartbeat); command::add("heartbeat", send_heartbeat);
}, scheduler::pipeline::main, 1s); }, scheduler::pipeline::main, 1s);
command::add("killserver", kill_server); command::add("killserver", kill_server);
com_quit_f_hook.create(0x1400DA640, &kill_server); com_quit_f_hook.create(0x17CD00_b, &kill_server);
} }
}; };
} }

View File

@ -462,18 +462,18 @@ namespace dvars
// dvar_re_register_hook.create(0x185150_b, dvar_re_register_stub); // dvar_re_register_hook.create(0x185150_b, dvar_re_register_stub);
} }
/*dvar_register_bool_hook.create(SELECT_VALUE(0x1403C47E0, 0x1404FA540), &dvar_register_bool); dvar_register_bool_hook.create(SELECT_VALUE(0x0, 0x182340_b), &dvar_register_bool); // good
dvar_register_float_hook.create(SELECT_VALUE(0x1403C4BB0, 0x1404FA910), &dvar_register_float); //dvar_register_float_hook.create(SELECT_VALUE(0x0, 0x182900_b), &dvar_register_float); // FLOAT HASHED (TYPE 11 INSTEAD OF 1)
dvar_register_int_hook.create(SELECT_VALUE(0x1403C4CC0, 0x1404FAA20), &dvar_register_int); dvar_register_int_hook.create(SELECT_VALUE(0x0, 0x182A10_b), &dvar_register_int); // goood
dvar_register_string_hook.create(SELECT_VALUE(0x1403C4DA0, 0x1404FAB00), &dvar_register_string); //dvar_register_string_hook.create(SELECT_VALUE(0x0, 0x182AF0_b), &dvar_register_string); // INT HASHED (TYPE 12, INSTEAD OF 7)
dvar_register_vector2_hook.create(SELECT_VALUE(0x1403C4E80, 0x1404FABE0), &dvar_register_vector2); //dvar_register_vector2_hook.create(SELECT_VALUE(0x0, 0x182BD0_b), &dvar_register_vector2); // STRING (TYPE 7 INSTEAD OF 2)
dvar_register_vector3_hook.create(SELECT_VALUE(0x1403C4FC0, 0x1404FACE0), &dvar_register_vector3); //dvar_register_vector3_hook.create(SELECT_VALUE(0x0, 0x182CB0_b), &dvar_register_vector3); // VEC2 (TYPE 2 INSTEAD OF 3)
dvar_set_bool_hook.create(SELECT_VALUE(0x1403C7020, 0x1404FCDF0), &dvar_set_bool); dvar_set_bool_hook.create(SELECT_VALUE(0x0, 0x185520_b), &dvar_set_bool); // good
dvar_set_float_hook.create(SELECT_VALUE(0x1403C7420, 0x1404FD360), &dvar_set_float); dvar_set_float_hook.create(SELECT_VALUE(0x0, 0x185AA0_b), &dvar_set_float); // good
dvar_set_int_hook.create(SELECT_VALUE(0x1403C76C0, 0x1404FD5E0), &dvar_set_int); dvar_set_int_hook.create(SELECT_VALUE(0x0, 0x185D10_b), &dvar_set_int); // good
dvar_set_string_hook.create(SELECT_VALUE(0x1403C7900, 0x1404FD8D0), &dvar_set_string); dvar_set_string_hook.create(SELECT_VALUE(0x0, 0x186080_b), &dvar_set_string); // good
dvar_set_from_string_hook.create(SELECT_VALUE(0x1403C7620, 0x1404FD520), &dvar_set_from_string);*/ dvar_set_from_string_hook.create(SELECT_VALUE(0x0, 0x185C60_b), &dvar_set_from_string); // good
} }
}; };
} }

View File

@ -49,4 +49,4 @@ namespace localized_strings
}; };
} }
//REGISTER_COMPONENT(localized_strings::component) REGISTER_COMPONENT(localized_strings::component)

View File

@ -366,13 +366,13 @@ namespace server_list
lui_open_menu_hook.create(game::LUI_OpenMenu, lui_open_menu_stub); lui_open_menu_hook.create(game::LUI_OpenMenu, lui_open_menu_stub);
// replace UI_RunMenuScript call in LUI_CoD_LuaCall_RefreshServerList to our refresh_servers // replace UI_RunMenuScript call in LUI_CoD_LuaCall_RefreshServerList to our refresh_servers
utils::hook::call(0x14018A0C9, &refresh_server_list); utils::hook::call(0x28E049_b, &refresh_server_list);
utils::hook::call(0x14018A5DE, &join_server); utils::hook::call(0x28E55E_b, &join_server);
utils::hook::nop(0x14018A5FD, 5); utils::hook::nop(0x28E57D_b, 5);
// do feeder stuff // do feeder stuff
utils::hook::call(0x14018A199, &ui_feeder_count); utils::hook::call(0x28E119_b, &ui_feeder_count);
utils::hook::call(0x14018A3B1, &ui_feeder_item_text); utils::hook::call(0x28E331_b, &ui_feeder_item_text);
scheduler::loop(do_frame_work, scheduler::pipeline::main); scheduler::loop(do_frame_work, scheduler::pipeline::main);

View File

@ -69,9 +69,9 @@ namespace stats
if (game::environment::is_dedi()) if (game::environment::is_dedi())
{ {
utils::hook::jump(0x140413E60, is_item_unlocked); utils::hook::jump(0x19E6E0_b, is_item_unlocked);
utils::hook::jump(0x140413860, is_item_unlocked); utils::hook::jump(0x19E070_b, is_item_unlocked);
utils::hook::jump(0x140412B70, is_item_unlocked); utils::hook::jump(0x19D390_b, is_item_unlocked);
} }
else else
{ {
@ -80,12 +80,12 @@ namespace stats
dvars::register_bool("cg_unlockall_classes", false, game::DVAR_FLAG_SAVED, dvars::register_bool("cg_unlockall_classes", false, game::DVAR_FLAG_SAVED,
"Whether classes should be locked based on the player's stats or always unlocked."); "Whether classes should be locked based on the player's stats or always unlocked.");
is_item_unlocked_hook.create(0x140413E60, is_item_unlocked_stub); is_item_unlocked_hook.create(0x19E6E0_b, is_item_unlocked_stub);
is_item_unlocked_hook2.create(0x140413860, is_item_unlocked_stub2); is_item_unlocked_hook2.create(0x19E070_b, is_item_unlocked_stub2);
is_item_unlocked_hook3.create(0x140412B70, is_item_unlocked_stub3); is_item_unlocked_hook3.create(0x19D390_b, is_item_unlocked_stub3);
} }
} }
}; };
} }
//REGISTER_COMPONENT(stats::component) REGISTER_COMPONENT(stats::component)

View File

@ -35,7 +35,7 @@ namespace game
WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{0x0, 0x5AEF80}; WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{0x0, 0x5AEF80};
WEAK symbol<bool()> Com_InFrontend{0x0, 0x76A40}; WEAK symbol<bool()> Com_InFrontend{0x0, 0x76A40};
WEAK symbol<void(float, float, int)> Com_SetSlowMotion{0x0, 0x17E5F0}; WEAK symbol<void(float, float, int)> Com_SetSlowMotion{0x0, 0x17E5F0};
WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{0x0, 0x0}; WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{0x0, 0x159860};
WEAK symbol<void()> Com_Quit_f{0x0, 0x1F9280}; WEAK symbol<void()> Com_Quit_f{0x0, 0x1F9280};
WEAK symbol<void(char const* finalMessage)> Com_Shutdown{0x0, 0x0}; WEAK symbol<void(char const* finalMessage)> Com_Shutdown{0x0, 0x0};