Update Leaf.cpp

This commit is contained in:
恍兮惚兮 2024-02-15 14:09:12 +08:00
parent 5e45fc7e53
commit 270b7722f8

View File

@ -581,9 +581,37 @@ bool InsertAquaplus2Hook()
hp.filter_fun = AquaplusFilter;
return NewHook(hp, "Aquaplus2");
}
bool InsertAquaplus3Hook()
{
/*
* Sample games:
* Dungeon Travelers 2: The Royal Library & the Monster Seal
*/
const BYTE bytes[] = {
0xCC, // int 3
0x80, 0x3D, XX4, 0x00, // cmp byte ptr [DT2_en.exe+3052EC],00 << hook here
0x75, 0x67, // jne DT2_en.exe+89DC0
0x56, // push esi
0xBA, XX4 // mov edx,DT2_en.exe+3051E0
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:Aquaplus3: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr + 1;
hp.offset = get_reg(regs::eax);
hp.index = 0;
hp.type = CODEC_UTF8 | USING_STRING | NO_CONTEXT;
hp.filter_fun = NewLineCharToSpaceFilterA;
return NewHook(hp, "Aquaplus3");
}
bool InsertAquaplusHooks()
{ return InsertAquaplus1Hook() || InsertAquaplus2Hook();}
{ return InsertAquaplus1Hook() || InsertAquaplus2Hook()||InsertAquaplus3Hook();}
namespace{
bool kizuato(){