From 66fbff28ba3ddd2431307317b0b7fe587e6a404a Mon Sep 17 00:00:00 2001 From: DDWSdwqdq <53893117+DDWSdwqdq@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:30:10 +0800 Subject: [PATCH] Update engine.cc --- texthook/engine/engine.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 2c3b617..4e4b97f 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -9470,6 +9470,24 @@ void SpecialHookWillPlusA(DWORD esp_base, HookParam *, BYTE index, DWORD *data, bool InsertWillPlusAHook() { + //by iov + const BYTE bytes2[] = { 0x8B,0x00,0xFF,0x76,0xFC,0x8B,0xCF,0x50 }; + ULONG range2 = min(processStopAddress - processStartAddress, MAX_REL_ADDR); + ULONG addr2 = MemDbg::findBytes(bytes2, sizeof(bytes2), processStartAddress, processStartAddress + range2); + if (addr2) { + HookParam myhp = {}; + myhp.address = addr2 + 2; + + myhp.type = USING_UNICODE | NO_CONTEXT | USING_STRING; + + myhp.offset = pusha_eax_off - 4;//esp+4 + + char nameForUser[HOOK_NAME_SIZE] = "WillPlus3_memcpy"; + NewHook(myhp, nameForUser); + ConsoleOutput("Insert: WillPlus3_memcpy Hook"); + return true; + } + const BYTE bytes[] = { 0x81,0xec, 0x14,0x08,0x00,0x00 // 0042B5E0 81EC 14080000 SUB ESP,0x814 ; jichi: text in eax, name in eax - 1024, able to copy };