Mercurial > pub > dyncall > dyncall
comparison dynload/dynload_syms_pe.c @ 425:2d9f1cb06352
- dynload: corrected comparison of size of optional PE header info to what is pointed to (ptr arithmetic was incorrect, only broke ReactOS builds and runtime, though)
author | Tassilo Philipp |
---|---|
date | Fri, 17 Dec 2021 18:50:58 +0100 |
parents | a29af998e457 |
children |
comparison
equal
deleted
inserted
replaced
424:1e65b8911603 | 425:2d9f1cb06352 |
---|---|
59 base = (const char*)pLib; | 59 base = (const char*)pLib; |
60 pDOSHeader = (IMAGE_DOS_HEADER*)base; | 60 pDOSHeader = (IMAGE_DOS_HEADER*)base; |
61 pNTHeader = (IMAGE_NT_HEADERS*)(base + pDOSHeader->e_lfanew); | 61 pNTHeader = (IMAGE_NT_HEADERS*)(base + pDOSHeader->e_lfanew); |
62 | 62 |
63 /* optional header present and big enough? this header should exist as it's only optional for object files */ | 63 /* optional header present and big enough? this header should exist as it's only optional for object files */ |
64 if(pNTHeader->FileHeader.SizeOfOptionalHeader < (&pNTHeader->OptionalHeader.DataDirectory - &pNTHeader->OptionalHeader)) | 64 if(pNTHeader->FileHeader.SizeOfOptionalHeader < ((char*)&pNTHeader->OptionalHeader.DataDirectory - (char*)&pNTHeader->OptionalHeader)) |
65 return NULL; | 65 return NULL; |
66 | 66 |
67 /* export table available? */ | 67 /* export table available? */ |
68 if(pNTHeader->OptionalHeader.NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_EXPORT) | 68 if(pNTHeader->OptionalHeader.NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_EXPORT) |
69 return NULL; | 69 return NULL; |