Skip to content

Commit

Permalink
versatile way
Browse files Browse the repository at this point in the history
  • Loading branch information
luojunyuan authored and Artikash committed Dec 14, 2020
1 parent 3aee03a commit 29d2393
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions texthook/engine/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16396,28 +16396,18 @@ bool InsertShinyDaysGameHook()
0xff,0x83,0x70,0x03,0x00,0x00,0x33,0xf6,
0xc6,0x84,0x24,0x90,0x02,0x00,0x00,0x02
};
LPVOID addr = (LPVOID)0x42ad94;
if (::memcmp(addr, bytes, sizeof(bytes)) == 0) {
HookParam hp = {};
hp.address = 0x42ad9c;
hp.text_fun = SpecialGameHookShinyDays;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT ShinyDays");
NewHook(hp, "ShinyDays 1.00");
return true;
}
addr = (LPVOID)0x42b7f4;
if (::memcmp(addr, bytes, sizeof(bytes)) == 0) {
HookParam hp = {};
hp.address = 0x42b7fc;
hp.text_fun = SpecialGameHookShinyDays;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT ShinyDays");
NewHook(hp, "ShinyDays 1.00d");
return true;

for (auto addr : Util::SearchMemory(bytes, sizeof(bytes))) {
HookParam hp = {};
hp.address = addr + 0x8;
hp.text_fun = SpecialGameHookShinyDays;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("Textractor: INSERT ShinyDays");
NewHook(hp, "ShinyDays");
return true;
}

ConsoleOutput("vnreng:ShinyDays: only work for 1.00 and 1.00d");
ConsoleOutput("Textractor:ShinyDays: pattern not found");
return false;
}

Expand Down

0 comments on commit 29d2393

Please sign in to comment.