From 9e480a552eaabd4cb70b1eb27f4c1d75800ac7e3 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Sun, 24 Oct 2010 22:19:26 +0200 Subject: [PATCH] use correct size for sections that have no raw size defined but define their data size --- MemoryModule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MemoryModule.c b/MemoryModule.c index d9b2d0d..c883317 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -162,7 +162,7 @@ FinalizeSections(PMEMORYMODULE module) if (size > 0) { // change memory access flags - if (VirtualProtect((LPVOID)((POINTER_TYPE)section->Misc.PhysicalAddress | imageOffset), section->SizeOfRawData, protect, &oldProtect) == 0) + if (VirtualProtect((LPVOID)((POINTER_TYPE)section->Misc.PhysicalAddress | imageOffset), size, protect, &oldProtect) == 0) #ifdef DEBUG_OUTPUT OutputLastError("Error protecting memory page") #endif