Fixed copying too much into local headers.

Reported by Sea Caspian (j.sea.caspian [at] gmail.com)
This commit is contained in:
Joachim Bauch
2013-12-12 10:14:51 +01:00
parent e75438a006
commit f76963b8ea
+1 -1
View File
@@ -413,7 +413,7 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data,
PAGE_READWRITE);
// copy PE header to code
memcpy(headers, dos_header, dos_header->e_lfanew + old_header->OptionalHeader.SizeOfHeaders);
memcpy(headers, dos_header, old_header->OptionalHeader.SizeOfHeaders);
result->headers = (PIMAGE_NT_HEADERS)&((const unsigned char *)(headers))[dos_header->e_lfanew];
// update position