Skip to content

Commit f76963b

Browse files
committed
Fixed copying too much into local headers.
Reported by Sea Caspian (j.sea.caspian [at] gmail.com)
1 parent e75438a commit f76963b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MemoryModule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
413413
PAGE_READWRITE);
414414

415415
// copy PE header to code
416-
memcpy(headers, dos_header, dos_header->e_lfanew + old_header->OptionalHeader.SizeOfHeaders);
416+
memcpy(headers, dos_header, old_header->OptionalHeader.SizeOfHeaders);
417417
result->headers = (PIMAGE_NT_HEADERS)&((const unsigned char *)(headers))[dos_header->e_lfanew];
418418

419419
// update position

0 commit comments

Comments
 (0)