From 79cd50ade7802b0b6896c73e4b0e43045b3a3488 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 20 Jul 2019 16:51:00 -0400 Subject: [PATCH] fix for pensil --- texthook/engine/engine.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 385a156b..c4bd6c24 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -8211,6 +8211,8 @@ bool InsertPensilHook() for (DWORD i = processStartAddress; i < processStopAddress - 4; i++) if (*(DWORD *)i == 0x6381) // cmp *,8163 if (DWORD j = SafeFindEntryAligned(i, 0x100)) { + // Artikash 7/20/2019: I don't understand how or why this is possible, but I found a game that by default has copy on write memory for its .text section + VirtualProtect((void*)j, 1, PAGE_EXECUTE_READ, DUMMY); HookParam hp = {}; hp.address = j; hp.offset = 8;