Skip to content

Commit

Permalink
Merge pull request #93 from matanki-saito/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
matanki-saito authored Apr 5, 2019
2 parents 7366ed3 + e0a1c2c commit aa69887
Show file tree
Hide file tree
Showing 26 changed files with 425 additions and 18 deletions.
6 changes: 6 additions & 0 deletions Plugin/ButtonAndTooltip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace ButtonAndTooltip
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
// sub esp,370h
byte_pattern::temp_instance().find_pattern("81 EC 70 03 00 00 8B");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down Expand Up @@ -237,6 +238,7 @@ namespace ButtonAndTooltip
return NOERROR;

case v3_0_X:
case v3_1_0:
// mov al,[eax+esi]
byte_pattern::temp_instance().find_pattern("8A 04 30 88 85 78 FF FF FF");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down Expand Up @@ -394,6 +396,7 @@ namespace ButtonAndTooltip
return NOERROR;

case v3_0_X:
case v3_1_0:
// cmovnb eax, edi
byte_pattern::temp_instance().find_pattern("0F 43 C7 0F B6 04 30 8B 8C 81");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down Expand Up @@ -456,6 +459,7 @@ namespace ButtonAndTooltip
return NOERROR;

case v3_0_X:
case v3_1_0:
// cmp [ebp+var_5C],0
byte_pattern::temp_instance().find_pattern("83 7D A4 00 0F 85 ? ? ? ? 83");
if (byte_pattern::temp_instance().has_size(1, desc + " start")) {
Expand Down Expand Up @@ -609,6 +613,7 @@ namespace ButtonAndTooltip
return NOERROR;

case v3_0_X:
case v3_1_0:
// cmovnb eax,edi
byte_pattern::temp_instance().find_pattern("0F 43 C7 0F B6 04 18 8B");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand All @@ -631,6 +636,7 @@ namespace ButtonAndTooltip
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
// lea esp,[ebp - 388h]
byte_pattern::temp_instance().find_pattern("8D A5 78 FC FF FF");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down
3 changes: 3 additions & 0 deletions Plugin/DateFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace DateFormat {
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
// issue33と同じもの
// sub esp,20h
byte_pattern::temp_instance().find_pattern("83 EC 20 56 FF 75 0C 8D 45 D8");
Expand Down Expand Up @@ -104,6 +105,7 @@ namespace DateFormat {
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("8D 4D D4 C6 45 FC 08 51 8D 8D 58");
if (byte_pattern::temp_instance().has_size(1, desc)) {
// lea ecx,[ebp+var_2C]
Expand All @@ -126,6 +128,7 @@ namespace DateFormat {
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("64 20 77 20 6D 77 20 2C");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::WriteMemory<uint8_t>(byte_pattern::temp_instance().get_first().address(0), 0x79, true);
Expand Down
2 changes: 2 additions & 0 deletions Plugin/DecorativeLetterDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ namespace DecorativeLetterDialog

case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("6A 01 6A 00 8D 85 88 F4 FF FF");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), y_8_v30);
Expand Down Expand Up @@ -222,6 +223,7 @@ namespace DecorativeLetterDialog

case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("8D 8D 80 FE FF FF 6A 01 8D");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), z_8_v30);
Expand Down
110 changes: 110 additions & 0 deletions Plugin/DecorativeLetterEndDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,46 @@ namespace DecorativeLetterEndDialog
}
}

uintptr_t aa_5_v310;
__declspec(naked) void aa_1_v310()
{
__asm {
mov esi, eax;
lea ecx, [ebp - 0xD0];
mov eax, ecx;
cmp dword ptr[eax + 0x14], 0x10;
jb aa_2;
mov eax, [eax];

aa_2:
mov al, [eax];
cmp al, ESCAPE_SEQ_1;
jz aa_3;

cmp al, ESCAPE_SEQ_2;
jz aa_3;

cmp al, ESCAPE_SEQ_3;
jz aa_3;

cmp al, ESCAPE_SEQ_4;
jz aa_3;

jmp aa_4;

aa_3:
push 3;
jmp aa_6;

aa_4:
push 1;

aa_6:
push aa_5_v310;
ret;
}
}

/*-----------------------------------------------*/

errno_t func1A_hook(RunOptions *options) {
Expand All @@ -54,13 +94,25 @@ namespace DecorativeLetterEndDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
// push 1
byte_pattern::temp_instance().find_pattern("6A 01 8B F0 8D 8D 2C");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), aa_1);
// push 0
aa_5 = byte_pattern::temp_instance().get_first().address(10);
}
else return CK2ERROR1;
return NOERROR;
case v3_1_0:
// push 1
byte_pattern::temp_instance().find_pattern("6A 01 8B F0 8D 8D 30");
if (byte_pattern::temp_instance().has_size(1, desc)) {
// push 0
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), aa_1_v310);
aa_5_v310 = byte_pattern::temp_instance().get_first().address(10);
}
else return CK2ERROR1;
return NOERROR;
}
return CK2ERROR1;
}
Expand Down Expand Up @@ -109,6 +161,48 @@ namespace DecorativeLetterEndDialog
}
}

uintptr_t bb_6_v310;
__declspec(naked) void bb_1_v310()
{
__asm {
lea ecx, [ebp - 0xD0];
cmp dword ptr[ecx + 0x14], 0x10;
jb bb_2;
mov ecx, [ecx];

bb_2:
mov cl, [ecx];

cmp cl, ESCAPE_SEQ_1;
jz bb_3;

cmp cl, ESCAPE_SEQ_2;
jz bb_3;

cmp cl, ESCAPE_SEQ_3;
jz bb_3;

cmp cl, ESCAPE_SEQ_4;
jz bb_3;

jmp bb_4;

bb_3:
push 3;
jmp bb_5;

bb_4:
push 1;

bb_5:
push eax;
lea ecx, [ebp - 0xD0];

push bb_6_v310;
ret;
}
}

/*-----------------------------------------------*/

errno_t func1B_hook(RunOptions *options) {
Expand All @@ -118,13 +212,27 @@ namespace DecorativeLetterEndDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
// call xxxxx
byte_pattern::temp_instance().find_pattern("E8 ? ? ? ? FF B5 3C FF FF FF 8D 45");
if (byte_pattern::temp_instance().has_size(1, desc)) {
// push 1
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0xE), bb_1);
// call xxxxx
bb_6 = byte_pattern::temp_instance().get_first().address(0x17);
}
else return CK2ERROR1;
return NOERROR;
case v3_1_0:
// call xxxxx
byte_pattern::temp_instance().find_pattern("E8 ? ? ? ? FF B5 40 FF FF FF 8D 45");
if (byte_pattern::temp_instance().has_size(1, desc)) {
// push 1
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0xE), bb_1_v310);
// call xxxxx
bb_6_v310 = byte_pattern::temp_instance().get_first().address(0x17);
}
else return CK2ERROR1;
return NOERROR;
}
return CK2ERROR1;
}
Expand Down Expand Up @@ -229,6 +337,7 @@ namespace DecorativeLetterEndDialog

case v3_0_0:
case v3_0_X:
case v3_1_0:
// push 1
byte_pattern::temp_instance().find_pattern("6A 01 6A 00 8D 85 94 FE FF FF");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down Expand Up @@ -338,6 +447,7 @@ namespace DecorativeLetterEndDialog

case v3_0_0:
case v3_0_X:
case v3_1_0:
//lea ecx, [ebp+var_200]
byte_pattern::temp_instance().find_pattern("8D 85 00 FE FF FF 6A 01 50 8D 8D 74 FF FF FF");
if (byte_pattern::temp_instance().has_size(1, desc)) {
Expand Down
4 changes: 4 additions & 0 deletions Plugin/DecorativeLetterInheritDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace DecorativeLetterInheritDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("6A 01 8B F8 8D 4D CC");
if (byte_pattern::temp_instance().has_size(1,desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), ff_1);
Expand Down Expand Up @@ -112,6 +113,7 @@ namespace DecorativeLetterInheritDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
// push [ebp+var_24]
byte_pattern::temp_instance().find_pattern("FF 75 DC 8D 45 B4 6A 01 50 8D 4D CC");
if (byte_pattern::temp_instance().has_size(1,desc)) {
Expand Down Expand Up @@ -174,6 +176,7 @@ namespace DecorativeLetterInheritDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("6A 01 8B F8 8D 4D 90 6A");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), hh_1);
Expand Down Expand Up @@ -234,6 +237,7 @@ namespace DecorativeLetterInheritDialog
case v2_8_X:
case v3_0_0:
case v3_0_X:
case v3_1_0:
byte_pattern::temp_instance().find_pattern("6A 01 50 8D 4D 90 E8");
if (byte_pattern::temp_instance().has_size(1, desc)) {
injector::MakeJMP(byte_pattern::temp_instance().get_first().address(0), ii_1);
Expand Down
Loading

0 comments on commit aa69887

Please sign in to comment.