Assemblies embedded within a single-file are aligned at 16 byte boundaries.
However, MappedImageLayout assumes that assemblies are mapped at 4K offsets.
The mmap() call here is incorrect when offset is not a multiple of 4096. This results in map failure and subsequent failure to load the image in a mapped layout. Subsequently, the image is loaded as IL as a fallback.
The work in this issue is to try and fix this problem by:
mmap() pages containing sections/headers using appropriate ROUND_DOWN and ROUND_UP operations
- Zero out any contents of mapped pages containing data with inappropriate permissions
- Load sections at unaligned offsets in
MAPMapPEFile.