Fixes for pluto update

This commit is contained in:
Federico Cecchetto 2021-11-09 23:55:25 +01:00
parent d4d91de80f
commit 0f92a7ce25
4 changed files with 17 additions and 12 deletions

View File

@ -93,7 +93,7 @@ namespace gsc
{
if (id < 0x200)
{
return reinterpret_cast<builtin_function*>(0x20689DD8)[id]();
return reinterpret_cast<builtin_function*>(game::plutonium::function_table.get())[id]();
}
try
@ -119,7 +119,7 @@ namespace gsc
{
if (id < 0x8400)
{
return reinterpret_cast<builtin_method*>(0x2068A5A8)[id - 0x8000](ent);
return reinterpret_cast<builtin_method*>(game::plutonium::method_table.get())[id - 0x8000](ent);
}
try

View File

@ -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<DWORD*>(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<uintptr_t>(&printf), game::plutonium::printf);
component_loader::post_unpack();
}

View File

@ -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)
{

View File

@ -81,8 +81,11 @@ namespace game
namespace plutonium
{
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> function_map_rev{0x20691228};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> method_map_rev{0x20691248};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> token_map_rev{0x20691288};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> function_map_rev{0x20692868};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> method_map_rev{0x20692888};
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> token_map_rev{0x206928C8};
WEAK symbol<int(const char* fmt, ...)> printf{0x20867950};
WEAK symbol<void*> function_table{0x2068B418};
WEAK symbol<void*> method_table{0x2068BBE8};
}
}