Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IWin32Resource::WriteToDirectory does not take sorting into account #532

Closed
Washi1337 opened this issue Mar 8, 2024 · 0 comments · Fixed by #553
Closed

IWin32Resource::WriteToDirectory does not take sorting into account #532

Washi1337 opened this issue Mar 8, 2024 · 0 comments · Fixed by #553
Labels
bug win32resources Issues related to AsmResolver.PE.Win32Resources
Milestone

Comments

@Washi1337
Copy link
Owner

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 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.

Additional Context

https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#resource-directory-entries

@Washi1337 Washi1337 added bug win32resources Issues related to AsmResolver.PE.Win32Resources labels Mar 8, 2024
@Washi1337 Washi1337 changed the title IWin32Resource::WriteToDirectory does not take sorting into account IWin32Resource::WriteToDirectory does not take sorting into account Mar 8, 2024
@Washi1337 Washi1337 added this to the 6.0.0 milestone Mar 15, 2024
@Washi1337 Washi1337 linked a pull request Apr 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug win32resources Issues related to AsmResolver.PE.Win32Resources
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant