mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Based on the definition of the "BaseOfData" field as found in the official documentation ( https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-standard-fields-image-only ), and confirmed via a PE32+ SQL Server DLL (sqlaccess): 1. Updated the "Meaning" to include: 1. the value that this particular value is relative to (i.e. "ImageBase"). 2. the fact that this value is _not_ present in PE32Plus (only regular 'ol PE32): 1. Placed this info at the beginning (i.e. far left) of the "Meaning" to increase visibility and reduce the chances of it not being seen (since it might be unexpected to simply not exist for certain images). 2. Intentionally stated both that it's not present in PE32Plus, _and_ only present in PE32, to be as clear as possible as to why the offset is 0 for PE32Plus. 2. Updated the "Offset" to be conditional, based on whether or not image is PE32Plus (same condition used for "Size" and "Value"). It now shows 0 for PE32Plus as this field does not exist under this condition. Showing a 0 offset is preferable to removing this field / entry entirely as that might lead to confusion for those who would have no idea why this field / entry was missing. 3. Updated the "Value" to be a literal 0 (ulong; was reading next UInt64 from the header). 4. Updated the "Size" to be 0 if image is PE32Plus (was 8 bytes). Also: 5. Simplified multiple occurrences of `header.Magic == PEMagic.PE32Plus` test with a new variable: `isPE32Plus`.pull/2153/head
1 changed files with 7 additions and 6 deletions
Loading…
Reference in new issue