LIEF
LIEF copied to clipboard
PE: Expose group_icon resource
Currently, LIEF has the ability to expose ICON resources, but omits GROUP_ICON resources. These resources combine multiple ICON resources. Rebuilding these is probably more useful than all separate icon files.
See https://blogs.msdn.microsoft.com/oldnewthing/20120720-00/?p=7083
I disagree, "GROUP_ICON" are exposed here: https://github.com/lief-project/LIEF/blob/79a5d0e93be82878efdb36282798a34950bce893/src/PE/ResourcesManager.cpp#L587-L611
Feel free to re-open it.
Ah, I see that there is some support for group icons. I missed that, that is also not very clear from the documentation. However, as far as I can see, there is no API to extract the entire group icon, or to add a group icon structure.
As far as I understand it, a groupicon is a resource of different icons, for instance with different resolutions. At this point, an icon is considered a separate object, that is decoupled from its group in the API. You can't extract the entire .ico file that is present in the PE file, you can only extract a single icon with a generic header.
I would expect some structure like this:
ResourcesManager -> GroupIcon -> Icon
Where the GroupIcon resource also has a save option, that saves the .ico file with all different icons in it, and the Icon may still be accessible through the current means. But this way, you can also add new GroupIcon structures if needed.
Perhaps I'm still mistaken, but perhaps this makes my point more clear.
@romainthomas I'm unable to re-open this issue, but this highlight should be enough to get your attention.
Ok I see. From my point of view it's not a priority as you can save the icons by iterating on the icons
attribute. For the modification part, It would be nice but I'm focused on the Mach-O modification at this moment.
Feel free you contribute :)