From 3bcf0adc19c4b9a8ef9b849cfafaca8f8ab28bec Mon Sep 17 00:00:00 2001 From: quaK Date: Mon, 5 Feb 2024 16:37:35 +0200 Subject: [PATCH] Update logger.cpp --- src/client/component/logger.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/component/logger.cpp b/src/client/component/logger.cpp index 2b65ff89..95d33b11 100644 --- a/src/client/component/logger.cpp +++ b/src/client/component/logger.cpp @@ -92,11 +92,20 @@ namespace logger console::info("Working directory: %s\n", game::Sys_Cwd()); } - void com_init_stub(void* a1) + void com_init_stub(utils::hook::assembler& a) { - com_init_pre(); - utils::hook::invoke(0xB8EF90_b, a1); - com_init_post(); + // arxan doesn't like his registers/stack getting touched + a.pushad64(); + a.call_aligned(com_init_pre); + a.popad64(); + + a.call(0xB8EF90_b); + + a.pushad64(); + a.call_aligned(com_init_post); + a.popad64(); + + a.jmp(0xD4D8DD_b); } } @@ -114,7 +123,7 @@ namespace logger // Com_Printf utils::hook::jump(0x343080_b, print_info); - utils::hook::call(0xD4D8D8_b, com_init_stub); + utils::hook::jump(0xD4D8D8_b, utils::hook::assemble(com_init_stub), false); if (!game::environment::is_dedi()) {