The PE file format states that entries in the resource directories should be sorted. Currently, IconResource and VersionResource do not take this into account. This results in resources not getting interpreted by Windows (e.g., adding GroupIcon before Icon removes the icons from explorer).
How To Reproduce
Open the hello world test program as a PEImage with no win32 resources.
Add an IconResource.
Save using ManagedPEFileBuilder.
Expected Behavior
The directories are added in the following order: Icon, GroupIcon.
Actual Behavior
The GroupIcon directory is added before the Icon directory.
AsmResolver Version
5.5.1
.NET Version
.NET 6.0
Operating System
Windows
Describe the Bug
The PE file format states that entries in the resource directories should be sorted. Currently,
IconResource
andVersionResource
do not take this into account. This results in resources not getting interpreted by Windows (e.g., adding GroupIcon before Icon removes the icons from explorer).How To Reproduce
PEImage
with no win32 resources.IconResource
.ManagedPEFileBuilder
.Expected Behavior
The directories are added in the following order:
Icon
,GroupIcon
.Actual Behavior
The
GroupIcon
directory is added before theIcon
directory.Additional Context
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#resource-directory-entries