From f653564e0a97ad9215fefcd017bf8c6f846264bf Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Mon, 7 Feb 2022 14:16:53 +0900 Subject: [PATCH 1/9] v1.33.0 beta --- Plugin64/Plugin64.vcxproj | 2 +- Plugin64/plugin_64.h | 3 +- Plugin64/version.cpp | 91 ++++++++++++++++++++------------------- version/version.vcxproj | 2 +- 4 files changed, 51 insertions(+), 47 deletions(-) diff --git a/Plugin64/Plugin64.vcxproj b/Plugin64/Plugin64.vcxproj index 8c9d44a3..00fe6ae8 100644 --- a/Plugin64/Plugin64.vcxproj +++ b/Plugin64/Plugin64.vcxproj @@ -101,7 +101,7 @@ false - copy "$(TargetPath)" "C:\Program Files\Epic Games\EuropaUniversalis4\plugins" + copy "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\Europa Universalis IV\plugins" diff --git a/Plugin64/plugin_64.h b/Plugin64/plugin_64.h index 01dada4f..0d2c770f 100644 --- a/Plugin64/plugin_64.h +++ b/Plugin64/plugin_64.h @@ -19,7 +19,8 @@ enum Eu4Version { v1_31_4_0 = 1314, v1_31_5_0 = 1315, v1_31_6_0 = 1316, - v1_32_0_1 = 1321 + v1_32_0_1 = 1321, + v1_33_0_0 = 1330 }; typedef UINT64 DllErrorCode; diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index d5438949..fb05133e 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -52,6 +52,8 @@ namespace Version { return u8"v1_31_6_0"; case v1_32_0_1: return u8"v1_32_0_1"; + case v1_33_0_0: + return u8"v1_33_0_1"; default: return u8"UNKNOWN"; } @@ -93,6 +95,9 @@ namespace Version { case 303: version = v1_30_3_0; break; + case 330: + version = v1_32_0_1; + break; default: version = UNKNOWN; break; @@ -100,54 +105,52 @@ namespace Version { } } else { - version = UNKNOWN; - } - - // release_v1.??.? - BytePattern::temp_instance().find_pattern("72 65 6C 65 61 73 65 5F 31 2E ? ? 2E ? 00"); - if (BytePattern::temp_instance().count() > 0) { - // ??を取得する - Pattern minor = Injector::ReadMemory(BytePattern::temp_instance().get_first().address(10), true); + // release_v1.??.? + BytePattern::temp_instance().find_pattern("72 65 6C 65 61 73 65 5F 31 2E ? ? 2E ? 00"); + if (BytePattern::temp_instance().count() > 0) { + // ??を取得する + Pattern minor = Injector::ReadMemory(BytePattern::temp_instance().get_first().address(10), true); - switch (minor.calVer()) { - case 322: - case 321: - version = v1_32_0_1; - break; - case 316: - version = v1_31_6_0; - break; - case 315: - version = v1_31_5_0; - break; - case 314: - version = v1_31_4_0; - break; - case 313: - version = v1_31_3_0; - break; - case 312: - version = v1_31_2_0; - break; - case 311: - version = v1_31_1_0; - break; - case 306: - case 305: - version = v1_30_5_0; - break; - case 304: - version = v1_30_4_0; - break; - default: + switch (minor.calVer()) { + case 322: + case 321: + version = v1_32_0_1; + break; + case 316: + version = v1_31_6_0; + break; + case 315: + version = v1_31_5_0; + break; + case 314: + version = v1_31_4_0; + break; + case 313: + version = v1_31_3_0; + break; + case 312: + version = v1_31_2_0; + break; + case 311: + version = v1_31_1_0; + break; + case 306: + case 305: + version = v1_30_5_0; + break; + case 304: + version = v1_30_4_0; + break; + default: + version = UNKNOWN; + break; + ;; + } + } + else { version = UNKNOWN; - break; - ;; } } - else { - version = UNKNOWN; - } BytePattern::LoggingInfo(versionString(version)); diff --git a/version/version.vcxproj b/version/version.vcxproj index b7a6589e..74de8f56 100644 --- a/version/version.vcxproj +++ b/version/version.vcxproj @@ -118,7 +118,7 @@ version.def - copy "$(TargetPath)" "C:\Program Files\Epic Games\EuropaUniversalis4" + copy "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\Europa Universalis IV" From b63378d44a68534051ada3eec77c0216df9303b1 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Mon, 7 Feb 2022 19:27:49 +0900 Subject: [PATCH 2/9] have no error but have no test --- Plugin64/date.cpp | 1 + Plugin64/event_dialog.cpp | 3 +++ Plugin64/file_save.cpp | 7 +++++++ Plugin64/font.cpp | 5 +++++ Plugin64/ime.cpp | 3 +++ Plugin64/input.cpp | 2 ++ Plugin64/list_field_adjustment.cpp | 3 +++ Plugin64/localization.cpp | 11 +++++++++++ Plugin64/main_text.cpp | 4 ++++ Plugin64/map_adjustment.cpp | 5 +++++ Plugin64/map_justify.cpp | 3 +++ Plugin64/map_nudge_view.cpp | 1 + Plugin64/map_popup.cpp | 3 +++ Plugin64/map_view.cpp | 3 +++ Plugin64/tooltip_and_button.cpp | 11 +++++++---- Plugin64/version.cpp | 4 ++-- 16 files changed, 63 insertions(+), 6 deletions(-) diff --git a/Plugin64/date.cpp b/Plugin64/date.cpp index aa7d637a..a7e7d722 100644 --- a/Plugin64/date.cpp +++ b/Plugin64/date.cpp @@ -35,6 +35,7 @@ namespace Date { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // d w mw w y BytePattern::temp_instance().find_pattern("64 20 77 20 6D"); if (BytePattern::temp_instance().has_size(1, u8"右上の表記を変更")) { diff --git a/Plugin64/event_dialog.cpp b/Plugin64/event_dialog.cpp index 61bb4b9f..6ccff740 100644 --- a/Plugin64/event_dialog.cpp +++ b/Plugin64/event_dialog.cpp @@ -49,6 +49,7 @@ namespace EventDialog { } break; case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rdx+rax] BytePattern::temp_instance().find_pattern("0F B6 04 02 49 8B 34 C2 F3 41 0F 10 8A 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理")) { @@ -113,6 +114,7 @@ namespace EventDialog { } break; case v1_32_0_1: + case v1_33_0_0: // mov rax, [rsp+1158h+arg_20] BytePattern::temp_instance().find_pattern("48 8B 84 24 80 11 00 00 8B 00 03 C0"); if (BytePattern::temp_instance().has_size(1, u8"分岐処理修正戻り先アドレス2")) { @@ -190,6 +192,7 @@ namespace EventDialog { } break; case v1_32_0_1: + case v1_33_0_0: // inc edi BytePattern::temp_instance().find_pattern("FF C7 3B 7B 10 44 8B 84 24 70 11 00 00"); if (BytePattern::temp_instance().has_size(1, u8"カウントアップ")) { diff --git a/Plugin64/file_save.cpp b/Plugin64/file_save.cpp index ec1bbbd3..b6d21fcd 100644 --- a/Plugin64/file_save.cpp +++ b/Plugin64/file_save.cpp @@ -55,6 +55,7 @@ namespace FileSave { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov eax, [rcx+10h] BytePattern::temp_instance().find_pattern("8B 41 10 85 C0 0F 84 31 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ファイル名を安全にしている場所を短絡する")) { @@ -81,6 +82,7 @@ namespace FileSave { int offset = 0; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: // mov [rbp+57h+var_90], 0FFFFFFFFFFFFFFFEh @@ -190,6 +192,7 @@ namespace FileSave { e.unmatch.fileSaveProc3Injector = true; } break; + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: BytePattern::temp_instance().find_pattern("45 33 C0 48 8D 93 80 05 00 00 49 8B CE"); @@ -237,6 +240,7 @@ namespace FileSave { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea r8, [rbp+0] BytePattern::temp_instance().find_pattern("4C 8D 45 00 48 8D 15 ? ? ? ? 48 8D 4C 24 70 E8 ? ? ? ? 90"); if (BytePattern::temp_instance().has_size(1, u8"ダイアログでのセーブエントリのツールチップを表示できるようにする1")) { @@ -319,6 +323,7 @@ namespace FileSave { e.unmatch.fileSaveProc5Injector = true; } break; + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: // lea r8, [r14+5C0h] @@ -384,6 +389,7 @@ namespace FileSave { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea r8, [rbp+730h+var_3A0] BytePattern::temp_instance().find_pattern("4C 8D 85 90 03 00 00 48 8D 15 ? ? ? ? 48 8D 4C 24 30"); if (BytePattern::temp_instance().has_size(1, u8"スタート画面でのコンティニューのツールチップ")) { @@ -444,6 +450,7 @@ namespace FileSave { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea rcx, [rbx+0C8h] uintptr_t address; diff --git a/Plugin64/font.cpp b/Plugin64/font.cpp index d377a9bb..050f4d58 100644 --- a/Plugin64/font.cpp +++ b/Plugin64/font.cpp @@ -31,6 +31,7 @@ namespace Font { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov rcx,cs:hHeap BytePattern::temp_instance().find_pattern("48 8B 0D ? ? ? ? 4C 8B C3 33 D2"); if (BytePattern::temp_instance().has_size(1, "Font buffer heap zero clear")) { @@ -76,6 +77,7 @@ namespace Font { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B CF"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { // mov edx, 3D68h @@ -113,6 +115,7 @@ namespace Font { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B 4D 28"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { // mov edx, 3D68h @@ -150,6 +153,7 @@ namespace Font { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: BytePattern::temp_instance().find_pattern("B9 88 3D 00 00"); if (BytePattern::temp_instance().has_size(1, "Font buffer expansion")) { // mov ecx, 3D68h @@ -186,6 +190,7 @@ namespace Font { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: BytePattern::temp_instance().find_pattern("41 81 FE 00 00 00 01"); if (BytePattern::temp_instance().has_size(1, u8"Font size limit")) { // cmp r14d, 1000000h diff --git a/Plugin64/ime.cpp b/Plugin64/ime.cpp index a3ef0fd3..80d8b53b 100644 --- a/Plugin64/ime.cpp +++ b/Plugin64/ime.cpp @@ -52,6 +52,7 @@ namespace Ime { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov edx, r13d BytePattern::temp_instance().find_pattern("41 8B D5 49 8B CC E8 ? ? ? ? 85 C0 0F 85"); if (BytePattern::temp_instance().has_size(1, u8"SDL_windowsevents.cの修正")) { @@ -103,6 +104,7 @@ namespace Ime { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: rectAddress = (uintptr_t)▭ // SDL_SetTextInputRectの関数を見つける @@ -187,6 +189,7 @@ namespace Ime { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // 直前の部分でjmpに使う14byteを確保することができなかった。 // そのためWM_KEYDOWNのコードをすべて移植した // mov rcx, [rbp+0C0h+hRawInput] diff --git a/Plugin64/input.cpp b/Plugin64/input.cpp index 276b7eba..5ca9a4b8 100644 --- a/Plugin64/input.cpp +++ b/Plugin64/input.cpp @@ -61,6 +61,7 @@ namespace Input { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov eax, dword ptr [rbp+120h+var_18C] BytePattern::temp_instance().find_pattern("8B 45 94 32 DB 3C 80 73 05 0F B6 D8 EB 10"); if (BytePattern::temp_instance().has_size(1, u8"入力した文字をutf8からエスケープ列へ変換する1")) { @@ -114,6 +115,7 @@ namespace Input { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov rax, [rdi] BytePattern::temp_instance().find_pattern("48 8B 07 48 8B CF 85 DB 74 08 FF 90 40 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"バックスペース処理の修正")) { diff --git a/Plugin64/list_field_adjustment.cpp b/Plugin64/list_field_adjustment.cpp index 976f549b..807583e1 100644 --- a/Plugin64/list_field_adjustment.cpp +++ b/Plugin64/list_field_adjustment.cpp @@ -21,6 +21,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -89,6 +90,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -161,6 +163,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: diff --git a/Plugin64/localization.cpp b/Plugin64/localization.cpp index e5b5034d..9e557eb1 100644 --- a/Plugin64/localization.cpp +++ b/Plugin64/localization.cpp @@ -54,6 +54,7 @@ namespace Localization { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov [rsp+arg_10], rbx BytePattern::temp_instance().find_pattern("48 89 5C 24 18 55 41 56 41 57 48 83 EC 20 4D 8B F0"); if (BytePattern::temp_instance().has_size(1, u8"std::basic_string#insertをフック")) { @@ -117,6 +118,7 @@ namespace Localization { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov rax, [rdi+30h] BytePattern::temp_instance().find_pattern("48 8B 47 30 4C 8B 40 28 49 83 C0 10"); if (BytePattern::temp_instance().has_size(1, u8"Battle of areaを逆転させる")) { @@ -162,6 +164,7 @@ namespace Localization { e.unmatch.localizationProc3Injector = true; } break; + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -231,6 +234,7 @@ namespace Localization { e.unmatch.localizationProc4Injector = true; } break; + case v1_33_0_0: case v1_32_0_1: offset = 0x3C; pattern = "48 8B D8 48 8B 8E 70 19 00 00 48 89 8D A0 00 00 00 45 33 C9 45 33 C0 33 D2 48 8D 8D A0 00 00 00 E8 ? ? ? ? 4C 8B C8 48 89 7C 24 38 48 89 5C 24 28"; @@ -308,6 +312,7 @@ namespace Localization { int offset = 0; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: pattern = "48 8B 4F 68 48 8B 01 FF 50 08 84 C0 74 5F 48 8B 07"; @@ -391,6 +396,9 @@ namespace Localization { int offset = 0; switch (options.version) { + case v1_33_0_0: + /* 処理は不要になった。tmm_l_english.ymlのLONG_EU3_DATE_STRINGで代用される*/ + break; case v1_32_0_1: case v1_31_6_0: pattern = "4C 8D 05 ? ? ? ? 48 8D 55 DF 48 8D 4D BF E8 ? ? ? ? 90"; @@ -453,6 +461,7 @@ namespace Localization { std::string pattern; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -507,6 +516,7 @@ namespace Localization { std::string pattern; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -560,6 +570,7 @@ namespace Localization { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: diff --git a/Plugin64/main_text.cpp b/Plugin64/main_text.cpp index 10342d5f..68155a72 100644 --- a/Plugin64/main_text.cpp +++ b/Plugin64/main_text.cpp @@ -36,6 +36,7 @@ namespace MainText { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movsxd rax, edi BytePattern::temp_instance().find_pattern("48 63 C7 0F B6 04 18 F3 41 0F 10 9F 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"テキスト処理ループ2の文字取得修正")) { @@ -61,6 +62,7 @@ namespace MainText { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: @@ -122,6 +124,7 @@ namespace MainText { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: // cmp cs:byte_xxxxx, 0 BytePattern::temp_instance().find_pattern("80 3D ? ? ? ? 00 0F 84 9A 01 00 00"); @@ -235,6 +238,7 @@ namespace MainText { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rdx+r10] BytePattern::temp_instance().find_pattern("42 0F B6 04 12 49 8B 0C C7"); if (BytePattern::temp_instance().has_size(1, u8"テキスト処理ループ1の文字取得修正")) { diff --git a/Plugin64/map_adjustment.cpp b/Plugin64/map_adjustment.cpp index ce7a6075..55001589 100644 --- a/Plugin64/map_adjustment.cpp +++ b/Plugin64/map_adjustment.cpp @@ -61,6 +61,7 @@ namespace MapAdjustment { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movsx ecx, byte ptr [rdi + rbx] BytePattern::temp_instance().find_pattern("0F BE 0C 1F E8 ? ? ? ? 88 04 1F 41 FF"); if (BytePattern::temp_instance().has_size(2, u8"マップ文字の大文字化キャンセル")) { @@ -133,6 +134,7 @@ namespace MapAdjustment { } break; case v1_32_0_1: + case v1_33_0_0: // lea rax, [rbp+200h+var_200] BytePattern::temp_instance().find_pattern("48 8D 45 00 49 83 C8 FF 90 49 FF C0"); if (BytePattern::temp_instance().has_size(1, u8"文字チェック修正") || @@ -198,6 +200,7 @@ namespace MapAdjustment { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // r9, 0FFFFFFFFFFFFFFFFh BytePattern::temp_instance().find_pattern("49 83 C9 FF 45 33 C0 48 8D 95 D0 00 00 00"); if (BytePattern::temp_instance().has_size(1, u8"文字チェックの後のコピー処理")) { @@ -262,6 +265,7 @@ namespace MapAdjustment { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea rax, [rbp+200h+var_160] BytePattern::temp_instance().find_pattern("48 8D 85 A0 00 00 00 49 83 F8 10"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理修正")) { @@ -330,6 +334,7 @@ namespace MapAdjustment { } break; case v1_32_0_1: + case v1_33_0_0: // localization/tmm_l_english.ymlのENCLAVE_NAME_FORMATで対応された break; diff --git a/Plugin64/map_justify.cpp b/Plugin64/map_justify.cpp index e5c9db0e..6200541e 100644 --- a/Plugin64/map_justify.cpp +++ b/Plugin64/map_justify.cpp @@ -32,6 +32,7 @@ namespace MapJustify { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movsd xmm3, [rbp+1D0h+var_168] BytePattern::temp_instance().find_pattern("F2 0F 10 5D 68 FF C2 F2 0F 10 65 20"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理リターン先2")) { @@ -82,6 +83,7 @@ namespace MapJustify { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea eax, [r10-1] BytePattern::temp_instance().find_pattern("41 8D 42 FF 66 0F 6E F2 66 0F 6E C0"); if (BytePattern::temp_instance().has_size(1, u8"一文字表示の調整")) { @@ -123,6 +125,7 @@ namespace MapJustify { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movsd xmm3, [rbp+1D0h+var_168] BytePattern::temp_instance().find_pattern("F2 0F 10 5D 68 FF C2 F2 0F 10 65 20"); if (BytePattern::temp_instance().has_size(1, u8"カウント処理")) { diff --git a/Plugin64/map_nudge_view.cpp b/Plugin64/map_nudge_view.cpp index 2e9c709b..c915b629 100644 --- a/Plugin64/map_nudge_view.cpp +++ b/Plugin64/map_nudge_view.cpp @@ -41,6 +41,7 @@ namespace MapNudgeView { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rax+rcx] BytePattern::temp_instance().find_pattern("0F B6 04 08 49 8B 94 C4 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"nudge view")) { diff --git a/Plugin64/map_popup.cpp b/Plugin64/map_popup.cpp index 2aa89490..7fb9301e 100644 --- a/Plugin64/map_popup.cpp +++ b/Plugin64/map_popup.cpp @@ -33,6 +33,7 @@ namespace MapPopup { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx r8d, byte ptr [rdi+rax] BytePattern::temp_instance().find_pattern("44 0F B6 04 07 BA 01 00 00 00 48 8D 4D D0"); if (BytePattern::temp_instance().has_size(1, u8"ループ1の文字列コピー")) { @@ -90,6 +91,7 @@ namespace MapPopup { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rax+rdi] BytePattern::temp_instance().find_pattern("0F B6 04 38 4D 8B B4 C7 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ループ1の文字取得")) { @@ -144,6 +146,7 @@ namespace MapPopup { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rbx+rax] BytePattern::temp_instance().find_pattern("0F B6 04 03 4D 8B 9C C7 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ループ2の文字取得")) { diff --git a/Plugin64/map_view.cpp b/Plugin64/map_view.cpp index 5d4caceb..b1674239 100644 --- a/Plugin64/map_view.cpp +++ b/Plugin64/map_view.cpp @@ -33,6 +33,7 @@ namespace MapView { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx eax, byte ptr [rax+r8] BytePattern::temp_instance().find_pattern("42 0F B6 04 00 4C 8B 1C C7 4C 89 5D 38"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ2の文字取得処理")) { @@ -88,6 +89,7 @@ namespace MapView { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // lea r9, [r12+120h] BytePattern::temp_instance().find_pattern("4D 8D 8C 24 20 01 00 00 42 0F B6 04 38 4D 8B 24 C1"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字取得処理")) { @@ -129,6 +131,7 @@ namespace MapView { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movzx r8d, byte ptr [rax+r15] BytePattern::temp_instance().find_pattern("46 0F B6 04 38 BA 01 00 00 00 48 8D 4C 24 40"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字コピー")) { diff --git a/Plugin64/tooltip_and_button.cpp b/Plugin64/tooltip_and_button.cpp index 1f2d3056..a94c956a 100644 --- a/Plugin64/tooltip_and_button.cpp +++ b/Plugin64/tooltip_and_button.cpp @@ -43,6 +43,7 @@ namespace TooltipAndButton { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // r8d, byte ptr [rax + rcx] BytePattern::temp_instance().find_pattern("44 0F B6 04 08 BA 01 00 00 00"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字コピー")) { @@ -87,6 +88,7 @@ namespace TooltipAndButton { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov edx, ebx BytePattern::temp_instance().find_pattern("8B D3 0F B6 04 10 49 8B 0C C7"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字取得")) { @@ -128,6 +130,7 @@ namespace TooltipAndButton { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // mov ecx, ebx BytePattern::temp_instance().find_pattern("8B CB F3 45 0F 10 97 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ2の文字取得")) { @@ -153,10 +156,6 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { - - - - case v1_29_1_0: case v1_29_2_0: case v1_29_3_0: @@ -189,6 +188,7 @@ namespace TooltipAndButton { e.unmatch.tooltipAndButtonProc4Injector = true; } break; + case v1_33_0_0: case v1_32_0_1: // cmp word ptr [rcx + 6], 0 BytePattern::temp_instance().find_pattern("66 83 79 06 00 0F 85 11 03 00 00"); @@ -281,6 +281,7 @@ namespace TooltipAndButton { case v1_31_5_0: case v1_31_6_0: case v1_32_0_1: + case v1_33_0_0: // movaps xmm8, [rsp+0F8h+var_58] BytePattern::temp_instance().find_pattern("44 0F 28 84 24 A0 00 00 00 0F 28 BC 24 B0 00 00 00 48"); if (BytePattern::temp_instance().has_size(1, u8"ツールチップの改行処理のリターン先2")) { @@ -316,6 +317,7 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: // inc edx BytePattern::temp_instance().find_pattern("FF C3 3B 5D 60 7D 1D E9 7D F7 FF FF E8"); @@ -374,6 +376,7 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: case v1_31_5_0: diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index fb05133e..7fceae6f 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -53,7 +53,7 @@ namespace Version { case v1_32_0_1: return u8"v1_32_0_1"; case v1_33_0_0: - return u8"v1_33_0_1"; + return u8"v1_33_0_0"; default: return u8"UNKNOWN"; } @@ -96,7 +96,7 @@ namespace Version { version = v1_30_3_0; break; case 330: - version = v1_32_0_1; + version = v1_33_0_0; break; default: version = UNKNOWN; From f740b3df11f0d2e54cc44a87e656121b8c29e2a2 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Tue, 8 Feb 2022 20:16:51 +0900 Subject: [PATCH 3/9] Char code limit patch --- Plugin64/font.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/Plugin64/font.cpp b/Plugin64/font.cpp index 050f4d58..f8308af3 100644 --- a/Plugin64/font.cpp +++ b/Plugin64/font.cpp @@ -10,6 +10,49 @@ namespace Font { uintptr_t fontBufferHeapZeroClearHeapJmpAddress; } + DllError charCodePointLimiterPatchInjector(RunOptions options) { + DllError e = {}; + + switch (options.version) { + case v1_29_0_0: + case v1_29_1_0: + case v1_29_2_0: + case v1_29_3_0: + case v1_29_4_0: + case v1_30_1_0: + case v1_30_2_0: + case v1_30_3_0: + case v1_30_4_0: + case v1_30_5_0: + case v1_31_1_0: + case v1_31_2_0: + case v1_31_3_0: + case v1_31_4_0: + case v1_31_5_0: + case v1_31_6_0: + case v1_32_0_1: + /* 1.33.0.0 betaで初めて確認された */ + break; + + case v1_33_0_0: + // cmp edi, 0FFh + // 81 FF FF 00 00 00 + BytePattern::temp_instance().find_pattern("81 FF FF 00 00 00 0F 87 2C 01 00 00 83"); + if (BytePattern::temp_instance().has_size(1, "Char Code Point Limiter")) { + uintptr_t address = BytePattern::temp_instance().get_first().address(); + Injector::WriteMemory(address + 3, 0xFF,true); + } + else { + e.unmatch.fontBufferHeapZeroClearInjector = true; + } + break; + default: + e.version.fontBufferHeapZeroClearInjector = true; + } + + return e; + } + DllError fontBufferHeapZeroClearInjector(RunOptions options) { DllError e = {}; @@ -80,7 +123,7 @@ namespace Font { case v1_33_0_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B CF"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { - // mov edx, 3D68h + // mov edx, 3D88h Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { @@ -118,7 +161,7 @@ namespace Font { case v1_33_0_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B 4D 28"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { - // mov edx, 3D68h + // mov edx, 3D88h Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { @@ -156,7 +199,7 @@ namespace Font { case v1_33_0_0: BytePattern::temp_instance().find_pattern("B9 88 3D 00 00"); if (BytePattern::temp_instance().has_size(1, "Font buffer expansion")) { - // mov ecx, 3D68h + // mov ecx, 3D88h Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { e.unmatch.fontBufferExpansionInjector = true; @@ -213,6 +256,9 @@ namespace Font { BytePattern::LoggingInfo(u8"font etc fix"); + /* codePointが0xFFまでしか入らないようにしている箇所にパッチを当てる*/ + result |= charCodePointLimiterPatchInjector(options); + /* ヒープゼロフラグの修正 */ result |= fontBufferHeapZeroClearInjector(options); From 3d623ffe6b351ebd865ac904f68c88bbf0786bba Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Fri, 11 Feb 2022 13:57:53 +0900 Subject: [PATCH 4/9] Refact error printer --- Plugin64/date.cpp | 4 +- Plugin64/debug.cpp | 4 +- Plugin64/event_dialog.cpp | 24 +- Plugin64/file_save.cpp | 40 +-- Plugin64/font.cpp | 24 +- Plugin64/ime.cpp | 18 +- Plugin64/input.cpp | 14 +- Plugin64/list_field_adjustment.cpp | 22 +- Plugin64/localization.cpp | 46 ++-- Plugin64/main_text.cpp | 28 +- Plugin64/map_adjustment.cpp | 34 +-- Plugin64/map_justify.cpp | 14 +- Plugin64/map_nudge_view.cpp | 6 +- Plugin64/map_popup.cpp | 16 +- Plugin64/map_view.cpp | 14 +- Plugin64/plugin_64.h | 411 +++++++++++++++++++--------- Plugin64/tooltip_and_button.cpp | 108 ++++---- Plugin64/tooltip_and_button_asm.asm | 12 +- Plugin64/validator.cpp | 17 +- Plugin64/version.cpp | 86 +++--- 20 files changed, 538 insertions(+), 404 deletions(-) diff --git a/Plugin64/date.cpp b/Plugin64/date.cpp index a7e7d722..89fa704b 100644 --- a/Plugin64/date.cpp +++ b/Plugin64/date.cpp @@ -44,11 +44,11 @@ namespace Date { Injector::WriteMemory(address, isoFormat,true); } else { - e.unmatch.dateProc1Injector = true; + e.date.unmatchdDateProc1Injector = true; } break; default: - e.version.dateProc1Injector = true; + e.date.versionDateProc1Injector = true; } return e; diff --git a/Plugin64/debug.cpp b/Plugin64/debug.cpp index d3b93c2a..f92724db 100644 --- a/Plugin64/debug.cpp +++ b/Plugin64/debug.cpp @@ -50,11 +50,11 @@ namespace Debug { Injector::MakeJMP(address, debugProc1, true); } else { - e.unmatch.debugProc1Injector = true; + e.debug.unmatchdDebugProc1Injector = true; } break; default: - e.version.debugProc1Injector = true; + e.debug.versionDebugProc1Injector = true; } return e; diff --git a/Plugin64/event_dialog.cpp b/Plugin64/event_dialog.cpp index 6ccff740..1b5ff5bc 100644 --- a/Plugin64/event_dialog.cpp +++ b/Plugin64/event_dialog.cpp @@ -45,7 +45,7 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc1, true); } else { - e.unmatch.eventDialog1Injector = true; + e.eventDialog.unmatchdEventDialog1Injector = true; } break; case v1_32_0_1: @@ -61,11 +61,11 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc1V132, true); } else { - e.unmatch.eventDialog1Injector = true; + e.eventDialog.unmatchdEventDialog1Injector = true; } break; default: - e.version.eventDialog1Injector = true; + e.eventDialog.versionEventDialog1Injector = true; } return e; @@ -96,7 +96,7 @@ namespace EventDialog { eventDialogProc2ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.eventDialog1Injector = true; + e.eventDialog.unmatchdEventDialog2Injector = true; } // cvtdq2ps xmm0, xmm0 @@ -110,7 +110,7 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc2, true); } else { - e.unmatch.eventDialog2Injector = true; + e.eventDialog.unmatchdEventDialog2Injector = true; } break; case v1_32_0_1: @@ -121,7 +121,7 @@ namespace EventDialog { eventDialogProc2ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.eventDialog1Injector = true; + e.eventDialog.unmatchdEventDialog2Injector = true; } // cvtdq2ps xmm0, xmm0 @@ -135,11 +135,11 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc2, true); } else { - e.unmatch.eventDialog2Injector = true; + e.eventDialog.unmatchdEventDialog2Injector = true; } break; default: - e.version.eventDialog2Injector = true; + e.eventDialog.versionEventDialog2Injector = true; } return e; @@ -163,7 +163,7 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc3, true); } else { - e.unmatch.eventDialog2Injector = true; + e.eventDialog.unmatchdEventDialog3Injector = true; } break; case v1_30_5_0: @@ -188,7 +188,7 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc3V130, true); } else { - e.unmatch.eventDialog2Injector = true; + e.eventDialog.unmatchdEventDialog3Injector = true; } break; case v1_32_0_1: @@ -204,11 +204,11 @@ namespace EventDialog { Injector::MakeJMP(address, eventDialogProc3V132, true); } else { - e.unmatch.eventDialog2Injector = true; + e.eventDialog.unmatchdEventDialog3Injector = true; } break; default: - e.version.eventDialog2Injector = true; + e.eventDialog.versionEventDialog3Injector = true; } return e; diff --git a/Plugin64/file_save.cpp b/Plugin64/file_save.cpp index b6d21fcd..48a68c6c 100644 --- a/Plugin64/file_save.cpp +++ b/Plugin64/file_save.cpp @@ -66,11 +66,11 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc1, true); } else { - e.unmatch.fileSaveProc1Injector = true; + e.fileSave.unmatchdFileSaveProc1Injector = true; } break; default: - e.version.fileSaveProc1Injector = true; + e.fileSave.versionFileSaveProc1Injector = true; } return e; @@ -132,11 +132,11 @@ namespace FileSave { Injector::MakeJMP(address + 0x14, fileSaveProc2, true); } else { - e.unmatch.fileSaveProc2Injector = true; + e.fileSave.unmatchdFileSaveProc2Injector = true; } break; default: - e.version.fileSaveProc2Injector = true; + e.fileSave.versionFileSaveProc2Injector = true; } return e; @@ -162,7 +162,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc3, true); } else { - e.unmatch.fileSaveProc3Injector = true; + e.fileSave.unmatchdFileSaveProc3Injector = true; } break; case v1_30_5_0: @@ -189,7 +189,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc3V130, true); } else { - e.unmatch.fileSaveProc3Injector = true; + e.fileSave.unmatchdFileSaveProc3Injector = true; } break; case v1_33_0_0: @@ -211,11 +211,11 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc3V1316, true); } else { - e.unmatch.fileSaveProc3Injector = true; + e.fileSave.unmatchdFileSaveProc3Injector = true; } break; default: - e.version.fileSaveProc3Injector = true; + e.fileSave.versionFileSaveProc3Injector = true; } return e; @@ -257,11 +257,11 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc4, true); } else { - e.unmatch.fileSaveProc4Injector = true; + e.fileSave.unmatchdFileSaveProc4Injector = true; } break; default: - e.version.fileSaveProc4Injector = true; + e.fileSave.versionFileSaveProc4Injector = true; } return e; @@ -291,7 +291,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc5, true); } else { - e.unmatch.fileSaveProc5Injector = true; + e.fileSave.unmatchdFileSaveProc5Injector = true; } break; case v1_30_5_0: @@ -320,7 +320,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc5V130, true); } else { - e.unmatch.fileSaveProc5Injector = true; + e.fileSave.unmatchdFileSaveProc5Injector = true; } break; case v1_33_0_0: @@ -342,11 +342,11 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc5V1316, true); } else { - e.unmatch.fileSaveProc5Injector = true; + e.fileSave.unmatchdFileSaveProc5Injector = true; } break; default: - e.version.fileSaveProc5Injector = true; + e.fileSave.versionFileSaveProc5Injector = true; } return e; @@ -374,7 +374,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc6, true); } else { - e.unmatch.fileSaveProc6Injector = true; + e.fileSave.unmatchdFileSaveProc6Injector = true; } break; case v1_30_5_0: @@ -406,11 +406,11 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc6V130, true); } else { - e.unmatch.fileSaveProc6Injector = true; + e.fileSave.unmatchdFileSaveProc6Injector = true; } break; default: - e.version.fileSaveProc6Injector = true; + e.fileSave.versionFileSaveProc6Injector = true; } return e; @@ -435,7 +435,7 @@ namespace FileSave { Injector::MakeJMP(address, fileSaveProc7, true); } else { - e.unmatch.fileSaveProc7Injector = true; + e.fileSave.unmatchdFileSaveProc7Injector = true; } break; case v1_30_5_0: @@ -464,7 +464,7 @@ namespace FileSave { address = BytePattern::temp_instance().get_second().address(); } else { - e.unmatch.fileSaveProc7Injector = true; + e.fileSave.unmatchdFileSaveProc7Injector = true; break; } @@ -477,7 +477,7 @@ namespace FileSave { break; default: - e.version.fileSaveProc7Injector = true; + e.fileSave.versionFileSaveProc7Injector = true; } return e; diff --git a/Plugin64/font.cpp b/Plugin64/font.cpp index f8308af3..86b384cc 100644 --- a/Plugin64/font.cpp +++ b/Plugin64/font.cpp @@ -43,11 +43,11 @@ namespace Font { Injector::WriteMemory(address + 3, 0xFF,true); } else { - e.unmatch.fontBufferHeapZeroClearInjector = true; + e.font.unmatchdCharCodePointLimiterPatchInjector = true; } break; default: - e.version.fontBufferHeapZeroClearInjector = true; + e.font.versionCharCodePointLimiterPatchInjector = true; } return e; @@ -89,11 +89,11 @@ namespace Font { Injector::MakeJMP(address, fontBufferHeapZeroClear, true); } else { - e.unmatch.fontBufferHeapZeroClearInjector = true; + e.font.unmatchdFontBufferHeapZeroClearInjector = true; } break; default: - e.version.fontBufferHeapZeroClearInjector = true; + e.font.unmatchdFontBufferHeapZeroClearInjector = true; } return e; @@ -127,11 +127,11 @@ namespace Font { Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { - e.unmatch.fontBufferClearInjector = true; + e.font.unmatchdFontBufferClear1Injector = true; } break; default: - e.version.fontBufferClearInjector = true; + e.font.versionFontBufferClear1Injector = true; } return e; @@ -165,11 +165,11 @@ namespace Font { Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { - e.unmatch.fontBufferClearInjector = true; + e.font.unmatchdFontBufferClear2Injector = true; } break; default: - e.version.fontBufferClearInjector = true; + e.font.versionFontBufferClear2Injector = true; } return e; @@ -202,11 +202,11 @@ namespace Font { // mov ecx, 3D88h Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x3), 0x10, true); } else { - e.unmatch.fontBufferExpansionInjector = true; + e.font.unmatchdFontBufferExpansionInjector = true; } break; default: - e.version.fontBufferExpansionInjector = true; + e.font.versionFontBufferExpansionInjector = true; } return e; @@ -239,11 +239,11 @@ namespace Font { // cmp r14d, 1000000h Injector::WriteMemory(BytePattern::temp_instance().get_first().address(0x6), 0x04, true); } else { - e.unmatch.fontSizeLimitInjector = true; + e.font.unmatchdFontSizeLimitInjector = true; } break; default: - e.version.fontSizeLimitInjector = true; + e.font.versionFontSizeLimitInjector = true; } return e; diff --git a/Plugin64/ime.cpp b/Plugin64/ime.cpp index 80d8b53b..966788d6 100644 --- a/Plugin64/ime.cpp +++ b/Plugin64/ime.cpp @@ -70,11 +70,11 @@ namespace Ime { Injector::MakeJMP(address, imeProc1, true); } else { - e.unmatch.imeProc1Injector = true; + e.ime.unmatchdImeProc1Injector = true; } break; default: - e.version.imeProc1Injector = true; + e.ime.versionImeProc1Injector = true; } return e; @@ -113,7 +113,7 @@ namespace Ime { imeProc2CallAddress = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.imeProc2Injector = true; + e.ime.unmatchdImeProc2Injector = true; } // WM_IME_STARTCOMPOSITIONでSDL_SetTextInputRectする @@ -130,7 +130,7 @@ namespace Ime { Injector::MakeJMP(address, imeProc2, true); } else { - e.unmatch.imeProc2Injector = true; + e.ime.unmatchdImeProc2Injector = true; } // WM_IME_SETCONTEXTで*lParam = 0;をコメントアウトする(nopで埋める) @@ -143,7 +143,7 @@ namespace Ime { Injector::WriteMemory(address+2, 0x90, true); } else { - e.unmatch.imeProc2Injector = true; + e.ime.unmatchdImeProc2Injector = true; } // WM_IME_COMPOSITIONのif文のIME_GetCompositionStringとIME_SendInputEventをコメントアウト(jmpさせる) @@ -158,11 +158,11 @@ namespace Ime { Injector::WriteMemory(address - 1, 0x49, true); } else { - e.unmatch.imeProc2Injector = true; + e.ime.unmatchdImeProc2Injector = true; } break; default: - e.version.imeProc2Injector = true; + e.ime.unmatchdImeProc2Injector = true; } return e; @@ -218,11 +218,11 @@ namespace Ime { Injector::MakeJMP(address, imeProc3, true); } else { - e.unmatch.imeProc3Injector = true; + e.ime.unmatchdImeProc3Injector = true; } break; default: - e.version.imeProc3Injector = true; + e.ime.versionImeProc3Injector = true; } return e; diff --git a/Plugin64/input.cpp b/Plugin64/input.cpp index 5ca9a4b8..bda989b5 100644 --- a/Plugin64/input.cpp +++ b/Plugin64/input.cpp @@ -34,7 +34,7 @@ namespace Input { Injector::MakeJMP(address, inputProc1, true); } else { - e.unmatch.inputProc1Injector = true; + e.input.unmatchdInputProc1Injector = true; } // call qword ptr [rax+18h] @@ -45,7 +45,7 @@ namespace Input { inputProc1ReturnAddress2 = Injector::GetBranchDestination(address + 0x3).as_int(); } else { - e.unmatch.inputProc1Injector = true; + e.input.unmatchdInputProc1Injector = true; } break; @@ -75,7 +75,7 @@ namespace Input { Injector::MakeJMP(address, inputProc1V130, true); } else { - e.unmatch.inputProc1Injector = true; + e.input.unmatchdInputProc1Injector = true; } // call qword ptr [rax+18h] @@ -86,12 +86,12 @@ namespace Input { inputProc1ReturnAddress2 = Injector::GetBranchDestination(address + 0x3).as_int(); } else { - e.unmatch.inputProc1Injector = true; + e.input.unmatchdInputProc1Injector = true; } break; default: - e.version.inputProc1Injector = true; + e.input.versionInputProc1Injector = true; } return e; @@ -127,11 +127,11 @@ namespace Input { Injector::MakeJMP(address, inputProc2, true); } else { - e.unmatch.inputProc2Injector = true; + e.input.unmatchdInputProc2Injector = true; } break; default: - e.version.inputProc2Injector = true; + e.input.versionInputProc2Injector = true; } return e; diff --git a/Plugin64/list_field_adjustment.cpp b/Plugin64/list_field_adjustment.cpp index 807583e1..264e4159 100644 --- a/Plugin64/list_field_adjustment.cpp +++ b/Plugin64/list_field_adjustment.cpp @@ -36,7 +36,7 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc1_v1315, true); } else { - e.unmatch.listFieldAdjustmentProc1Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc1Injector = true; } break; case v1_31_4_0: @@ -54,7 +54,7 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc1_v131, true); } else { - e.unmatch.listFieldAdjustmentProc1Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc1Injector = true; } break; case v1_29_2_0: @@ -76,11 +76,11 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc1, true); } else { - e.unmatch.listFieldAdjustmentProc1Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc1Injector = true; } break; default: - e.version.listFieldAdjustmentProc1Injector = true; + e.listFiledAdjustment.versionListFieldAdjustmentProc1Injector = true; } return e; @@ -109,7 +109,7 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc2_v1315, true); } else { - e.unmatch.listFieldAdjustmentProc2Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc2Injector = true; } break; case v1_31_4_0: @@ -127,7 +127,7 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc2_v131, true); } else { - e.unmatch.listFieldAdjustmentProc2Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc2Injector = true; } break; case v1_29_2_0: @@ -149,11 +149,11 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc2, true); } else { - e.unmatch.listFieldAdjustmentProc2Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc2Injector = true; } break; default: - e.version.listFieldAdjustmentProc2Injector = true; + e.listFiledAdjustment.versionListFieldAdjustmentProc2Injector = true; } return e; @@ -178,7 +178,7 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc3_v1315, true); } else { - e.unmatch.listFieldAdjustmentProc3Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc3Injector = true; } break; case v1_29_2_0: @@ -204,11 +204,11 @@ namespace ListFieldAdjustment { Injector::MakeJMP(address, listFieldAdjustmentProc3, true); } else { - e.unmatch.listFieldAdjustmentProc3Injector = true; + e.listFiledAdjustment.unmatchdListFieldAdjustmentProc3Injector = true; } break; default: - e.version.listFieldAdjustmentProc3Injector = true; + e.listFiledAdjustment.versionListFieldAdjustmentProc3Injector = true; } return e; diff --git a/Plugin64/localization.cpp b/Plugin64/localization.cpp index 9e557eb1..c829d079 100644 --- a/Plugin64/localization.cpp +++ b/Plugin64/localization.cpp @@ -61,11 +61,11 @@ namespace Localization { localizationProc1CallAddress1 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.localizationProc1Injector = true; + e.localization.unmatchdLocalizationProc1Injector = true; } break; default: - e.version.localizationProc1Injector = true; + e.localization.versionLocalizationProc1Injector = true; } return e; @@ -89,7 +89,7 @@ namespace Localization { Injector::MakeJMP(address, localizationProc2, true); } else { - e.unmatch.localizationProc2Injector = true; + e.localization.unmatchdLocalizationProc2Injector = true; } break; case v1_30_5_0: @@ -109,7 +109,7 @@ namespace Localization { Injector::MakeJMP(address, localizationProc2, true); } else { - e.unmatch.localizationProc2Injector = true; + e.localization.unmatchdLocalizationProc2Injector = true; } break; case v1_31_2_0: @@ -131,12 +131,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc2, true); } else { - e.unmatch.localizationProc2Injector = true; + e.localization.unmatchdLocalizationProc2Injector = true; } break; default: BytePattern::LoggingInfo(u8"Battle of areaを逆転させる [NG]"); - e.version.localizationProc2Injector = true; + e.localization.versionLocalizationProc2njector = true; } return e; @@ -161,7 +161,7 @@ namespace Localization { Injector::MakeJMP(address, localizationProc3, true); } else { - e.unmatch.localizationProc3Injector = true; + e.localization.unmatchdLocalizationProc3Injector = true; } break; case v1_33_0_0: @@ -199,12 +199,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc3V130, true); } else { - e.unmatch.localizationProc3Injector = true; + e.localization.unmatchdLocalizationProc3Injector = true; } break; default: BytePattern::LoggingInfo(u8"MDEATH_HEIR_SUCCEEDS heir nameを逆転させる [NG]"); - e.version.localizationProc3Injector = true; + e.localization.versionLocalizationProc3njector = true; } return e; @@ -231,7 +231,7 @@ namespace Localization { // Injector::MakeJMP(address, wordOrderProc4, true); } else { - e.unmatch.localizationProc4Injector = true; + e.localization.unmatchdLocalizationProc4Injector = true; } break; case v1_33_0_0: @@ -295,12 +295,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc4V130, true); } else { - e.unmatch.localizationProc4Injector = true; + e.localization.unmatchdLocalizationProc4Injector = true; } break; default: BytePattern::LoggingInfo(u8"MDEATH_REGENCY_RULE heir nameを逆転させる [NG]"); - e.version.localizationProc4Injector = true; + e.localization.versionLocalizationProc4Injector = true; } return e; @@ -346,7 +346,7 @@ namespace Localization { Injector::MakeJMP(address, localizationProc5V131, true); } else { - e.unmatch.localizationProc5Injector = true; + e.localization.unmatchdLocalizationProc5Injector = true; } break; @@ -379,11 +379,11 @@ namespace Localization { Injector::MakeJMP(address, localizationProc5, true); } else { - e.unmatch.localizationProc5Injector = true; + e.localization.unmatchdLocalizationProc5Injector = true; } break; default: - e.version.localizationProc5Injector = true; + e.localization.versionLocalizationProc5Injector = true; BytePattern::LoggingInfo(u8"nameを逆転させる [NG]"); } @@ -445,12 +445,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc6, true); } else { - e.unmatch.localizationProc6Injector = true; + e.localization.unmatchdLocalizationProc6Injector = true; } break; default: BytePattern::LoggingInfo(u8"M, Y → Y年M [NG]"); - e.version.localizationProc6Injector = true; + e.localization.versionLocalizationProc6Injector = true; } return e; @@ -500,12 +500,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc7, true); } else { - e.unmatch.localizationProc7Injector = true; + e.localization.unmatchdLocalizationProc7Injector = true; } break; default: BytePattern::LoggingInfo(u8"D M, Y → Y年MD日 [NG]"); - e.version.localizationProc7Injector = true; + e.localization.versionLocalizationProc7Injector = true; } return e; @@ -555,12 +555,12 @@ namespace Localization { Injector::MakeJMP(address, localizationProc8, true); } else { - e.unmatch.localizationProc8Injector = true; + e.localization.unmatchdLocalizationProc8Injector = true; } break; default: BytePattern::LoggingInfo(u8"M Y → Y年M [NG]"); - e.version.localizationProc8Injector = true; + e.localization.versionLocalizationProc8Injector = true; } return e; @@ -584,12 +584,12 @@ namespace Localization { Injector::WriteMemory(address+2, 0x20, true); } else { - e.unmatch.localizationProc9Injector = true; + e.localization.unmatchdLocalizationProc9Injector = true; } break; default: BytePattern::LoggingInfo(u8"Replace space [NG]"); - e.version.localizationProc9Injector = true; + e.localization.versionLocalizationProc9Injector = true; } return e; diff --git a/Plugin64/main_text.cpp b/Plugin64/main_text.cpp index 68155a72..608df8c0 100644 --- a/Plugin64/main_text.cpp +++ b/Plugin64/main_text.cpp @@ -48,11 +48,11 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc1, true); } else { - e.unmatch.mainTextProc1Injector = true; + e.mainText.unmatchdMainTextProc1Injector = true; } break; default: - e.version.mainTextProc1Injector = true; + e.mainText.versionMainTextProc11njector = true; } return e; @@ -84,7 +84,7 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc2_v131, true); } else { - e.unmatch.mainTextProc2Injector = true; + e.mainText.unmatchdMainTextProc2Injector = true; } break; case v1_29_1_0: @@ -110,11 +110,11 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc2, true); } else { - e.unmatch.mainTextProc2Injector = true; + e.mainText.unmatchdMainTextProc2Injector = true; } break; default: - e.version.mainTextProc2Injector = true; + e.mainText.versionMainTextProc2Injector = true; } return e; @@ -132,7 +132,7 @@ namespace MainText { mainTextProc3ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.mainTextProc3Injector2 = true; + e.mainText.unmatchdMainTextProc3Injector = true; } // cmp word ptr [rcx+6],0 @@ -146,7 +146,7 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc3, true); } else { - e.unmatch.mainTextProc3Injector = true; + e.mainText.unmatchdMainTextProc3Injector = true; } break; @@ -162,7 +162,7 @@ namespace MainText { mainTextProc3ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.mainTextProc3Injector2 = true; + e.mainText.unmatchdMainTextProc3Injector = true; } // cmp word ptr [rcx+6],0 @@ -176,7 +176,7 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc3, true); } else { - e.unmatch.mainTextProc3Injector = true; + e.mainText.unmatchdMainTextProc3Injector = true; } break; case v1_29_1_0: @@ -194,7 +194,7 @@ namespace MainText { mainTextProc3ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.mainTextProc3Injector2 = true; + e.mainText.unmatchdMainTextProc3Injector = true; } // cmp word ptr [rcx+6],0 @@ -208,11 +208,11 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc3, true); } else { - e.unmatch.mainTextProc3Injector = true; + e.mainText.unmatchdMainTextProc3Injector = true; } break; default: - e.version.mainTextProc3Injector = true; + e.mainText.versionMainTextProc3Injector = true; } return e; @@ -250,11 +250,11 @@ namespace MainText { Injector::MakeJMP(address, mainTextProc4, true); } else { - e.unmatch.mainTextProc4Injector = true; + e.mainText.unmatchdMainTextProc4Injector = true; } break; default: - e.version.mainTextProc4Injector = true; + e.mainText.versionMainTextProc4Injector = true; } return e; diff --git a/Plugin64/map_adjustment.cpp b/Plugin64/map_adjustment.cpp index 55001589..b0cd6888 100644 --- a/Plugin64/map_adjustment.cpp +++ b/Plugin64/map_adjustment.cpp @@ -46,7 +46,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc1, true); } else { - e.unmatch.mapAdjustmentProc1Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc1Injector = true; } break; case v1_30_5_0: @@ -76,11 +76,11 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc1, true); } else { - e.unmatch.mapAdjustmentProc1Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc1Injector = true; } break; default: - e.version.mapAdjustmentProc1Injector = true; + e.mapAdjustment.versionMapAdjustmentProc1Injector = true; } return e; @@ -105,7 +105,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc2, true); } else { - e.unmatch.mapAdjustmentProc2Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc2Injector = true; } break; case v1_30_5_0: @@ -130,7 +130,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc2V130, true); } else { - e.unmatch.mapAdjustmentProc2Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc2Injector = true; } break; case v1_32_0_1: @@ -147,11 +147,11 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc2V130, true); } else { - e.unmatch.mapAdjustmentProc2Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc2Injector = true; } break; default: - e.version.mapAdjustmentProc2Injector = true; + e.mapAdjustment.versionMapAdjustmentProc2Injector = true; } return e; @@ -176,7 +176,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc3, true); } else { - e.unmatch.mapAdjustmentProc3Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc3Injector = true; } // mov rcx, [r12+30h] @@ -185,7 +185,7 @@ namespace MapAdjustment { mapAdjustmentProc3ReturnAddress2 = BytePattern::temp_instance().get_second().address(); } else { - e.unmatch.mapAdjustmentProc3Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc3Injector = true; } break; case v1_30_5_0: @@ -212,7 +212,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc3V130, true); } else { - e.unmatch.mapAdjustmentProc3Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc3Injector = true; } // mov rcx, [r12+30h] @@ -221,11 +221,11 @@ namespace MapAdjustment { mapAdjustmentProc3ReturnAddress2 = BytePattern::temp_instance().get_second().address(); } else { - e.unmatch.mapAdjustmentProc3Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc3Injector = true; } break; default: - e.version.mapAdjustmentProc3Injector = true; + e.mapAdjustment.versionMapAdjustmentProc3Injector = true; } return e; @@ -250,7 +250,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc4, true); } else { - e.unmatch.mapAdjustmentProc4Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc4Injector = true; } break; case v1_30_5_0: @@ -277,11 +277,11 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc4V130, true); } else { - e.unmatch.mapAdjustmentProc4Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc4Injector = true; } break; default: - e.version.mapAdjustmentProc4Injector = true; + e.mapAdjustment.versionMapAdjustmentProc4Injector = true; } return e; @@ -330,7 +330,7 @@ namespace MapAdjustment { Injector::MakeJMP(address, mapAdjustmentProc5, true); } else { - e.unmatch.mapAdjustmentProc5Injector = true; + e.mapAdjustment.unmatchdMapAdjustmentProc5Injector = true; } break; case v1_32_0_1: @@ -339,7 +339,7 @@ namespace MapAdjustment { break; default: - e.version.mapAdjustmentProc5Injector = true; + e.mapAdjustment.versionMapAdjustmentProc5Injector = true; } return e; diff --git a/Plugin64/map_justify.cpp b/Plugin64/map_justify.cpp index 6200541e..1d5d021a 100644 --- a/Plugin64/map_justify.cpp +++ b/Plugin64/map_justify.cpp @@ -39,7 +39,7 @@ namespace MapJustify { mapJustifyProc1ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.mapJustifyProc1Injector = true; + e.mapJustify.unmatchdMapJustifyProc1Injector = true; } // movzx esi, byte ptr [rax+r13] @@ -53,11 +53,11 @@ namespace MapJustify { Injector::MakeJMP(address, mapJustifyProc1, true); } else { - e.unmatch.mapJustifyProc1Injector = true; + e.mapJustify.unmatchdMapJustifyProc1Injector = true; } break; default: - e.version.mapJustifyProc1Injector = true; + e.mapJustify.versionMapJustifyProc1Injector = true; } return e; @@ -95,11 +95,11 @@ namespace MapJustify { Injector::MakeJMP(address, mapJustifyProc2, true); } else { - e.unmatch.mapJustifyProc2Injector = true; + e.mapJustify.unmatchdMapJustifyProc2Injector = true; } break; default: - e.version.mapJustifyProc2Injector = true; + e.mapJustify.versionMapJustifyProc2Injector = true; } return e; @@ -137,11 +137,11 @@ namespace MapJustify { Injector::MakeJMP(address, mapJustifyProc4, true); } else { - e.unmatch.mapJustifyProc4Injector = true; + e.mapJustify.unmatchdMapJustifyProc4Injector = true; } break; default: - e.version.mapJustifyProc4Injector = true; + e.mapJustify.versionMapJustifyProc4Injector = true; } return e; diff --git a/Plugin64/map_nudge_view.cpp b/Plugin64/map_nudge_view.cpp index c915b629..c7a32fef 100644 --- a/Plugin64/map_nudge_view.cpp +++ b/Plugin64/map_nudge_view.cpp @@ -26,7 +26,7 @@ namespace MapNudgeView { Injector::MakeJMP(address, mapNudgeViewProc1, true); } else { - e.unmatch.mapNudgeViewProc1Injector = true; + e.mapNudge.unmatchdMapNudgeViewProc1Injector = true; } break; case v1_30_5_0: @@ -53,11 +53,11 @@ namespace MapNudgeView { Injector::MakeJMP(address, mapNudgeViewProc1V130, true); } else { - e.unmatch.mapNudgeViewProc1Injector = true; + e.mapNudge.unmatchdMapNudgeViewProc1Injector = true; } break; default: - e.version.mapNudgeViewProc1Injector = true; + e.mapNudge.versionMapNudgeViewProc1Injector = true; } return e; diff --git a/Plugin64/map_popup.cpp b/Plugin64/map_popup.cpp index 7fb9301e..4d52cacc 100644 --- a/Plugin64/map_popup.cpp +++ b/Plugin64/map_popup.cpp @@ -48,11 +48,11 @@ namespace MapPopup { mapPopupProc1ReturnAddress = address + 19; } else { - e.unmatch.mapPopupProc1Injector = true; + e.mapPopup.unmatchdMapPopupProc1Injector = true; } break; default: - e.version.mapPopupProc1Injector = true; + e.mapPopup.versionMapPopupProc1Injector = true; } return e; @@ -76,7 +76,7 @@ namespace MapPopup { mapPopupProc2ReturnAddress = address + 15; } else { - e.unmatch.mapPopupProc2Injector = true; + e.mapPopup.unmatchdMapPopupProc2Injector = true; } break; case v1_30_1_0: @@ -103,11 +103,11 @@ namespace MapPopup { mapPopupProc2ReturnAddress = address + 15; } else { - e.unmatch.mapPopupProc2Injector = true; + e.mapPopup.unmatchdMapPopupProc2Injector = true; } break; default: - e.version.mapPopupProc2Injector = true; + e.mapPopup.versionMapPopupProc2Injector = true; } return e; @@ -131,7 +131,7 @@ namespace MapPopup { mapPopupProc3ReturnAddress = address + 0x13; } else { - e.unmatch.mapPopupProc3Injector = true; + e.mapPopup.unmatchdMapPopupProc3Injector = true; } break; case v1_30_1_0: @@ -158,11 +158,11 @@ namespace MapPopup { mapPopupProc3ReturnAddress = address + 0x13; } else { - e.unmatch.mapPopupProc3Injector = true; + e.mapPopup.unmatchdMapPopupProc3Injector = true; } break; default: - e.version.mapPopupProc3Injector = true; + e.mapPopup.versionMapPopupProc3Injector = true; } return e; diff --git a/Plugin64/map_view.cpp b/Plugin64/map_view.cpp index b1674239..f971f7c1 100644 --- a/Plugin64/map_view.cpp +++ b/Plugin64/map_view.cpp @@ -45,11 +45,11 @@ namespace MapView { Injector::MakeJMP(address, mapViewProc1, true); } else { - e.unmatch.mapViewProc1Injector = true; + e.mapView.unmatchdMapViewProc1Injector = true; } break; default: - e.version.mapViewProc1Injector = true; + e.mapView.versionMapViewProc1Injector = true; } return e; @@ -74,7 +74,7 @@ namespace MapView { Injector::MakeJMP(address, mapViewProc2, true); } else { - e.unmatch.mapViewProc2Injector = true; + e.mapView.unmatchdMapViewProc2Injector = true; } break; case v1_30_5_0: @@ -101,11 +101,11 @@ namespace MapView { Injector::MakeJMP(address, mapViewProc2V130, true); } else { - e.unmatch.mapViewProc2Injector = true; + e.mapView.unmatchdMapViewProc2Injector = true; } break; default: - e.version.mapViewProc2Injector = true; + e.mapView.versionMapViewProc2Injector = true; } return e; @@ -146,11 +146,11 @@ namespace MapView { Injector::MakeJMP(address, mapViewProc3, true); } else { - e.unmatch.mapViewProc3Injector = true; + e.mapView.unmatchdMapViewProc3Injector = true; } break; default: - e.version.mapViewProc3Injector = true; + e.mapView.versionMapViewProc3Injector = true; } return e; diff --git a/Plugin64/plugin_64.h b/Plugin64/plugin_64.h index 0d2c770f..e9b97343 100644 --- a/Plugin64/plugin_64.h +++ b/Plugin64/plugin_64.h @@ -2,7 +2,8 @@ #include "pch.h" enum Eu4Version { - UNKNOWN = 0, + UNDEFINED = 0, + UNKNOWN = 1, v1_29_0_0 = 1290, v1_29_1_0 = 1291, v1_29_2_0 = 1292, @@ -27,7 +28,7 @@ typedef UINT64 DllErrorCode; struct DllError{ union { - DllErrorCode code0; + DllErrorCode code; struct { bool timeout : 1; bool waitFailed : 1; @@ -36,139 +37,297 @@ struct DllError{ } mod; union { - DllErrorCode code1; + DllErrorCode code; struct { - bool fontBufferExpansionInjector : 1; - bool fontSizeLimitInjector : 1; - bool fontBufferHeapZeroClearInjector : 1; - bool debugProc1Injector : 1; - bool fontBufferClearInjector : 1; - bool mainTextProc1Injector : 1; - bool mainTextProc2Injector : 1; - bool mainTextProc3Injector : 1; - bool mainTextProc4Injector : 1; - bool tooltipAndButtonProc1Injector : 1; - bool tooltipAndButtonProc2Injector : 1; - bool tooltipAndButtonProc3Injector : 1; - bool tooltipAndButtonProc4Injector : 1; - bool tooltipAndButtonProc5Injector : 1; - bool mapViewProc1Injector : 1; - bool mapViewProc2Injector : 1; - bool mapViewProc3Injector : 1; - bool mapViewProc4Injector : 1; - bool mapAdjustmentProc1Injector : 1; - bool mapAdjustmentProc2Injector : 1; - bool mapAdjustmentProc3Injector : 1; - bool mapAdjustmentProc4Injector : 1; - bool mapAdjustmentProc5Injector : 1; - bool mapJustifyProc1Injector : 1; - bool mapJustifyProc2Injector : 1; - bool mapJustifyProc3Injector : 1; - bool mapJustifyProc4Injector : 1; - bool eventDialog1Injector : 1; - bool eventDialog2Injector : 1; - bool mapPopupProc1Injector : 1; - bool mapPopupProc2Injector : 1; - bool mapPopupProc3Injector : 1; - bool listFieldAdjustmentProc1Injector : 1; - bool listFieldAdjustmentProc2Injector : 1; - bool listFieldAdjustmentProc3Injector : 1; - bool fileSaveProc1Injector : 1; - bool fileSaveProc2Injector : 1; - bool fileSaveProc3Injector : 1; - bool fileSaveProc4Injector : 1; - bool fileSaveProc5Injector : 1; - bool fileSaveProc6Injector : 1; - bool fileSaveProc7Injector : 1; - bool dateProc1Injector : 1; - bool mapNudgeViewProc1Injector : 1; - bool imeProc1Injector : 1; - bool imeProc2Injector : 1; - bool imeProc3Injector : 1; - bool inputProc1Injector : 1; - bool inputProc2Injector : 1; - bool localizationProc1Injector : 1; - bool localizationProc2Injector : 1; - bool localizationProc3Injector : 1; - bool localizationProc4Injector : 1; - bool localizationProc5Injector : 1; - bool localizationProc6Injector : 1; - bool localizationProc7Injector : 1; - bool localizationProc8Injector : 1; - bool localizationProc9Injector : 1; + bool unmatchdDateProc1Injector : 1; + bool versionDateProc1Injector : 1; }; - } version; + } date; union { - DllErrorCode code2; + DllErrorCode code; struct { - bool fontBufferExpansionInjector : 1; - bool fontSizeLimitInjector : 1; - bool fontBufferHeapZeroClearInjector : 1; - bool debugProc1Injector : 1; - bool fontBufferClearInjector : 1; - bool mainTextProc1Injector : 1; - bool mainTextProc2Injector : 1; - bool mainTextProc3Injector : 1; - bool mainTextProc3Injector2 : 1; - bool mainTextProc4Injector : 1; - bool tooltipAndButtonProc1Injector : 1; - bool tooltipAndButtonProc2Injector : 1; - bool tooltipAndButtonProc3Injector : 1; - bool tooltipAndButtonProc4Injector : 1; - bool tooltipAndButtonProc5Injector : 1; - bool mapViewProc1Injector : 1; - bool mapViewProc2Injector : 1; - bool mapViewProc3Injector : 1; - bool mapViewProc4Injector : 1; - bool mapAdjustmentProc1Injector : 1; - bool mapAdjustmentProc2Injector : 1; - bool mapAdjustmentProc3Injector : 1; - bool mapAdjustmentProc4Injector : 1; - bool mapAdjustmentProc5Injector : 1; - bool mapJustifyProc1Injector : 1; - bool mapJustifyProc2Injector : 1; - bool mapJustifyProc3Injector : 1; - bool mapJustifyProc4Injector : 1; - bool eventDialog1Injector : 1; - bool eventDialog2Injector : 1; - bool mapPopupProc1Injector : 1; - bool mapPopupProc2Injector : 1; - bool mapPopupProc3Injector : 1; - bool listFieldAdjustmentProc1Injector : 1; - bool listFieldAdjustmentProc2Injector : 1; - bool listFieldAdjustmentProc3Injector : 1; - bool fileSaveProc1Injector : 1; - bool fileSaveProc2Injector : 1; - bool fileSaveProc3Injector : 1; - bool fileSaveProc4Injector : 1; - bool fileSaveProc5Injector : 1; - bool fileSaveProc6Injector : 1; - bool fileSaveProc7Injector : 1; - bool dateProc1Injector : 1; - bool mapNudgeViewProc1Injector : 1; - bool imeProc1Injector : 1; - bool imeProc2Injector : 1; - bool imeProc3Injector : 1; - bool inputProc1Injector : 1; - bool inputProc2Injector : 1; - bool localizationProc1Injector : 1; - bool localizationProc2Injector : 1; - bool localizationProc3Injector : 1; - bool localizationProc4Injector : 1; - bool localizationProc5Injector : 1; - bool localizationProc6Injector : 1; - bool localizationProc7Injector : 1; - bool localizationProc8Injector : 1; - bool localizationProc9Injector : 1; + bool unmatchdEventDialog1Injector : 1; + bool versionEventDialog1Injector : 1; + bool unmatchdEventDialog2Injector : 1; + bool versionEventDialog2Injector : 1; + bool unmatchdEventDialog3Injector : 1; + bool versionEventDialog3Injector : 1; }; - } unmatch; + } eventDialog; + + union { + DllErrorCode code; + struct { + bool unmatchdFileSaveProc1Injector : 1; + bool versionFileSaveProc1Injector : 1; + bool unmatchdFileSaveProc2Injector : 1; + bool versionFileSaveProc2Injector : 1; + bool unmatchdFileSaveProc3Injector : 1; + bool versionFileSaveProc3Injector : 1; + bool unmatchdFileSaveProc4Injector : 1; + bool versionFileSaveProc4Injector : 1; + bool unmatchdFileSaveProc5Injector : 1; + bool versionFileSaveProc5Injector : 1; + bool unmatchdFileSaveProc6Injector : 1; + bool versionFileSaveProc6Injector : 1; + bool unmatchdFileSaveProc7Injector : 1; + bool versionFileSaveProc7Injector : 1; + }; + } fileSave; + + union { + DllErrorCode code; + struct { + bool unmatchdCharCodePointLimiterPatchInjector : 1; + bool versionCharCodePointLimiterPatchInjector : 1; + bool unmatchdFontBufferHeapZeroClearInjector : 1; + bool versionFontBufferHeapZeroClearInjector : 1; + bool unmatchdFontBufferClear1Injector : 1; + bool versionFontBufferClear1Injector : 1; + bool unmatchdFontBufferClear2Injector : 1; + bool versionFontBufferClear2Injector : 1; + bool unmatchdFontBufferExpansionInjector : 1; + bool versionFontBufferExpansionInjector : 1; + bool unmatchdFontSizeLimitInjector : 1; + bool versionFontSizeLimitInjector : 1; + }; + } font; + + union { + DllErrorCode code; + struct { + bool unmatchdImeProc1Injector : 1; + bool versionImeProc1Injector : 1; + bool unmatchdImeProc2Injector : 1; + bool versionImeProc2Injector : 1; + bool unmatchdImeProc3Injector : 1; + bool versionImeProc3Injector : 1; + }; + } ime; + + union { + DllErrorCode code; + struct { + bool unmatchdInputProc1Injector : 1; + bool versionInputProc1Injector : 1; + bool unmatchdInputProc2Injector : 1; + bool versionInputProc2Injector : 1; + }; + } input; + + union { + DllErrorCode code; + struct { + bool unmatchdListFieldAdjustmentProc1Injector : 1; + bool versionListFieldAdjustmentProc1Injector : 1; + bool unmatchdListFieldAdjustmentProc2Injector : 1; + bool versionListFieldAdjustmentProc2Injector : 1; + bool unmatchdListFieldAdjustmentProc3Injector : 1; + bool versionListFieldAdjustmentProc3Injector : 1; + }; + } listFiledAdjustment; + + union { + DllErrorCode code; + struct { + bool unmatchdLocalizationProc1Injector : 1; + bool versionLocalizationProc1Injector : 1; + bool unmatchdLocalizationProc2Injector : 1; + bool versionLocalizationProc2njector : 1; + bool unmatchdLocalizationProc3Injector : 1; + bool versionLocalizationProc3njector : 1; + bool unmatchdLocalizationProc4Injector : 1; + bool versionLocalizationProc4Injector : 1; + bool unmatchdLocalizationProc5Injector : 1; + bool versionLocalizationProc5Injector : 1; + bool unmatchdLocalizationProc6Injector : 1; + bool versionLocalizationProc6Injector : 1; + bool unmatchdLocalizationProc7Injector : 1; + bool versionLocalizationProc7Injector : 1; + bool unmatchdLocalizationProc8Injector : 1; + bool versionLocalizationProc8Injector : 1; + bool unmatchdLocalizationProc9Injector : 1; + bool versionLocalizationProc9Injector : 1; + }; + } localization; + + union { + DllErrorCode code; + struct { + bool unmatchdMainTextProc1Injector : 1; + bool versionMainTextProc11njector : 1; + bool unmatchdMainTextProc2Injector : 1; + bool versionMainTextProc2Injector : 1; + bool unmatchdMainTextProc3Injector : 1; + bool versionMainTextProc3Injector : 1; + bool unmatchdMainTextProc4Injector : 1; + bool versionMainTextProc4Injector : 1; + }; + } mainText; + + union { + DllErrorCode code; + struct { + bool unmatchdMapAdjustmentProc1Injector : 1; + bool versionMapAdjustmentProc1Injector : 1; + bool unmatchdMapAdjustmentProc2Injector : 1; + bool versionMapAdjustmentProc2Injector : 1; + bool unmatchdMapAdjustmentProc3Injector : 1; + bool versionMapAdjustmentProc3Injector : 1; + bool unmatchdMapAdjustmentProc4Injector : 1; + bool versionMapAdjustmentProc4Injector : 1; + bool unmatchdMapAdjustmentProc5Injector : 1; + bool versionMapAdjustmentProc5Injector : 1; + }; + } mapAdjustment; + + union { + DllErrorCode code; + struct { + bool unmatchdMapJustifyProc1Injector : 1; + bool versionMapJustifyProc1Injector : 1; + bool unmatchdMapJustifyProc2Injector : 1; + bool versionMapJustifyProc2Injector : 1; + bool unmatchdMapJustifyProc3Injector : 1; + bool versionMapJustifyProc3Injector : 1; + bool unmatchdMapJustifyProc4Injector : 1; + bool versionMapJustifyProc4Injector : 1; + }; + } mapJustify; + + union { + DllErrorCode code; + struct { + bool unmatchdMapNudgeViewProc1Injector : 1; + bool versionMapNudgeViewProc1Injector : 1; + }; + } mapNudge; + + union { + DllErrorCode code; + struct { + bool unmatchdMapPopupProc1Injector : 1; + bool versionMapPopupProc1Injector : 1; + bool unmatchdMapPopupProc2Injector : 1; + bool versionMapPopupProc2Injector : 1; + bool unmatchdMapPopupProc3Injector : 1; + bool versionMapPopupProc3Injector : 1; + }; + } mapPopup; + + union { + DllErrorCode code; + struct { + bool unmatchdMapViewProc1Injector : 1; + bool versionMapViewProc1Injector : 1; + bool unmatchdMapViewProc2Injector : 1; + bool versionMapViewProc2Injector : 1; + bool unmatchdMapViewProc3Injector : 1; + bool versionMapViewProc3Injector : 1; + }; + } mapView; + + union { + DllErrorCode code; + struct { + bool unmatchdDebugProc1Injector : 1; + bool versionDebugProc1Injector : 1; + }; + } debug; + + union { + DllErrorCode code; + struct { + bool unmatchdTooltipAndButtonProc1Injector : 1; + bool versionTooltipAndButtonProc1Injector : 1; + bool unmatchdTooltipAndButtonProc2Injector : 1; + bool versionTooltipAndButtonProc2Injector : 1; + bool unmatchdTooltipAndButtonProc3Injector : 1; + bool versionTooltipAndButtonProc3Injector : 1; + bool unmatchdTooltipAndButtonProc4Injector : 1; + bool versionTooltipAndButtonProc4Injector : 1; + bool unmatchdTooltipAndButtonProc5Injector : 1; + bool versionTooltipAndButtonProc5Injector : 1; + bool unmatchdTooltipAndButtonProc6Injector : 1; + bool versionTooltipAndButtonProc6Injector : 1; + bool unmatchdTooltipAndButtonProc7Injector : 1; + bool versionTooltipAndButtonProc7Injector : 1; + }; + } tooltipAndButton; void operator |= (DllError e) { - this->mod.code0 |= e.mod.code0; - this->version.code1 |= e.version.code1; - this->unmatch.code2 |= e.unmatch.code2; + this->mod.code |= e.mod.code; + this->date.code |= e.date.code; + this->eventDialog.code |= e.eventDialog.code; + this->fileSave.code |= e.fileSave.code; + this->font.code |= e.font.code; + this->ime.code |= e.ime.code; + this->input.code |= e.input.code; + this->listFiledAdjustment.code |= e.listFiledAdjustment.code; + this->localization.code |= e.localization.code; + this->mainText.code |= e.mainText.code; + this->mapAdjustment.code |= e.mapAdjustment.code; + this->mapJustify.code |= e.mapJustify.code; + this->mapNudge.code |= e.mapNudge.code; + this->mapPopup.code |= e.mapPopup.code; + this->mapView.code |= e.mapView.code; + this->tooltipAndButton.code |= e.tooltipAndButton.code; + this->debug.code |= e.debug.code; + } + + bool errorCheck() { + return this->mod.code > 0 + || this->date.code > 0 + || this->eventDialog.code > 0 + || this->fileSave.code > 0 + || this->font.code > 0 + || this->ime.code > 0 + || this->input.code > 0 + || this->listFiledAdjustment.code > 0 + || this->localization.code > 0 + || this->mainText.code > 0 + || this->mapAdjustment.code > 0 + || this->mapJustify.code > 0 + || this->mapNudge.code > 0 + || this->mapPopup.code > 0 + || this->mapView.code > 0 + || this->tooltipAndButton.code > 0 + || this->debug.code > 0; + } + + std::string print() { + return format(u8"mod=%llx,date=%llx,eventDialog=%llx,fileSave=%llx," + "font=%llx,ime=%llx,input=%llx,listFiledAdjustment=%llx,localization=%llx" + "mainText=%llx,mapAdjustment=%llx,mapJustify=%llx,mapNudge=%llx,mapPopup=%llx" + "mapPopup=%llx,mapView=%llx,tooltipAndButton=%llx,debug=%llx", + this->mod.code, + this->date.code, + this->eventDialog.code, + this->fileSave.code, + this->font.code, + this->ime.code, + this->input.code, + this->listFiledAdjustment.code, + this->localization.code, + this->mainText.code, + this->mapAdjustment.code, + this->mapJustify.code, + this->mapNudge.code, + this->mapPopup.code, + this->mapView.code, + this->tooltipAndButton.code, + this->debug.code); + } + + template + std::string format(const std::string& fmt, Args ... args) + { + size_t len = std::snprintf(nullptr, 0, fmt.c_str(), args ...); + std::vector buf(len + 1); + std::snprintf(&buf[0], len + 1, fmt.c_str(), args ...); + return std::string(&buf[0], &buf[0] + len); } }; diff --git a/Plugin64/tooltip_and_button.cpp b/Plugin64/tooltip_and_button.cpp index a94c956a..6a9ec2f9 100644 --- a/Plugin64/tooltip_and_button.cpp +++ b/Plugin64/tooltip_and_button.cpp @@ -9,7 +9,7 @@ namespace TooltipAndButton { void tooltipAndButtonProc4(); void tooltipAndButtonProc5(); void tooltipAndButtonProc5V130(); - void tooltipAndButtonProcTest(); + void tooltipAndButtonProc7(); uintptr_t tooltipAndButtonProc1ReturnAddress; uintptr_t tooltipAndButtonProc1CallAddress; uintptr_t tooltipAndButtonProc2ReturnAddress; @@ -18,9 +18,8 @@ namespace TooltipAndButton { uintptr_t tooltipAndButtonProc4ReturnAddress2; uintptr_t tooltipAndButtonProc5ReturnAddress1; uintptr_t tooltipAndButtonProc5ReturnAddress2; - - uintptr_t tooltipAndButtonProcTestReturnAddress1; - uintptr_t tooltipAndButtonProcTestReturnAddress2; + uintptr_t tooltipAndButtonProc7ReturnAddress1; + uintptr_t tooltipAndButtonProc7ReturnAddress2; } DllError tooltipAndButtonProc1Injector(RunOptions options) { @@ -58,11 +57,11 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc1, true); } else { - e.unmatch.tooltipAndButtonProc1Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc1Injector = true; } break; default: - e.version.tooltipAndButtonProc1Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc1Injector = true; } return e; @@ -100,11 +99,11 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc2, true); } else { - e.unmatch.tooltipAndButtonProc2Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc2Injector = true; } break; default: - e.version.tooltipAndButtonProc2Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc2Injector = true; } return e; @@ -142,11 +141,11 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc3, true); } else { - e.unmatch.tooltipAndButtonProc3Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc3Injector = true; } break; default: - e.version.tooltipAndButtonProc3Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc3Injector = true; } return e; @@ -185,7 +184,7 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc4, true); } else { - e.unmatch.tooltipAndButtonProc4Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc4Injector = true; } break; case v1_33_0_0: @@ -204,11 +203,11 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc4, true); } else { - e.unmatch.tooltipAndButtonProc4Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc4Injector = true; } break; default: - e.version.tooltipAndButtonProc4Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc4Injector = true; } return e; @@ -229,7 +228,7 @@ namespace TooltipAndButton { tooltipAndButtonProc5ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } // movzx edx, byte ptr [rbx+r14] @@ -243,7 +242,7 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc5, true); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } break; case v1_30_5_0: @@ -257,7 +256,7 @@ namespace TooltipAndButton { tooltipAndButtonProc5ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } // movzx edx, byte ptr [rbx+r14] @@ -271,7 +270,7 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc5V130, true); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } break; case v1_31_1_0: @@ -288,7 +287,7 @@ namespace TooltipAndButton { tooltipAndButtonProc5ReturnAddress2 = BytePattern::temp_instance().get_first().address(); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } // movzx edx, byte ptr [rbx+r14] @@ -302,18 +301,41 @@ namespace TooltipAndButton { Injector::MakeJMP(address, tooltipAndButtonProc5V130, true); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc5Injector = true; } break; default: - e.version.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc5Injector = true; } return e; } + DllError tooltipAndButtonProc6Injector(RunOptions options) { + DllError e = {}; + + switch (options.version) { + case v1_33_0_0: + case v1_32_0_1: + case v1_31_6_0: + case v1_31_5_0: + // inc edx + BytePattern::temp_instance().find_pattern("A7 52 2D 20 00 00 00 00"); + if (BytePattern::temp_instance().has_size(1, u8"空白をノーブレークスペースに変換")) { + Injector::WriteMemory(BytePattern::temp_instance().get_first().address() + 3, 0xA0, true); + } + else { + e.tooltipAndButton.unmatchdTooltipAndButtonProc6Injector = true; + } + break; + default: + e.tooltipAndButton.versionTooltipAndButtonProc6Injector = true; + } + + return e; + } - DllError tooltipAndButtonProcTestInjector(RunOptions options) { + DllError tooltipAndButtonProc7Injector(RunOptions options) { DllError e = {}; switch (options.version) { @@ -325,15 +347,15 @@ namespace TooltipAndButton { uintptr_t address = BytePattern::temp_instance().get_first().address(); // jmp loc_xxxxx - tooltipAndButtonProcTestReturnAddress1 = Injector::GetBranchDestination(address + 0x7).as_int(); + tooltipAndButtonProc7ReturnAddress1 = Injector::GetBranchDestination(address + 0x7).as_int(); // mov edi, dword ptr [rbp+6E0h+38h] - tooltipAndButtonProcTestReturnAddress2 = address + 0x24; + tooltipAndButtonProc7ReturnAddress2 = address + 0x24; - Injector::MakeJMP(address, tooltipAndButtonProcTest, true); + Injector::MakeJMP(address, tooltipAndButtonProc7, true); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc7Injector = true; } break; case v1_29_1_0: @@ -356,41 +378,17 @@ namespace TooltipAndButton { if (BytePattern::temp_instance().has_size(1, u8"カウントアップ")) { uintptr_t address = BytePattern::temp_instance().get_first().address(); - tooltipAndButtonProcTestReturnAddress1 = Injector::GetBranchDestination(address + 0x7).as_int(); - tooltipAndButtonProcTestReturnAddress2 = address + 0x24; + tooltipAndButtonProc7ReturnAddress1 = Injector::GetBranchDestination(address + 0x7).as_int(); + tooltipAndButtonProc7ReturnAddress2 = address + 0x24; - Injector::MakeJMP(address, tooltipAndButtonProcTest, true); - } - else { - e.unmatch.tooltipAndButtonProc5Injector = true; - } - break; - default: - e.version.tooltipAndButtonProc5Injector = true; - } - - return e; - } - - DllError tooltipAndButtonProc6Injector(RunOptions options) { - DllError e = {}; - - switch (options.version) { - case v1_33_0_0: - case v1_32_0_1: - case v1_31_6_0: - case v1_31_5_0: - // inc edx - BytePattern::temp_instance().find_pattern("A7 52 2D 20 00 00 00 00"); - if (BytePattern::temp_instance().has_size(1, u8"空白をノーブレークスペースに変換")) { - Injector::WriteMemory(BytePattern::temp_instance().get_first().address() + 3, 0xA0, true); + Injector::MakeJMP(address, tooltipAndButtonProc7, true); } else { - e.unmatch.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.unmatchdTooltipAndButtonProc7Injector = true; } break; default: - e.version.tooltipAndButtonProc5Injector = true; + e.tooltipAndButton.versionTooltipAndButtonProc7Injector = true; } return e; @@ -401,11 +399,11 @@ namespace TooltipAndButton { result |= tooltipAndButtonProc1Injector(options); result |= tooltipAndButtonProc2Injector(options); - result |= tooltipAndButtonProcTestInjector(options); result |= tooltipAndButtonProc3Injector(options); result |= tooltipAndButtonProc4Injector(options); result |= tooltipAndButtonProc5Injector(options); result |= tooltipAndButtonProc6Injector(options); + result |= tooltipAndButtonProc7Injector(options); return result; } diff --git a/Plugin64/tooltip_and_button_asm.asm b/Plugin64/tooltip_and_button_asm.asm index 6b2b8253..3f910e8b 100644 --- a/Plugin64/tooltip_and_button_asm.asm +++ b/Plugin64/tooltip_and_button_asm.asm @@ -6,8 +6,8 @@ EXTERN tooltipAndButtonProc4ReturnAddress1 : QWORD EXTERN tooltipAndButtonProc4ReturnAddress2 : QWORD EXTERN tooltipAndButtonProc5ReturnAddress1 : QWORD EXTERN tooltipAndButtonProc5ReturnAddress2 : QWORD -EXTERN tooltipAndButtonProcTestReturnAddress1 : QWORD -EXTERN tooltipAndButtonProcTestReturnAddress2 : QWORD +EXTERN tooltipAndButtonProc7ReturnAddress1 : QWORD +EXTERN tooltipAndButtonProc7ReturnAddress2 : QWORD ESCAPE_SEQ_1 = 10h ESCAPE_SEQ_2 = 11h @@ -315,7 +315,7 @@ tooltipAndButtonProc5V130 ENDP ;-------------------------------------------; -tooltipAndButtonProcTest PROC +tooltipAndButtonProc7 PROC cmp tooltipAndButtonProc2TmpFlag, 1; jnz JMP_A; @@ -325,12 +325,12 @@ JMP_A: inc ebx; cmp ebx, dword ptr [rbp + 6E0h - 680h]; jge JMP_B; - push tooltipAndButtonProcTestReturnAddress1; + push tooltipAndButtonProc7ReturnAddress1; ret; JMP_B: - push tooltipAndButtonProcTestReturnAddress2; + push tooltipAndButtonProc7ReturnAddress2; ret; -tooltipAndButtonProcTest ENDP +tooltipAndButtonProc7 ENDP END \ No newline at end of file diff --git a/Plugin64/validator.cpp b/Plugin64/validator.cpp index 3bf8fdf2..fb87efc2 100644 --- a/Plugin64/validator.cpp +++ b/Plugin64/validator.cpp @@ -2,25 +2,14 @@ #include "plugin_64.h" namespace Validator { - template - std::string format(const std::string& fmt, Args ... args) - { - size_t len = std::snprintf(nullptr, 0, fmt.c_str(), args ...); - std::vector buf(len + 1); - std::snprintf(&buf[0], len + 1, fmt.c_str(), args ...); - return std::string(&buf[0], &buf[0] + len); - } - void Validate(DllError e, RunOptions options) { - auto message = format(u8"e.unmatch.code2=%llx , e.version.code1=%llx , e.mod.code0=%llx", - e.unmatch.code2, - e.version.code1, - e.mod.code0); + void Validate(DllError e, RunOptions options) { + auto message = e.print(); BytePattern::LoggingInfo("e=" + message); - if (e.unmatch.code2 > 0 || e.version.code1 > 0 || e.mod.code0 > 0) { + if (e.errorCheck()) { const DWORD sysDefLcid = ::GetSystemDefaultLCID(); const WCHAR* message; diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index 7fceae6f..a453d984 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -60,7 +60,7 @@ namespace Version { } void GetVersionFromExe(RunOptions *options) { - Eu4Version version; + Eu4Version version = UNKNOWN; // EU4 v1.??.? BytePattern::temp_instance().find_pattern("45 55 34 20 76 31 2E ? ? 2E ?"); @@ -98,57 +98,45 @@ namespace Version { case 330: version = v1_33_0_0; break; - default: - version = UNKNOWN; - break; - ;; } } - else { - // release_v1.??.? - BytePattern::temp_instance().find_pattern("72 65 6C 65 61 73 65 5F 31 2E ? ? 2E ? 00"); - if (BytePattern::temp_instance().count() > 0) { - // ??を取得する - Pattern minor = Injector::ReadMemory(BytePattern::temp_instance().get_first().address(10), true); - switch (minor.calVer()) { - case 322: - case 321: - version = v1_32_0_1; - break; - case 316: - version = v1_31_6_0; - break; - case 315: - version = v1_31_5_0; - break; - case 314: - version = v1_31_4_0; - break; - case 313: - version = v1_31_3_0; - break; - case 312: - version = v1_31_2_0; - break; - case 311: - version = v1_31_1_0; - break; - case 306: - case 305: - version = v1_30_5_0; - break; - case 304: - version = v1_30_4_0; - break; - default: - version = UNKNOWN; - break; - ;; - } - } - else { - version = UNKNOWN; + // release_v1.??.? + BytePattern::temp_instance().find_pattern("72 65 6C 65 61 73 65 5F 31 2E ? ? 2E ? 00"); + if (version == UNKNOWN && version == BytePattern::temp_instance().count() > 0) { + // ??を取得する + Pattern minor = Injector::ReadMemory(BytePattern::temp_instance().get_first().address(10), true); + + switch (minor.calVer()) { + case 322: + case 321: + version = v1_32_0_1; + break; + case 316: + version = v1_31_6_0; + break; + case 315: + version = v1_31_5_0; + break; + case 314: + version = v1_31_4_0; + break; + case 313: + version = v1_31_3_0; + break; + case 312: + version = v1_31_2_0; + break; + case 311: + version = v1_31_1_0; + break; + case 306: + case 305: + version = v1_30_5_0; + break; + case 304: + version = v1_30_4_0; + break; } } From e22dc5c7a5799a70b98ba3691d6c4d4171a19e53 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Fri, 11 Feb 2022 14:02:44 +0900 Subject: [PATCH 5/9] Apply for #218 --- version/dllmain.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/version/dllmain.cpp b/version/dllmain.cpp index 6311ab97..e2995ecf 100644 --- a/version/dllmain.cpp +++ b/version/dllmain.cpp @@ -134,9 +134,15 @@ void Initialize(HMODULE hSelf) BOOL WINAPI DllMain(HMODULE module, DWORD reason, LPVOID reserved) { - if (reason == DLL_PROCESS_ATTACH && validateProcess()) + if (reason == DLL_PROCESS_ATTACH) { - Initialize(module); + if (validateProcess()) + { + Initialize(module); + } + else { + initInjector(); + } } return TRUE; From 4b3433a524573a9c0ff2eaffe35c91adec270951 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Sat, 12 Feb 2022 05:19:48 +0900 Subject: [PATCH 6/9] v1.33.0.1 --- Plugin64/version.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index a453d984..008e3de2 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -98,6 +98,9 @@ namespace Version { case 330: version = v1_33_0_0; break; + case 331: + version = v1_33_0_0; + break; } } From 2bba569a618a9150555d67a2e889bcf811e985a7 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Wed, 23 Feb 2022 11:57:40 +0900 Subject: [PATCH 7/9] Version 1.33.2.0 --- Plugin64/version.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index 008e3de2..a35d88f9 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -99,6 +99,7 @@ namespace Version { version = v1_33_0_0; break; case 331: + case 332: version = v1_33_0_0; break; } @@ -106,7 +107,7 @@ namespace Version { // release_v1.??.? BytePattern::temp_instance().find_pattern("72 65 6C 65 61 73 65 5F 31 2E ? ? 2E ? 00"); - if (version == UNKNOWN && version == BytePattern::temp_instance().count() > 0) { + if (version == UNKNOWN && BytePattern::temp_instance().count() > 0) { // ??を取得する Pattern minor = Injector::ReadMemory(BytePattern::temp_instance().get_first().address(10), true); From 640dd9040b8d6ad560ab0717c6ea824bc12cba67 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Wed, 23 Feb 2022 12:04:31 +0900 Subject: [PATCH 8/9] Fix a code --- Plugin64/localization.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Plugin64/localization.cpp b/Plugin64/localization.cpp index c829d079..bd7013a2 100644 --- a/Plugin64/localization.cpp +++ b/Plugin64/localization.cpp @@ -1,6 +1,5 @@ #include "pch.h" #include "plugin_64.h" -#include namespace Localization { extern "C" { @@ -579,9 +578,9 @@ namespace Localization { BytePattern::temp_instance().find_pattern("20 2D 20 00 4D 4F 4E 54 48 53 00 00"); if (BytePattern::temp_instance().has_size(1, u8"Replace space")) { intptr_t address = BytePattern::temp_instance().get_first().address(); - Injector::WriteMemory(address+0, 0x20,true); - Injector::WriteMemory(address+1, 0x2D, true); - Injector::WriteMemory(address+2, 0x20, true); + Injector::WriteMemory(address+0, 0x20,true); + Injector::WriteMemory(address+1, 0x2D, true); + Injector::WriteMemory(address+2, 0x20, true); } else { e.localization.unmatchdLocalizationProc9Injector = true; From e79143134feedfe08d7735c42199e3ed959cb106 Mon Sep 17 00:00:00 2001 From: "matanki.saito" Date: Sat, 9 Apr 2022 19:41:35 +0900 Subject: [PATCH 9/9] Adapt dll to 1.33.3 --- Plugin64/date.cpp | 1 + Plugin64/dll_main.cpp | 5 - Plugin64/event_dialog.cpp | 3 + Plugin64/file_save.cpp | 7 + Plugin64/font.cpp | 6 + Plugin64/ime.cpp | 3 + Plugin64/input.cpp | 2 + Plugin64/list_field_adjustment.cpp | 3 + Plugin64/localization.cpp | 9 + Plugin64/main_text.cpp | 4 + Plugin64/map_adjustment.cpp | 5 + Plugin64/map_justify.cpp | 3 + Plugin64/map_nudge_view.cpp | 1 + Plugin64/map_popup.cpp | 3 + Plugin64/map_view.cpp | 3 + Plugin64/plugin_64.h | 245 +++++++++++++++++++++++++--- Plugin64/program.cpp | 0 Plugin64/tooltip_and_button.cpp | 78 ++++++++- Plugin64/tooltip_and_button_asm.asm | 132 +++++++++++++++ Plugin64/validator.cpp | 2 +- Plugin64/version.cpp | 5 + 21 files changed, 491 insertions(+), 29 deletions(-) create mode 100644 Plugin64/program.cpp diff --git a/Plugin64/date.cpp b/Plugin64/date.cpp index 89fa704b..2339bd05 100644 --- a/Plugin64/date.cpp +++ b/Plugin64/date.cpp @@ -36,6 +36,7 @@ namespace Date { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // d w mw w y BytePattern::temp_instance().find_pattern("64 20 77 20 6D"); if (BytePattern::temp_instance().has_size(1, u8"右上の表記を変更")) { diff --git a/Plugin64/dll_main.cpp b/Plugin64/dll_main.cpp index 5ca8d01e..3335ae77 100644 --- a/Plugin64/dll_main.cpp +++ b/Plugin64/dll_main.cpp @@ -29,11 +29,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, e |= ModDownload::Init(); #endif - // デバッグ用 - //#ifdef _DEBUG - //e |= Debug::Init(options); - //#endif - // フォント読み込み e |= Font::Init(options); diff --git a/Plugin64/event_dialog.cpp b/Plugin64/event_dialog.cpp index 1b5ff5bc..308c4850 100644 --- a/Plugin64/event_dialog.cpp +++ b/Plugin64/event_dialog.cpp @@ -50,6 +50,7 @@ namespace EventDialog { break; case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rdx+rax] BytePattern::temp_instance().find_pattern("0F B6 04 02 49 8B 34 C2 F3 41 0F 10 8A 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理")) { @@ -115,6 +116,7 @@ namespace EventDialog { break; case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov rax, [rsp+1158h+arg_20] BytePattern::temp_instance().find_pattern("48 8B 84 24 80 11 00 00 8B 00 03 C0"); if (BytePattern::temp_instance().has_size(1, u8"分岐処理修正戻り先アドレス2")) { @@ -193,6 +195,7 @@ namespace EventDialog { break; case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // inc edi BytePattern::temp_instance().find_pattern("FF C7 3B 7B 10 44 8B 84 24 70 11 00 00"); if (BytePattern::temp_instance().has_size(1, u8"カウントアップ")) { diff --git a/Plugin64/file_save.cpp b/Plugin64/file_save.cpp index 48a68c6c..748f6b1f 100644 --- a/Plugin64/file_save.cpp +++ b/Plugin64/file_save.cpp @@ -56,6 +56,7 @@ namespace FileSave { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov eax, [rcx+10h] BytePattern::temp_instance().find_pattern("8B 41 10 85 C0 0F 84 31 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ファイル名を安全にしている場所を短絡する")) { @@ -82,6 +83,7 @@ namespace FileSave { int offset = 0; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -192,6 +194,7 @@ namespace FileSave { e.fileSave.unmatchdFileSaveProc3Injector = true; } break; + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -241,6 +244,7 @@ namespace FileSave { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea r8, [rbp+0] BytePattern::temp_instance().find_pattern("4C 8D 45 00 48 8D 15 ? ? ? ? 48 8D 4C 24 70 E8 ? ? ? ? 90"); if (BytePattern::temp_instance().has_size(1, u8"ダイアログでのセーブエントリのツールチップを表示できるようにする1")) { @@ -323,6 +327,7 @@ namespace FileSave { e.fileSave.unmatchdFileSaveProc5Injector = true; } break; + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -390,6 +395,7 @@ namespace FileSave { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea r8, [rbp+730h+var_3A0] BytePattern::temp_instance().find_pattern("4C 8D 85 90 03 00 00 48 8D 15 ? ? ? ? 48 8D 4C 24 30"); if (BytePattern::temp_instance().has_size(1, u8"スタート画面でのコンティニューのツールチップ")) { @@ -451,6 +457,7 @@ namespace FileSave { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea rcx, [rbx+0C8h] uintptr_t address; diff --git a/Plugin64/font.cpp b/Plugin64/font.cpp index 86b384cc..795412f7 100644 --- a/Plugin64/font.cpp +++ b/Plugin64/font.cpp @@ -35,6 +35,7 @@ namespace Font { break; case v1_33_0_0: + case v1_33_3_0: // cmp edi, 0FFh // 81 FF FF 00 00 00 BytePattern::temp_instance().find_pattern("81 FF FF 00 00 00 0F 87 2C 01 00 00 83"); @@ -75,6 +76,7 @@ namespace Font { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov rcx,cs:hHeap BytePattern::temp_instance().find_pattern("48 8B 0D ? ? ? ? 4C 8B C3 33 D2"); if (BytePattern::temp_instance().has_size(1, "Font buffer heap zero clear")) { @@ -121,6 +123,7 @@ namespace Font { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B CF"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { // mov edx, 3D88h @@ -159,6 +162,7 @@ namespace Font { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: BytePattern::temp_instance().find_pattern("BA 88 3D 00 00 48 8B 4D 28"); if (BytePattern::temp_instance().has_size(1, "Font buffer clear")) { // mov edx, 3D88h @@ -197,6 +201,7 @@ namespace Font { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: BytePattern::temp_instance().find_pattern("B9 88 3D 00 00"); if (BytePattern::temp_instance().has_size(1, "Font buffer expansion")) { // mov ecx, 3D88h @@ -234,6 +239,7 @@ namespace Font { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: BytePattern::temp_instance().find_pattern("41 81 FE 00 00 00 01"); if (BytePattern::temp_instance().has_size(1, u8"Font size limit")) { // cmp r14d, 1000000h diff --git a/Plugin64/ime.cpp b/Plugin64/ime.cpp index 966788d6..f0b103a8 100644 --- a/Plugin64/ime.cpp +++ b/Plugin64/ime.cpp @@ -53,6 +53,7 @@ namespace Ime { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov edx, r13d BytePattern::temp_instance().find_pattern("41 8B D5 49 8B CC E8 ? ? ? ? 85 C0 0F 85"); if (BytePattern::temp_instance().has_size(1, u8"SDL_windowsevents.cの修正")) { @@ -105,6 +106,7 @@ namespace Ime { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: rectAddress = (uintptr_t)▭ // SDL_SetTextInputRectの関数を見つける @@ -190,6 +192,7 @@ namespace Ime { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // 直前の部分でjmpに使う14byteを確保することができなかった。 // そのためWM_KEYDOWNのコードをすべて移植した // mov rcx, [rbp+0C0h+hRawInput] diff --git a/Plugin64/input.cpp b/Plugin64/input.cpp index bda989b5..e41cb83d 100644 --- a/Plugin64/input.cpp +++ b/Plugin64/input.cpp @@ -62,6 +62,7 @@ namespace Input { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov eax, dword ptr [rbp+120h+var_18C] BytePattern::temp_instance().find_pattern("8B 45 94 32 DB 3C 80 73 05 0F B6 D8 EB 10"); if (BytePattern::temp_instance().has_size(1, u8"入力した文字をutf8からエスケープ列へ変換する1")) { @@ -116,6 +117,7 @@ namespace Input { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov rax, [rdi] BytePattern::temp_instance().find_pattern("48 8B 07 48 8B CF 85 DB 74 08 FF 90 40 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"バックスペース処理の修正")) { diff --git a/Plugin64/list_field_adjustment.cpp b/Plugin64/list_field_adjustment.cpp index 264e4159..ffacf63c 100644 --- a/Plugin64/list_field_adjustment.cpp +++ b/Plugin64/list_field_adjustment.cpp @@ -21,6 +21,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -90,6 +91,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -163,6 +165,7 @@ namespace ListFieldAdjustment { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: diff --git a/Plugin64/localization.cpp b/Plugin64/localization.cpp index bd7013a2..a5dd155e 100644 --- a/Plugin64/localization.cpp +++ b/Plugin64/localization.cpp @@ -54,6 +54,7 @@ namespace Localization { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov [rsp+arg_10], rbx BytePattern::temp_instance().find_pattern("48 89 5C 24 18 55 41 56 41 57 48 83 EC 20 4D 8B F0"); if (BytePattern::temp_instance().has_size(1, u8"std::basic_string#insertをフック")) { @@ -118,6 +119,7 @@ namespace Localization { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov rax, [rdi+30h] BytePattern::temp_instance().find_pattern("48 8B 47 30 4C 8B 40 28 49 83 C0 10"); if (BytePattern::temp_instance().has_size(1, u8"Battle of areaを逆転させる")) { @@ -163,6 +165,7 @@ namespace Localization { e.localization.unmatchdLocalizationProc3Injector = true; } break; + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -233,6 +236,7 @@ namespace Localization { e.localization.unmatchdLocalizationProc4Injector = true; } break; + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: offset = 0x3C; @@ -311,6 +315,7 @@ namespace Localization { int offset = 0; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -395,6 +400,7 @@ namespace Localization { int offset = 0; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: /* 処理は不要になった。tmm_l_english.ymlのLONG_EU3_DATE_STRINGで代用される*/ break; @@ -460,6 +466,7 @@ namespace Localization { std::string pattern; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -515,6 +522,7 @@ namespace Localization { std::string pattern; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -569,6 +577,7 @@ namespace Localization { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: diff --git a/Plugin64/main_text.cpp b/Plugin64/main_text.cpp index 608df8c0..f1bea0c4 100644 --- a/Plugin64/main_text.cpp +++ b/Plugin64/main_text.cpp @@ -37,6 +37,7 @@ namespace MainText { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movsxd rax, edi BytePattern::temp_instance().find_pattern("48 63 C7 0F B6 04 18 F3 41 0F 10 9F 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"テキスト処理ループ2の文字取得修正")) { @@ -70,6 +71,7 @@ namespace MainText { case v1_31_3_0: case v1_31_2_0: case v1_31_1_0: + case v1_33_3_0: // movsxd rdx, edi BytePattern::temp_instance().find_pattern("48 63 D7 49 63 CE 4C 8B 55 80"); if (BytePattern::temp_instance().has_size(1, u8"テキスト処理ループ1のカウント処理修正")) { @@ -124,6 +126,7 @@ namespace MainText { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: // cmp cs:byte_xxxxx, 0 @@ -239,6 +242,7 @@ namespace MainText { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rdx+r10] BytePattern::temp_instance().find_pattern("42 0F B6 04 12 49 8B 0C C7"); if (BytePattern::temp_instance().has_size(1, u8"テキスト処理ループ1の文字取得修正")) { diff --git a/Plugin64/map_adjustment.cpp b/Plugin64/map_adjustment.cpp index b0cd6888..63f6e527 100644 --- a/Plugin64/map_adjustment.cpp +++ b/Plugin64/map_adjustment.cpp @@ -62,6 +62,7 @@ namespace MapAdjustment { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movsx ecx, byte ptr [rdi + rbx] BytePattern::temp_instance().find_pattern("0F BE 0C 1F E8 ? ? ? ? 88 04 1F 41 FF"); if (BytePattern::temp_instance().has_size(2, u8"マップ文字の大文字化キャンセル")) { @@ -135,6 +136,7 @@ namespace MapAdjustment { break; case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea rax, [rbp+200h+var_200] BytePattern::temp_instance().find_pattern("48 8D 45 00 49 83 C8 FF 90 49 FF C0"); if (BytePattern::temp_instance().has_size(1, u8"文字チェック修正") || @@ -201,6 +203,7 @@ namespace MapAdjustment { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // r9, 0FFFFFFFFFFFFFFFFh BytePattern::temp_instance().find_pattern("49 83 C9 FF 45 33 C0 48 8D 95 D0 00 00 00"); if (BytePattern::temp_instance().has_size(1, u8"文字チェックの後のコピー処理")) { @@ -266,6 +269,7 @@ namespace MapAdjustment { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea rax, [rbp+200h+var_160] BytePattern::temp_instance().find_pattern("48 8D 85 A0 00 00 00 49 83 F8 10"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理修正")) { @@ -335,6 +339,7 @@ namespace MapAdjustment { break; case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // localization/tmm_l_english.ymlのENCLAVE_NAME_FORMATで対応された break; diff --git a/Plugin64/map_justify.cpp b/Plugin64/map_justify.cpp index 1d5d021a..93565834 100644 --- a/Plugin64/map_justify.cpp +++ b/Plugin64/map_justify.cpp @@ -33,6 +33,7 @@ namespace MapJustify { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movsd xmm3, [rbp+1D0h+var_168] BytePattern::temp_instance().find_pattern("F2 0F 10 5D 68 FF C2 F2 0F 10 65 20"); if (BytePattern::temp_instance().has_size(1, u8"文字取得処理リターン先2")) { @@ -84,6 +85,7 @@ namespace MapJustify { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea eax, [r10-1] BytePattern::temp_instance().find_pattern("41 8D 42 FF 66 0F 6E F2 66 0F 6E C0"); if (BytePattern::temp_instance().has_size(1, u8"一文字表示の調整")) { @@ -126,6 +128,7 @@ namespace MapJustify { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movsd xmm3, [rbp+1D0h+var_168] BytePattern::temp_instance().find_pattern("F2 0F 10 5D 68 FF C2 F2 0F 10 65 20"); if (BytePattern::temp_instance().has_size(1, u8"カウント処理")) { diff --git a/Plugin64/map_nudge_view.cpp b/Plugin64/map_nudge_view.cpp index c7a32fef..5015bf60 100644 --- a/Plugin64/map_nudge_view.cpp +++ b/Plugin64/map_nudge_view.cpp @@ -42,6 +42,7 @@ namespace MapNudgeView { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rax+rcx] BytePattern::temp_instance().find_pattern("0F B6 04 08 49 8B 94 C4 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"nudge view")) { diff --git a/Plugin64/map_popup.cpp b/Plugin64/map_popup.cpp index 4d52cacc..ad9215e5 100644 --- a/Plugin64/map_popup.cpp +++ b/Plugin64/map_popup.cpp @@ -34,6 +34,7 @@ namespace MapPopup { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx r8d, byte ptr [rdi+rax] BytePattern::temp_instance().find_pattern("44 0F B6 04 07 BA 01 00 00 00 48 8D 4D D0"); if (BytePattern::temp_instance().has_size(1, u8"ループ1の文字列コピー")) { @@ -92,6 +93,7 @@ namespace MapPopup { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rax+rdi] BytePattern::temp_instance().find_pattern("0F B6 04 38 4D 8B B4 C7 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ループ1の文字取得")) { @@ -147,6 +149,7 @@ namespace MapPopup { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rbx+rax] BytePattern::temp_instance().find_pattern("0F B6 04 03 4D 8B 9C C7 20 01 00 00"); if (BytePattern::temp_instance().has_size(1, u8"ループ2の文字取得")) { diff --git a/Plugin64/map_view.cpp b/Plugin64/map_view.cpp index f971f7c1..fdcec510 100644 --- a/Plugin64/map_view.cpp +++ b/Plugin64/map_view.cpp @@ -34,6 +34,7 @@ namespace MapView { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx eax, byte ptr [rax+r8] BytePattern::temp_instance().find_pattern("42 0F B6 04 00 4C 8B 1C C7 4C 89 5D 38"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ2の文字取得処理")) { @@ -90,6 +91,7 @@ namespace MapView { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // lea r9, [r12+120h] BytePattern::temp_instance().find_pattern("4D 8D 8C 24 20 01 00 00 42 0F B6 04 38 4D 8B 24 C1"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字取得処理")) { @@ -132,6 +134,7 @@ namespace MapView { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movzx r8d, byte ptr [rax+r15] BytePattern::temp_instance().find_pattern("46 0F B6 04 38 BA 01 00 00 00 48 8D 4C 24 40"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字コピー")) { diff --git a/Plugin64/plugin_64.h b/Plugin64/plugin_64.h index e9b97343..646726a6 100644 --- a/Plugin64/plugin_64.h +++ b/Plugin64/plugin_64.h @@ -21,11 +21,20 @@ enum Eu4Version { v1_31_5_0 = 1315, v1_31_6_0 = 1316, v1_32_0_1 = 1321, - v1_33_0_0 = 1330 + v1_33_0_0 = 1330, + v1_33_3_0 = 1333 }; typedef UINT64 DllErrorCode; +inline std::string BoolToString(bool b) +{ + return b ? "NG" : "OK"; +} + +#define PL( f ) BoolToString(f) + ":" + #f + "\n" +#define P( f ) #f ":" + BoolToString(f) + struct DllError{ union { DllErrorCode code; @@ -34,6 +43,12 @@ struct DllError{ bool waitFailed : 1; bool proccessFaild : 1; }; + + std::string print() { + return PL(timeout) + + PL(waitFailed) + + PL(proccessFaild); + } } mod; union { @@ -42,6 +57,11 @@ struct DllError{ bool unmatchdDateProc1Injector : 1; bool versionDateProc1Injector : 1; }; + + std::string print() { + return PL(unmatchdDateProc1Injector) + + PL(versionDateProc1Injector); + } } date; union { @@ -54,6 +74,14 @@ struct DllError{ bool unmatchdEventDialog3Injector : 1; bool versionEventDialog3Injector : 1; }; + + std::string print() { + return PL(unmatchdEventDialog1Injector) + + PL(versionEventDialog1Injector) + + PL(unmatchdEventDialog2Injector) + + PL(versionEventDialog2Injector) + + PL(versionEventDialog3Injector); + } } eventDialog; union { @@ -74,6 +102,23 @@ struct DllError{ bool unmatchdFileSaveProc7Injector : 1; bool versionFileSaveProc7Injector : 1; }; + + std::string print() { + return PL(unmatchdFileSaveProc1Injector) + + PL(versionFileSaveProc1Injector) + + PL(unmatchdFileSaveProc2Injector) + + PL(versionFileSaveProc2Injector) + + PL(unmatchdFileSaveProc3Injector) + + PL(versionFileSaveProc3Injector) + + PL(unmatchdFileSaveProc4Injector) + + PL(versionFileSaveProc4Injector) + + PL(unmatchdFileSaveProc5Injector) + + PL(versionFileSaveProc5Injector) + + PL(unmatchdFileSaveProc6Injector) + + PL(versionFileSaveProc6Injector) + + PL(unmatchdFileSaveProc7Injector) + + PL(versionFileSaveProc7Injector); + } } fileSave; union { @@ -92,6 +137,21 @@ struct DllError{ bool unmatchdFontSizeLimitInjector : 1; bool versionFontSizeLimitInjector : 1; }; + + std::string print() { + return PL(unmatchdCharCodePointLimiterPatchInjector) + + PL(versionCharCodePointLimiterPatchInjector) + + PL(unmatchdFontBufferHeapZeroClearInjector) + + PL(versionFontBufferHeapZeroClearInjector) + + PL(unmatchdFontBufferClear1Injector) + + PL(versionFontBufferClear1Injector) + + PL(unmatchdFontBufferClear2Injector) + + PL(versionFontBufferClear2Injector) + + PL(unmatchdFontBufferExpansionInjector) + + PL(versionFontBufferExpansionInjector) + + PL(unmatchdFontSizeLimitInjector) + + PL(versionFontSizeLimitInjector); + } } font; union { @@ -104,6 +164,15 @@ struct DllError{ bool unmatchdImeProc3Injector : 1; bool versionImeProc3Injector : 1; }; + + std::string print() { + return PL(unmatchdImeProc1Injector) + + PL(versionImeProc1Injector) + + PL(unmatchdImeProc2Injector) + + PL(versionImeProc2Injector) + + PL(unmatchdImeProc3Injector) + + PL(versionImeProc3Injector); + } } ime; union { @@ -114,6 +183,14 @@ struct DllError{ bool unmatchdInputProc2Injector : 1; bool versionInputProc2Injector : 1; }; + + std::string print() { + return PL(unmatchdInputProc1Injector) + + PL(versionInputProc1Injector) + + PL(unmatchdInputProc2Injector) + + PL(versionInputProc2Injector); + } + } input; union { @@ -126,6 +203,16 @@ struct DllError{ bool unmatchdListFieldAdjustmentProc3Injector : 1; bool versionListFieldAdjustmentProc3Injector : 1; }; + + std::string print() { + return PL(unmatchdListFieldAdjustmentProc1Injector) + + PL(versionListFieldAdjustmentProc1Injector) + + PL(unmatchdListFieldAdjustmentProc2Injector) + + PL(versionListFieldAdjustmentProc2Injector) + + PL(unmatchdListFieldAdjustmentProc3Injector) + + PL(versionListFieldAdjustmentProc3Injector); + } + } listFiledAdjustment; union { @@ -150,6 +237,28 @@ struct DllError{ bool unmatchdLocalizationProc9Injector : 1; bool versionLocalizationProc9Injector : 1; }; + + std::string print() { + return PL(unmatchdLocalizationProc1Injector) + + PL(versionLocalizationProc1Injector) + + PL(unmatchdLocalizationProc2Injector) + + PL(versionLocalizationProc2njector) + + PL(unmatchdLocalizationProc3Injector) + + PL(versionLocalizationProc3njector) + + PL(unmatchdLocalizationProc4Injector) + + PL(versionLocalizationProc4Injector) + + PL(unmatchdLocalizationProc5Injector) + + PL(versionLocalizationProc5Injector) + + PL(unmatchdLocalizationProc6Injector) + + PL(versionLocalizationProc6Injector) + + PL(unmatchdLocalizationProc7Injector) + + PL(versionLocalizationProc7Injector) + + PL(unmatchdLocalizationProc8Injector) + + PL(versionLocalizationProc8Injector) + + PL(unmatchdLocalizationProc9Injector) + + PL(versionLocalizationProc9Injector); + } + } localization; union { @@ -164,6 +273,17 @@ struct DllError{ bool unmatchdMainTextProc4Injector : 1; bool versionMainTextProc4Injector : 1; }; + + std::string print() { + return PL(unmatchdMainTextProc1Injector) + + PL(versionMainTextProc11njector) + + PL(unmatchdMainTextProc2Injector) + + PL(versionMainTextProc2Injector) + + PL(unmatchdMainTextProc3Injector) + + PL(versionMainTextProc3Injector) + + PL(unmatchdMainTextProc4Injector) + + PL(versionMainTextProc4Injector); + } } mainText; union { @@ -180,6 +300,19 @@ struct DllError{ bool unmatchdMapAdjustmentProc5Injector : 1; bool versionMapAdjustmentProc5Injector : 1; }; + + std::string print() { + return PL(unmatchdMapAdjustmentProc1Injector) + + PL(versionMapAdjustmentProc1Injector) + + PL(unmatchdMapAdjustmentProc2Injector) + + PL(versionMapAdjustmentProc2Injector) + + PL(unmatchdMapAdjustmentProc3Injector) + + PL(versionMapAdjustmentProc3Injector) + + PL(unmatchdMapAdjustmentProc4Injector) + + PL(versionMapAdjustmentProc4Injector) + + PL(unmatchdMapAdjustmentProc5Injector) + + PL(versionMapAdjustmentProc5Injector); + } } mapAdjustment; union { @@ -194,6 +327,17 @@ struct DllError{ bool unmatchdMapJustifyProc4Injector : 1; bool versionMapJustifyProc4Injector : 1; }; + + std::string print() { + return PL(unmatchdMapJustifyProc1Injector) + + PL(versionMapJustifyProc1Injector) + + PL(unmatchdMapJustifyProc2Injector) + + PL(versionMapJustifyProc2Injector) + + PL(unmatchdMapJustifyProc3Injector) + + PL(versionMapJustifyProc3Injector) + + PL(unmatchdMapJustifyProc4Injector) + + PL(versionMapJustifyProc4Injector); + } } mapJustify; union { @@ -202,6 +346,11 @@ struct DllError{ bool unmatchdMapNudgeViewProc1Injector : 1; bool versionMapNudgeViewProc1Injector : 1; }; + + std::string print() { + return PL(unmatchdMapNudgeViewProc1Injector) + + PL(versionMapNudgeViewProc1Injector); + } } mapNudge; union { @@ -214,6 +363,15 @@ struct DllError{ bool unmatchdMapPopupProc3Injector : 1; bool versionMapPopupProc3Injector : 1; }; + + std::string print() { + return PL(unmatchdMapPopupProc1Injector) + + PL(versionMapPopupProc1Injector) + + PL(unmatchdMapPopupProc2Injector) + + PL(versionMapPopupProc2Injector) + + PL(unmatchdMapPopupProc3Injector) + + PL(versionMapPopupProc3Injector); + } } mapPopup; union { @@ -226,6 +384,16 @@ struct DllError{ bool unmatchdMapViewProc3Injector : 1; bool versionMapViewProc3Injector : 1; }; + + std::string print() { + return PL(unmatchdMapViewProc1Injector) + + PL(versionMapViewProc1Injector) + + PL(unmatchdMapViewProc2Injector) + + PL(versionMapViewProc2Injector) + + PL(unmatchdMapViewProc3Injector) + + PL(versionMapViewProc3Injector); + } + } mapView; union { @@ -234,6 +402,11 @@ struct DllError{ bool unmatchdDebugProc1Injector : 1; bool versionDebugProc1Injector : 1; }; + + std::string print() { + return PL(unmatchdDebugProc1Injector) + + PL(versionDebugProc1Injector); + } } debug; union { @@ -254,6 +427,22 @@ struct DllError{ bool unmatchdTooltipAndButtonProc7Injector : 1; bool versionTooltipAndButtonProc7Injector : 1; }; + + std::string print() { + return PL(unmatchdTooltipAndButtonProc1Injector) + + PL(versionTooltipAndButtonProc1Injector) + + PL(unmatchdTooltipAndButtonProc2Injector) + + PL(versionTooltipAndButtonProc2Injector) + + PL(versionTooltipAndButtonProc3Injector) + + PL(unmatchdTooltipAndButtonProc4Injector) + + PL(versionTooltipAndButtonProc4Injector) + + PL(unmatchdTooltipAndButtonProc5Injector) + + PL(versionTooltipAndButtonProc5Injector) + + PL(unmatchdTooltipAndButtonProc6Injector) + + PL(versionTooltipAndButtonProc6Injector) + + PL(unmatchdTooltipAndButtonProc7Injector) + + PL(versionTooltipAndButtonProc7Injector); + } } tooltipAndButton; void operator |= (DllError e) @@ -298,27 +487,39 @@ struct DllError{ } std::string print() { - return format(u8"mod=%llx,date=%llx,eventDialog=%llx,fileSave=%llx," - "font=%llx,ime=%llx,input=%llx,listFiledAdjustment=%llx,localization=%llx" - "mainText=%llx,mapAdjustment=%llx,mapJustify=%llx,mapNudge=%llx,mapPopup=%llx" - "mapPopup=%llx,mapView=%llx,tooltipAndButton=%llx,debug=%llx", - this->mod.code, - this->date.code, - this->eventDialog.code, - this->fileSave.code, - this->font.code, - this->ime.code, - this->input.code, - this->listFiledAdjustment.code, - this->localization.code, - this->mainText.code, - this->mapAdjustment.code, - this->mapJustify.code, - this->mapNudge.code, - this->mapPopup.code, - this->mapView.code, - this->tooltipAndButton.code, - this->debug.code); + return this->tooltipAndButton.print() + + "--------------\n" + + this->mapView.print() + + "--------------\n" + + this->debug.print() + + "--------------\n" + + this->mapPopup.print() + + "--------------\n" + + this->mapNudge.print() + + "--------------\n" + + this->mapJustify.print() + + "--------------\n" + + this->mapAdjustment.print() + + "--------------\n" + + this->mainText.print() + + "--------------\n" + + this->localization.print() + + "--------------\n" + + this->listFiledAdjustment.print() + + "--------------\n" + + this->input.print() + + "--------------\n" + + this->ime.print() + + "--------------\n" + + this->font.print() + + "--------------\n" + + this->fileSave.print() + + "--------------\n" + + this->eventDialog.print() + + "--------------\n" + + this->date.print() + + "--------------\n" + + this->mod.print(); } template diff --git a/Plugin64/program.cpp b/Plugin64/program.cpp new file mode 100644 index 00000000..e69de29b diff --git a/Plugin64/tooltip_and_button.cpp b/Plugin64/tooltip_and_button.cpp index 6a9ec2f9..cb3b2045 100644 --- a/Plugin64/tooltip_and_button.cpp +++ b/Plugin64/tooltip_and_button.cpp @@ -4,12 +4,16 @@ namespace TooltipAndButton { extern "C" { void tooltipAndButtonProc1(); + void tooltipAndButtonProc1V133(); void tooltipAndButtonProc2(); + void tooltipAndButtonProc2V133(); void tooltipAndButtonProc3(); void tooltipAndButtonProc4(); + void tooltipAndButtonProc4V133(); void tooltipAndButtonProc5(); void tooltipAndButtonProc5V130(); void tooltipAndButtonProc7(); + void tooltipAndButtonProc7V133(); uintptr_t tooltipAndButtonProc1ReturnAddress; uintptr_t tooltipAndButtonProc1CallAddress; uintptr_t tooltipAndButtonProc2ReturnAddress; @@ -26,6 +30,24 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_3_0: + // r8d, byte ptr [rax + rcx] + BytePattern::temp_instance().find_pattern("44 0F B6 04 08 BA 01 00 00 00"); + if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字コピー")) { + uintptr_t address = BytePattern::temp_instance().get_first().address(); + + // call {sub_xxxxx} + tooltipAndButtonProc1CallAddress = Injector::GetBranchDestination(address + 0x0F).as_int(); + + // nop + tooltipAndButtonProc1ReturnAddress = address + 0x14; + + Injector::MakeJMP(address, tooltipAndButtonProc1V133, true); + } + else { + e.tooltipAndButton.unmatchdTooltipAndButtonProc1Injector = true; + } + break; case v1_29_1_0: case v1_29_2_0: case v1_29_3_0: @@ -71,6 +93,21 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_3_0: + // mov edx, ebx + BytePattern::temp_instance().find_pattern("8B D3 0F B6 04 10 49 8B 0C C7"); + if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の文字取得")) { + uintptr_t address = BytePattern::temp_instance().get_first().address(); + + // test rcx,rcx + tooltipAndButtonProc2ReturnAddress = address + 0xE; + + Injector::MakeJMP(address, tooltipAndButtonProc2V133, true); + } + else { + e.tooltipAndButton.unmatchdTooltipAndButtonProc2Injector = true; + } + break; case v1_29_1_0: case v1_29_2_0: case v1_29_3_0: @@ -130,6 +167,7 @@ namespace TooltipAndButton { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // mov ecx, ebx BytePattern::temp_instance().find_pattern("8B CB F3 45 0F 10 97 48 08 00 00"); if (BytePattern::temp_instance().has_size(1, u8"処理ループ2の文字取得")) { @@ -206,6 +244,24 @@ namespace TooltipAndButton { e.tooltipAndButton.unmatchdTooltipAndButtonProc4Injector = true; } break; + case v1_33_3_0: + // cmp word ptr [rcx + 6], 0 + BytePattern::temp_instance().find_pattern("66 83 79 06 00 0F 85 03 03 00 00"); + if (BytePattern::temp_instance().has_size(1, u8"処理ループ1の改行処理")) { + uintptr_t address = BytePattern::temp_instance().get_first().address(); + + // jnz {loc_xxxxx} / inc ebx + tooltipAndButtonProc4ReturnAddress1 = Injector::GetBranchDestination(address + 0x5).as_int(); + + // jz loc_xxxxx + tooltipAndButtonProc4ReturnAddress2 = address + 15; + + Injector::MakeJMP(address, tooltipAndButtonProc4V133, true); + } + else { + e.tooltipAndButton.unmatchdTooltipAndButtonProc4Injector = true; + } + break; default: e.tooltipAndButton.versionTooltipAndButtonProc4Injector = true; } @@ -281,6 +337,7 @@ namespace TooltipAndButton { case v1_31_6_0: case v1_32_0_1: case v1_33_0_0: + case v1_33_3_0: // movaps xmm8, [rsp+0F8h+var_58] BytePattern::temp_instance().find_pattern("44 0F 28 84 24 A0 00 00 00 0F 28 BC 24 B0 00 00 00 48"); if (BytePattern::temp_instance().has_size(1, u8"ツールチップの改行処理のリターン先2")) { @@ -315,6 +372,7 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_3_0: case v1_33_0_0: case v1_32_0_1: case v1_31_6_0: @@ -339,9 +397,27 @@ namespace TooltipAndButton { DllError e = {}; switch (options.version) { + case v1_33_3_0: + // inc ebx + BytePattern::temp_instance().find_pattern("FF C3 3B 5D A8 7D 1D E9 79 F7 FF FF E8"); + if (BytePattern::temp_instance().has_size(1, u8"カウントアップ")) { + uintptr_t address = BytePattern::temp_instance().get_first().address(); + + // jmp loc_xxxxx + tooltipAndButtonProc7ReturnAddress1 = Injector::GetBranchDestination(address + 0x7).as_int(); + + // mov edi, dword ptr [rsp+22D0h+var_2290] + tooltipAndButtonProc7ReturnAddress2 = address + 0x24; + + Injector::MakeJMP(address, tooltipAndButtonProc7V133, true); + } + else { + e.tooltipAndButton.unmatchdTooltipAndButtonProc7Injector = true; + } + break; case v1_33_0_0: case v1_32_0_1: - // inc edx + // inc ebx BytePattern::temp_instance().find_pattern("FF C3 3B 5D 60 7D 1D E9 7D F7 FF FF E8"); if (BytePattern::temp_instance().has_size(1, u8"カウントアップ")) { uintptr_t address = BytePattern::temp_instance().get_first().address(); diff --git a/Plugin64/tooltip_and_button_asm.asm b/Plugin64/tooltip_and_button_asm.asm index 3f910e8b..f0901db2 100644 --- a/Plugin64/tooltip_and_button_asm.asm +++ b/Plugin64/tooltip_and_button_asm.asm @@ -65,6 +65,43 @@ tooltipAndButtonProc1 ENDP ;-------------------------------------------; +tooltipAndButtonProc1V133 PROC + cmp byte ptr [rax + rcx], ESCAPE_SEQ_1; + jz JMP_A; + cmp byte ptr [rax + rcx], ESCAPE_SEQ_2; + jz JMP_A; + cmp byte ptr [rax + rcx], ESCAPE_SEQ_3; + jz JMP_A; + cmp byte ptr [rax + rcx], ESCAPE_SEQ_4; + jz JMP_A; + + movzx r8d, byte ptr[rax + rcx]; + mov edx, 1; + lea rcx, qword ptr [rsp + 22D0h - 2258h]; + mov tooltipAndButtonProc2TmpFlag, 0h; + call tooltipAndButtonProc1CallAddress; + + jmp JMP_B; +JMP_A: + mov tooltipAndButtonProc2TmpFlag, 1h; + lea r8, qword ptr [rax + rcx]; + mov tooltipAndButtonProc2TmpCharacterAddress, r8; + movzx r8d, byte ptr[rax + rcx]; + mov edx, 3; The memory is allocated 3 byte, but the first byte is copied 3 times. + lea rcx, qword ptr [rsp + 22D0h - 2258h]; + call tooltipAndButtonProc1CallAddress; + + ; overwrite + mov rcx, tooltipAndButtonProc2TmpCharacterAddress; + mov cx, word ptr [rcx+1]; + mov word ptr [rax+1], cx; +JMP_B: + push tooltipAndButtonProc1ReturnAddress; + ret; +tooltipAndButtonProc1V133 ENDP + +;-------------------------------------------; + tooltipAndButtonProc2 PROC mov edx, ebx; @@ -122,6 +159,63 @@ tooltipAndButtonProc2 ENDP ;-------------------------------------------; +tooltipAndButtonProc2V133 PROC + mov edx, ebx; + + cmp byte ptr[rax+rdx], ESCAPE_SEQ_1; + jz JMP_A; + cmp byte ptr[rax+rdx], ESCAPE_SEQ_2; + jz JMP_B; + cmp byte ptr[rax+rdx], ESCAPE_SEQ_3; + jz JMP_C; + cmp byte ptr[rax+rdx], ESCAPE_SEQ_4; + jz JMP_D; + jmp JMP_E; + +JMP_A: + movzx eax, word ptr[rax+rdx + 1]; + jmp JMP_F; + +JMP_B: + movzx eax, word ptr[rax+rdx + 1]; + sub eax, SHIFT_2; + jmp JMP_F; + +JMP_C: + movzx eax, word ptr[rax+rdx + 1]; + add eax, SHIFT_3; + jmp JMP_F; + +JMP_D: + movzx eax, word ptr[rax+rdx + 1]; + add eax, SHIFT_4; + jmp JMP_F; + +JMP_E: + movzx eax, byte ptr [rax + rdx]; + jmp JMP_G; + +JMP_F: + movzx eax, ax; + add edx,2; + ;mov dword ptr [rbp+6E0h- 6C0h], ebx; + + cmp eax, NO_FONT; + ja JMP_G; + mov eax, NOT_DEF; + +JMP_G: + mov rcx, qword ptr [r15 + rax * 8]; + mov qword ptr [rbp + 21D0h - 21F0h], rcx; + + mov tooltipAndButtonProc2TmpCharacter, eax; + + push tooltipAndButtonProc2ReturnAddress; + ret; +tooltipAndButtonProc2V133 ENDP + +;-------------------------------------------; + tooltipAndButtonProc3 PROC mov ecx, ebx; movss xmm10, dword ptr [r15 + 848h]; @@ -193,6 +287,24 @@ tooltipAndButtonProc4 ENDP ;-------------------------------------------; +tooltipAndButtonProc4V133 PROC + cmp word ptr [rcx + 6], 0 + jz JMP_A; + + cmp tooltipAndButtonProc2TmpCharacter, 00FFh; + ja JMP_A; + + push tooltipAndButtonProc4ReturnAddress1; + ret; + +JMP_A: + cmp dword ptr [rbp + 21D0h - 2210h], 0; + push tooltipAndButtonProc4ReturnAddress2; + ret; +tooltipAndButtonProc4V133 ENDP + +;-------------------------------------------; + tooltipAndButtonProc5 PROC lea rcx, qword ptr [r12 + 100h]; @@ -333,4 +445,24 @@ JMP_B: ret; tooltipAndButtonProc7 ENDP +;-------------------------------------------; + +tooltipAndButtonProc7V133 PROC + cmp tooltipAndButtonProc2TmpFlag, 1; + jnz JMP_A; + + add ebx,2; + +JMP_A: + inc ebx; + cmp ebx, dword ptr [rbp + 21D0h - 2228h]; + jge JMP_B; + push tooltipAndButtonProc7ReturnAddress1; + ret; + +JMP_B: + push tooltipAndButtonProc7ReturnAddress2; + ret; +tooltipAndButtonProc7V133 ENDP + END \ No newline at end of file diff --git a/Plugin64/validator.cpp b/Plugin64/validator.cpp index fb87efc2..c753a423 100644 --- a/Plugin64/validator.cpp +++ b/Plugin64/validator.cpp @@ -7,7 +7,7 @@ namespace Validator { void Validate(DllError e, RunOptions options) { auto message = e.print(); - BytePattern::LoggingInfo("e=" + message); + BytePattern::LoggingInfo(message); if (e.errorCheck()) { const DWORD sysDefLcid = ::GetSystemDefaultLCID(); diff --git a/Plugin64/version.cpp b/Plugin64/version.cpp index a35d88f9..2ea7a0b4 100644 --- a/Plugin64/version.cpp +++ b/Plugin64/version.cpp @@ -54,6 +54,8 @@ namespace Version { return u8"v1_32_0_1"; case v1_33_0_0: return u8"v1_33_0_0"; + case v1_33_3_0: + return u8"v1_33_3_0"; default: return u8"UNKNOWN"; } @@ -102,6 +104,9 @@ namespace Version { case 332: version = v1_33_0_0; break; + case 333: + version = v1_33_3_0; + break; } }