goblin icon indicating copy to clipboard operation
goblin copied to clipboard

PE: Add resource parser

Open kkent030315 opened this issue 1 year ago • 2 comments

  • 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

kkent030315 avatar Oct 31 '24 12:10 kkent030315

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

kkent030315 avatar Jan 04 '25 01:01 kkent030315

is this in a reviewable state ? i can't remember where we left off exactly, a lot of PRs lately :)

m4b avatar Jan 05 '25 17:01 m4b

friendly ping on state of this :)

m4b avatar Jun 16 '25 04:06 m4b

@m4b Since it's almost half a year ago, it would be nice to get re-review. Thank you!

kkent030315 avatar Jun 16 '25 06:06 kkent030315

looks like CI is failing; rebase?

m4b avatar Jul 07 '25 03:07 m4b

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 avatar Jul 07 '25 03:07 m4b

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

kkent030315 avatar Jul 07 '25 13:07 kkent030315

@m4b Sorry on a bit delay, I addresses the rest and would like to get the feedback :)

kkent030315 avatar Jul 18 '25 09:07 kkent030315

NB: backwards compatible

m4b avatar Jul 26 '25 20:07 m4b