Some fixes

This commit is contained in:
Federico Cecchetto 2022-05-19 17:01:34 +02:00
parent fa37ac92c4
commit aa151b3d8d
5 changed files with 25 additions and 25 deletions

View File

@ -215,7 +215,7 @@ namespace dedicated
gscr_set_dynamic_dvar_hook.create(0x43CF60_b, &gscr_set_dynamic_dvar); gscr_set_dynamic_dvar_hook.create(0x43CF60_b, &gscr_set_dynamic_dvar);
utils::hook::nop(0x189514_b, 248); // don't load config file utils::hook::nop(0x189514_b, 248); // don't load config file
utils::hook::nop(0x156C46_b, 5); // ^ // NOT SURE utils::hook::nop(0x156C46_b, 5); // ^
utils::hook::set<uint8_t>(0x17F470_b, 0xC3); // don't save config file utils::hook::set<uint8_t>(0x17F470_b, 0xC3); // don't save config file
utils::hook::set<uint8_t>(0x351AA0_b, 0xC3); // disable self-registration utils::hook::set<uint8_t>(0x351AA0_b, 0xC3); // disable self-registration
utils::hook::set<uint8_t>(0x5BF4E0_b, 0xC3); // init sound system (1) utils::hook::set<uint8_t>(0x5BF4E0_b, 0xC3); // init sound system (1)
@ -268,7 +268,7 @@ namespace dedicated
utils::hook::set<uint8_t>(0x687D20_b, 0xC3); // R_Shutdown utils::hook::set<uint8_t>(0x687D20_b, 0xC3); // R_Shutdown
utils::hook::set<uint8_t>(0x652BA0_b, 0xC3); // shutdown stuff utils::hook::set<uint8_t>(0x652BA0_b, 0xC3); // shutdown stuff
utils::hook::set<uint8_t>(0x687DF0_b, 0xC3); // ^ utils::hook::set<uint8_t>(0x687DF0_b, 0xC3); // ^
utils::hook::set<uint8_t>(0x686DE0_b, 0xC3); // ^ COULDN'T FOUND utils::hook::set<uint8_t>(0x686DE0_b, 0xC3); // ^
// 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)
@ -288,9 +288,9 @@ namespace dedicated
// Reduce min required memory // Reduce min required memory
utils::hook::set<uint64_t>(0x5B7F37_b, 0x80000000); utils::hook::set<uint64_t>(0x5B7F37_b, 0x80000000);
utils::hook::set(0x399E10_b, 0xC3); // some loop utils::hook::set<uint8_t>(0x399E10_b, 0xC3); // some loop
utils::hook::set(0x1D48B0_b, 0xC3); // related to shader caching / techsets / fastfilesc utils::hook::set<uint8_t>(0x1D48B0_b, 0xC3); // related to shader caching / techsets / fastfilesc
utils::hook::set(0x3A1940_b, 0xC3); // DB_ReadPackedLoadedSounds utils::hook::set<uint8_t>(0x3A1940_b, 0xC3); // DB_ReadPackedLoadedSounds
// initialize the game after onlinedataflags is 32 (workaround) // initialize the game after onlinedataflags is 32 (workaround)
scheduler::schedule([=]() scheduler::schedule([=]()

View File

@ -512,7 +512,7 @@ namespace demonware
void request_start_match_stub() void request_start_match_stub()
{ {
const auto* args = "StartServer"; const auto* args = "StartServer";
utils::hook::invoke<void>(0x1E35B0_b, 0, &args); game::UI_RunMenuScript(0, &args);
} }
} }

View File

@ -148,15 +148,15 @@ namespace party
const auto drop_reason_stub = utils::hook::assemble([](utils::hook::assembler& a) const auto drop_reason_stub = utils::hook::assemble([](utils::hook::assembler& a)
{ {
// a.mov(rdx, rdi); a.mov(rdx, rsi);
// a.mov(ecx, 2); a.mov(ecx, 2);
// a.jmp(0x140251F78); a.jmp(0x12EF27_b);
}); });
void menu_error(const std::string& error) void menu_error(const std::string& error)
{ {
//utils::hook::invoke<void>(0x1400DACC0, error.data(), "MENU_NOTICE"); utils::hook::invoke<void>(0x17D770_b, error.data(), "MENU_NOTICE");
//utils::hook::set(0x142C1DA98, 1); utils::hook::set(0x2ED2F78_b, 1);
} }
} }
@ -282,7 +282,6 @@ namespace party
} }
console::info("Starting map: %s\n", mapname.data()); console::info("Starting map: %s\n", mapname.data());
auto* gametype = game::Dvar_FindVar("g_gametype"); auto* gametype = game::Dvar_FindVar("g_gametype");
if (gametype && gametype->current.string) if (gametype && gametype->current.string)
{ {
@ -326,12 +325,12 @@ namespace party
if (game::environment::is_mp()) if (game::environment::is_mp())
{ {
// show custom drop reason // show custom drop reason
// utils::hook::nop(0x140251EFB, 13); // utils::hook::nop(0x12EF4E_b, 13);
// utils::hook::jump(0x140251EFB, drop_reason_stub, true); // utils::hook::jump(0x12EF4E_b, drop_reason_stub, true);
} }
// enable custom kick reason in GScr_KickPlayer // enable custom kick reason in GScr_KickPlayer
// utils::hook::set<uint8_t>(0x140376A1D, 0xEB); // utils::hook::set<uint8_t>(0xE423D_b, 0xEB);
command::add("map", [](const command::params& argument) command::add("map", [](const command::params& argument)
{ {
@ -349,11 +348,12 @@ namespace party
{ {
return; return;
} }
// *reinterpret_cast<int*>(0x14A3A91D0) = 1; // sv_map_restart
// *reinterpret_cast<int*>(0x14A3A91D4) = 1; // sv_loadScripts
// *reinterpret_cast<int*>(0x14A3A91D8) = 0; // sv_migrate
// utils::hook::invoke<void>(0x14047E7F0); // SV_CheckLoadGame *reinterpret_cast<int*>(0xB7B8E60_b) = 1; // sv_map_restart
*reinterpret_cast<int*>(0xB7B8E64_b) = 1; // sv_loadScripts
*reinterpret_cast<int*>(0xB7B8E68_b) = 0; // sv_migrate
utils::hook::invoke<void>(0x54BD50_b); // SV_CheckLoadGame
}); });
command::add("fast_restart", []() command::add("fast_restart", []()

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); utils::hook::set<uint8_t>(SELECT_VALUE(0, 0x5BDF20_b), 0xC3);
utils::hook::jump(SELECT_VALUE(0x1403E2E70, 0x140513AF0), destroy_stub); utils::hook::jump(SELECT_VALUE(0, 0x5BE1D0_b), destroy_stub, true);
utils::hook::jump(SELECT_VALUE(0x1403E2EB0, 0x140513B30), destroy_stub); utils::hook::jump(SELECT_VALUE(0, 0x5BE210_b), destroy_stub, true);
} }
void pre_destroy() override void pre_destroy() override
@ -138,4 +138,4 @@ namespace splash
}; };
} }
//REGISTER_COMPONENT(splash::component) REGISTER_COMPONENT(splash::component)

View File

@ -183,7 +183,7 @@ namespace game
WEAK symbol<void(int index, const char* string)> SV_SetConfigstring{0x0, 0x0}; WEAK symbol<void(int index, const char* string)> SV_SetConfigstring{0x0, 0x0};
WEAK symbol<bool()> SV_Loaded{0x0, 0x553970}; WEAK symbol<bool()> SV_Loaded{0x0, 0x553970};
WEAK symbol<void(int clientNum, const char* reason)> SV_KickClientNum{0x0, 0x0}; WEAK symbol<void(int clientNum, const char* reason)> SV_KickClientNum{0x0, 0x0};
WEAK symbol<bool(const char* map)> SV_MapExists{0x0, 0x0}; WEAK symbol<bool(const char* map)> SV_MapExists{0x0, 0x54C0C0};
WEAK symbol<void(mp::client_t*, const char*, int)> SV_ExecuteClientCommand{0x0, 0x0}; WEAK symbol<void(mp::client_t*, const char*, int)> SV_ExecuteClientCommand{0x0, 0x0};
WEAK symbol<void(int localClientNum)> SV_FastRestart{0x0, 0x0}; WEAK symbol<void(int localClientNum)> SV_FastRestart{0x0, 0x0};
WEAK symbol<void(void* cl, int type, const char* fmt, ...)> SV_SendServerCommand{0x0, 0x1CC040}; WEAK symbol<void(void* cl, int type, const char* fmt, ...)> SV_SendServerCommand{0x0, 0x1CC040};
@ -199,7 +199,7 @@ namespace game
WEAK symbol<const char* (const char*)> UI_GetMapDisplayName{0x0, 0x0}; WEAK symbol<const char* (const char*)> UI_GetMapDisplayName{0x0, 0x0};
WEAK symbol<const char* (const char*)> UI_GetGameTypeDisplayName{0x0, 0x4DD8C0}; WEAK symbol<const char* (const char*)> UI_GetGameTypeDisplayName{0x0, 0x4DD8C0};
WEAK symbol<void(unsigned int localClientNum, const char** args)> UI_RunMenuScript{0x0, 0x0}; WEAK symbol<void(unsigned int localClientNum, const char** args)> UI_RunMenuScript{0x0, 0x1E35B0};
WEAK symbol<int(const char* text, int maxChars, Font_s* font, float scale)> UI_TextWidth{0x0, 0x0}; WEAK symbol<int(const char* text, int maxChars, Font_s* font, float scale)> UI_TextWidth{0x0, 0x0};
WEAK symbol<const char*(const char* string)> UI_SafeTranslateString{0x0, 0x4E8BC0}; WEAK symbol<const char*(const char* string)> UI_SafeTranslateString{0x0, 0x4E8BC0};