Skip to content

Commit 9e480a5

Browse files
committed
use correct size for sections that have no raw size defined but define their data size
1 parent 178ea73 commit 9e480a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

MemoryModule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ FinalizeSections(PMEMORYMODULE module)
162162

163163
if (size > 0) {
164164
// change memory access flags
165-
if (VirtualProtect((LPVOID)((POINTER_TYPE)section->Misc.PhysicalAddress | imageOffset), section->SizeOfRawData, protect, &oldProtect) == 0)
165+
if (VirtualProtect((LPVOID)((POINTER_TYPE)section->Misc.PhysicalAddress | imageOffset), size, protect, &oldProtect) == 0)
166166
#ifdef DEBUG_OUTPUT
167167
OutputLastError("Error protecting memory page")
168168
#endif

0 commit comments

Comments
 (0)