From 5453480febcee176313c326a1eb7d0164956eb53 Mon Sep 17 00:00:00 2001 From: shevernitskiy Date: Wed, 4 Oct 2023 12:51:36 +0300 Subject: [PATCH] add `50.11 classic win64` offsets --- config/offsets/50.11_classic_win64.toml | 39 +++++++++++++++++++++++++ src/hook/config.h | 14 ++++----- src/hook/main.cpp | 4 +-- 3 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 config/offsets/50.11_classic_win64.toml diff --git a/config/offsets/50.11_classic_win64.toml b/config/offsets/50.11_classic_win64.toml new file mode 100644 index 0000000..62bd385 --- /dev/null +++ b/config/offsets/50.11_classic_win64.toml @@ -0,0 +1,39 @@ +[metadata] +name = "dfint localization hook offsets" +version = "50.11 classic win64" +checksum = 0x65190584 + +[offsets] +# translation +string_copy = 0xBA90 +string_copy_n = 0xBAB0 +string_append = 0xB860 +string_append_0 = 0xB880 +string_append_n = 0xBBF0 +convert_ulong_to_string = 0x3BA8B0 +addst = 0x7FADE0 +addst_top = 0x7FAEC0 +addcoloredst = 0x7FAA70 +addst_flag = 0x7FAB50 +# search +standardstringentry = 0x9006C0 +simplify_string = 0x3BB240 +upper_case_string = 0x3BB580 +lower_case_string = 0x3BB3E0 +capitalize_string_words = 0x3BB720 +capitalize_string_first_word = 0x3BB9A0 +# ttf +addchar = 0x56A60 +addchar_top = 0x118030 +add_texture = 0xF2E220 +gps_allocate = 0x62AF30 +cleanup_arrays = 0x62AD50 +screen_to_texid = 0x624110 +screen_to_texid_top = 0x624300 +# game state +loading_world_new_game_loop = 0xA81D10 +loading_world_continuing_game_loop = 0x5CE820 +loading_world_start_new_game_loop = 0x5CCB20 +menu_interface_loop = 0x19BA20 +# keybinding shift +keybinding = 370 diff --git a/src/hook/config.h b/src/hook/config.h index 7c36053..3136c6d 100644 --- a/src/hook/config.h +++ b/src/hook/config.h @@ -3,10 +3,10 @@ namespace Config { - constexpr const auto PATH_OFFSETS = "./dfint_data/offsets/"; - constexpr const auto PATH_LOG = "./dfint_data/dfint_log.log"; - constexpr const auto PATH_DICTIONARY = "./dfint_data/dfint_dictionary.csv"; - constexpr const auto PATH_REPORTS = "./dfint_data/crash_reports/"; + const std::filesystem::path PATH_OFFSETS{ "./dfint_data/offsets/" }; + const std::filesystem::path PATH_LOG{ "./dfint_data/dfint_log.log" }; + const std::filesystem::path PATH_DICTIONARY{ "./dfint_data/dfint_dictionary.csv" }; + const std::filesystem::path PATH_REPORTS{ "./dfint_data/crash_reports/" }; inline time_t PETimestamp(const std::string filename) { std::ifstream file(filename); @@ -72,13 +72,13 @@ namespace Config { namespace Setting { inline auto log_level = Config::config["settings"]["log_level"].value_or(0); - inline auto log_file = Config::config["settings"]["log_file"].value_or(PATH_LOG); + inline auto log_file = Config::config["settings"]["log_file"].value_or(PATH_LOG.string()); inline auto crash_report = Config::config["settings"]["crash_report"].value_or(true); inline auto enable_search = Config::config["settings"]["enable_search"].value_or(true); inline auto enable_translation = Config::config["settings"]["enable_translation"].value_or(true); inline auto enable_patches = Config::config["settings"]["enable_patches"].value_or(true); - inline auto dictionary = Config::config["settings"]["dictionary"].value_or(PATH_DICTIONARY); - inline auto crash_report_dir = Config::config["settings"]["crash_report_dir"].value_or(PATH_REPORTS); + inline auto dictionary = Config::config["settings"]["dictionary"].value_or(PATH_DICTIONARY.string()); + inline auto crash_report_dir = Config::config["settings"]["crash_report_dir"].value_or(PATH_REPORTS.string()); inline auto watchdog = Config::config["settings"]["watchdog"].value_or(true); } // namespace Setting diff --git a/src/hook/main.cpp b/src/hook/main.cpp index fa9ebad..5b4e17a 100644 --- a/src/hook/main.cpp +++ b/src/hook/main.cpp @@ -5,8 +5,6 @@ #include "patches.h" #include "watchdog.hpp" -extern "C" __declspec(dllexport) VOID NullExport(VOID) {} - BOOL ProcessAttach() { InitLogger(); if (Config::Setting::watchdog) { @@ -64,7 +62,7 @@ BOOL ProcessDetach() { return TRUE; } -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { +extern "C" __declspec(dllexport) BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { if (Config::Setting::crash_report) { CrashReport::Install(); }