PE: Add resource parser
- Addresses issue #350.
Added resource parser implementation as proposed in the issue but with also manifests and fixed version info.
- Added parser for resource entries
- Added parser for
RT_VERSION - Added parser for
RT_MANIFEST - Added integration tests for the parsers
I found a bug related to an alignment. It seems a buffer passed to ResourceStringIterator sometimes aligned with 8 bytes where the case has paddings at the tail (e.g., RT_VERSION in ntdll.dll), but sometimes it doesn't (e.g., PYTHON_INSTALLER_VERSION_INFO).
DEBUG - Parsed next resource string as size 0x24: ResourceString {
len: 0x24,
value_len: 0x4,
type: 0 (Binary Data),
key: "Translation",
key_slice: [54, 00, 72, 00, 61, 00, 6e, 00, 73, 00, 6c, 00, 61, 00, 74, 00, 69, 00, 6f, 00, 6e, 00] (22 bytes),
value_slice: [09, 04, b0, 04] (4 bytes, Correct),
}
DEBUG - 4 bytes remaining
type is too big (2) for 0
is this in a reviewable state ? i can't remember where we left off exactly, a lot of PRs lately :)
friendly ping on state of this :)
@m4b Since it's almost half a year ago, it would be nice to get re-review. Thank you!
looks like CI is failing; rebase?
i will make it priority to review this and get this in once CI passing; i appreciate your patience! please feel free to aggressively ping me if i do not respond :)
@m4b Thank you so much for your review.. it's being >2,000 lines of code. Everything you've concerned should be addressed now. Did double check on my end as well.
@m4b Sorry on a bit delay, I addresses the rest and would like to get the feedback :)
NB: backwards compatible