Skip to content

Commit

Permalink
Merge pull request #229 from matanki-saito/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
matanki-saito authored Apr 9, 2022
2 parents 60aac72 + e791431 commit f3fce93
Show file tree
Hide file tree
Showing 25 changed files with 1,102 additions and 390 deletions.
2 changes: 1 addition & 1 deletion Plugin64/Plugin64.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<EnableUAC>false</EnableUAC>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "C:\Program Files\Epic Games\EuropaUniversalis4\plugins"</Command>
<Command>copy "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\Europa Universalis IV\plugins"</Command>
</PostBuildEvent>
<MASM>
<MakeAllSymbolsPublic>
Expand Down
6 changes: 4 additions & 2 deletions Plugin64/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace Date {
case v1_31_5_0:
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"右上の表記を変更")) {
Expand All @@ -43,11 +45,11 @@ namespace Date {
Injector::WriteMemory<DateFormat>(address, isoFormat,true);
}
else {
e.unmatch.dateProc1Injector = true;
e.date.unmatchdDateProc1Injector = true;
}
break;
default:
e.version.dateProc1Injector = true;
e.date.versionDateProc1Injector = true;
}

return e;
Expand Down
4 changes: 2 additions & 2 deletions Plugin64/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions Plugin64/dll_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ BOOL APIENTRY DllMain(HMODULE hModule,
e |= ModDownload::Init();
#endif

// デバッグ用
//#ifdef _DEBUG
//e |= Debug::Init(options);
//#endif

// フォント読み込み
e |= Font::Init(options);

Expand Down
30 changes: 18 additions & 12 deletions Plugin64/event_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ namespace EventDialog {
Injector::MakeJMP(address, eventDialogProc1, true);
}
else {
e.unmatch.eventDialog1Injector = true;
e.eventDialog.unmatchdEventDialog1Injector = true;
}
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"文字取得処理")) {
Expand All @@ -60,11 +62,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;
Expand Down Expand Up @@ -95,7 +97,7 @@ namespace EventDialog {
eventDialogProc2ReturnAddress2 = BytePattern::temp_instance().get_first().address();
}
else {
e.unmatch.eventDialog1Injector = true;
e.eventDialog.unmatchdEventDialog2Injector = true;
}

// cvtdq2ps xmm0, xmm0
Expand All @@ -109,17 +111,19 @@ namespace EventDialog {
Injector::MakeJMP(address, eventDialogProc2, true);
}
else {
e.unmatch.eventDialog2Injector = true;
e.eventDialog.unmatchdEventDialog2Injector = true;
}
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")) {
eventDialogProc2ReturnAddress2 = BytePattern::temp_instance().get_first().address();
}
else {
e.unmatch.eventDialog1Injector = true;
e.eventDialog.unmatchdEventDialog2Injector = true;
}

// cvtdq2ps xmm0, xmm0
Expand All @@ -133,11 +137,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;
Expand All @@ -161,7 +165,7 @@ namespace EventDialog {
Injector::MakeJMP(address, eventDialogProc3, true);
}
else {
e.unmatch.eventDialog2Injector = true;
e.eventDialog.unmatchdEventDialog3Injector = true;
}
break;
case v1_30_5_0:
Expand All @@ -186,10 +190,12 @@ namespace EventDialog {
Injector::MakeJMP(address, eventDialogProc3V130, true);
}
else {
e.unmatch.eventDialog2Injector = true;
e.eventDialog.unmatchdEventDialog3Injector = true;
}
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"カウントアップ")) {
Expand All @@ -201,11 +207,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;
Expand Down
54 changes: 34 additions & 20 deletions Plugin64/file_save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ namespace FileSave {
case v1_31_5_0:
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"ファイル名を安全にしている場所を短絡する")) {
Expand All @@ -65,11 +67,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;
Expand All @@ -81,6 +83,8 @@ 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:
// mov [rbp+57h+var_90], 0FFFFFFFFFFFFFFFEh
Expand Down Expand Up @@ -130,11 +134,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;
Expand All @@ -160,7 +164,7 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc3, true);
}
else {
e.unmatch.fileSaveProc3Injector = true;
e.fileSave.unmatchdFileSaveProc3Injector = true;
}
break;
case v1_30_5_0:
Expand All @@ -187,9 +191,11 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc3V130, true);
}
else {
e.unmatch.fileSaveProc3Injector = true;
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:
BytePattern::temp_instance().find_pattern("45 33 C0 48 8D 93 80 05 00 00 49 8B CE");
Expand All @@ -208,11 +214,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;
Expand All @@ -237,6 +243,8 @@ namespace FileSave {
case v1_31_5_0:
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")) {
Expand All @@ -253,11 +261,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;
Expand Down Expand Up @@ -287,7 +295,7 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc5, true);
}
else {
e.unmatch.fileSaveProc5Injector = true;
e.fileSave.unmatchdFileSaveProc5Injector = true;
}
break;
case v1_30_5_0:
Expand Down Expand Up @@ -316,9 +324,11 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc5V130, true);
}
else {
e.unmatch.fileSaveProc5Injector = true;
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:
// lea r8, [r14+5C0h]
Expand All @@ -337,11 +347,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;
Expand Down Expand Up @@ -369,7 +379,7 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc6, true);
}
else {
e.unmatch.fileSaveProc6Injector = true;
e.fileSave.unmatchdFileSaveProc6Injector = true;
}
break;
case v1_30_5_0:
Expand All @@ -384,6 +394,8 @@ namespace FileSave {
case v1_31_5_0:
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"スタート画面でのコンティニューのツールチップ")) {
Expand All @@ -400,11 +412,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;
Expand All @@ -429,7 +441,7 @@ namespace FileSave {
Injector::MakeJMP(address, fileSaveProc7, true);
}
else {
e.unmatch.fileSaveProc7Injector = true;
e.fileSave.unmatchdFileSaveProc7Injector = true;
}
break;
case v1_30_5_0:
Expand All @@ -444,6 +456,8 @@ namespace FileSave {
case v1_31_5_0:
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;

Expand All @@ -457,7 +471,7 @@ namespace FileSave {
address = BytePattern::temp_instance().get_second().address();
}
else {
e.unmatch.fileSaveProc7Injector = true;
e.fileSave.unmatchdFileSaveProc7Injector = true;
break;
}

Expand All @@ -470,7 +484,7 @@ namespace FileSave {

break;
default:
e.version.fileSaveProc7Injector = true;
e.fileSave.versionFileSaveProc7Injector = true;
}

return e;
Expand Down
Loading

0 comments on commit f3fce93

Please sign in to comment.