From 0f92a7ce257364479f0e56f90cd46567fc17ad4b Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Tue, 9 Nov 2021 23:55:25 +0100 Subject: [PATCH] Fixes for pluto update --- src/component/gsc.cpp | 4 ++-- src/dllmain.cpp | 12 +++++++----- src/game/scripting/functions.cpp | 4 ++-- src/game/symbols.hpp | 9 ++++++--- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/component/gsc.cpp b/src/component/gsc.cpp index c80d737..ff56063 100644 --- a/src/component/gsc.cpp +++ b/src/component/gsc.cpp @@ -93,7 +93,7 @@ namespace gsc { if (id < 0x200) { - return reinterpret_cast(0x20689DD8)[id](); + return reinterpret_cast(game::plutonium::function_table.get())[id](); } try @@ -119,7 +119,7 @@ namespace gsc { if (id < 0x8400) { - return reinterpret_cast(0x2068A5A8)[id - 0x8000](ent); + return reinterpret_cast(game::plutonium::method_table.get())[id - 0x8000](ent); } try diff --git a/src/dllmain.cpp b/src/dllmain.cpp index c4cb3ac..7aa72f6 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -6,15 +6,17 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv if (ul_reason_for_call == DLL_PROCESS_ATTACH) { const auto value = *reinterpret_cast(0x20800000); - if (value != 0xB9C9566) + if (value != 0x2A6784ED) { - printf("\x1b[31m\n**************************************************************************************\n\n"); - printf("This version of \x1b[33miw5-gsc-utils\x1b[31m is outdated.\n"); - printf("Download the latest dll from here:\x1b[34m https://github.com/fedddddd/iw5-gsc-utils/releases \x1b[31m\n"); - printf("\n**************************************************************************************\n\n\x1b[37m"); + MessageBoxA(NULL, + "This version of iw5-gsc-utils is outdated.\n" \ + "Download the latest dll from here: https://github.com/fedddddd/iw5-gsc-utils/releases" \ + , "ERROR", MB_ICONERROR); + return FALSE; } + utils::hook::jump(reinterpret_cast(&printf), game::plutonium::printf); component_loader::post_unpack(); } diff --git a/src/game/scripting/functions.cpp b/src/game/scripting/functions.cpp index cfb2665..c46f367 100644 --- a/src/game/scripting/functions.cpp +++ b/src/game/scripting/functions.cpp @@ -59,8 +59,8 @@ namespace scripting script_function get_function_by_index(const unsigned index) { - static const auto function_table = 0x20689DD8; - static const auto method_table = 0x2068A5A8; + static const auto function_table = game::plutonium::function_table.get(); + static const auto method_table = game::plutonium::method_table.get(); if (index < 0x1C7) { diff --git a/src/game/symbols.hpp b/src/game/symbols.hpp index 2842f11..e3e50fb 100644 --- a/src/game/symbols.hpp +++ b/src/game/symbols.hpp @@ -81,8 +81,11 @@ namespace game namespace plutonium { - WEAK symbol> function_map_rev{0x20691228}; - WEAK symbol> method_map_rev{0x20691248}; - WEAK symbol> token_map_rev{0x20691288}; + WEAK symbol> function_map_rev{0x20692868}; + WEAK symbol> method_map_rev{0x20692888}; + WEAK symbol> token_map_rev{0x206928C8}; + WEAK symbol printf{0x20867950}; + WEAK symbol function_table{0x2068B418}; + WEAK symbol method_table{0x2068BBE8}; } } \ No newline at end of file