summaryrefslogtreecommitdiff
path: root/pe.c
diff options
context:
space:
mode:
Diffstat (limited to 'pe.c')
-rw-r--r--pe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pe.c b/pe.c
index ba3e2bbc..9a3679e1 100644
--- a/pe.c
+++ b/pe.c
@@ -1196,6 +1196,9 @@ handle_image (void *data, unsigned int datasize,
CopyMem(buffer, data, context.SizeOfHeaders);
+ /* Flush the instruction cache for the region holding the image */
+ cache_invalidate(buffer, buffer + context.ImageSize);
+
*entry_point = ImageAddress(buffer, context.ImageSize, context.EntryPoint);
if (!*entry_point) {
perror(L"Entry point is invalid\n");
@@ -1256,7 +1259,7 @@ handle_image (void *data, unsigned int datasize,
}
if (Section->VirtualAddress <= context.EntryPoint &&
- (Section->VirtualAddress + Section->SizeOfRawData - 1)
+ (Section->VirtualAddress + Section->Misc.VirtualSize - 1)
> context.EntryPoint)
found_entry_point++;