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

PE: Support multiple debug directories and VCFeature, Repro, ExDllCharacteristics, POGO parsers #403

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

kkent030315
Copy link
Contributor

@kkent030315 kkent030315 commented Apr 12, 2024

This PR addresses the issue #314.

- The change is straightforward. It makes the DebugData::image_debug_directory: ImageDebugDirectory into Vec<ImageDebugDirectory> as someone pointed out in the #314 (comment). So this is to be an breaking change.
- There is another addition of VC feature metadata IMAGE_DEBUG_TYPE_VC_FEATURE (IMAGE_DEBUG_VC_FEATURE_ENTRY) in the debug directory.

If anyone have suggestion of making this semantics without breaking the backward compatibility I am open to discuss.


update:

  • (22e1a3a) Refactored DebugData and its parsers for comfortable code that makes multiple debug directories in mind.
    • TE::fixup_debug_data has been merged to DebugData::parse_*: As DebugData is now more compatible with TE (Terse Executable) by adding DebugData::parse_with_opts_and_fixup and fixup RVA field in DebugData and ImageDebugDirectoryIterator in order if any fixup is required for ImageDebugDirectory::address_of_raw_data and ImageDebugDirectory::pointer_to_raw_data.
  • (04dad2d) Added decent documentation for structs and its fields, constants in pe::debug.
  • (04dad2d) Added parser for IMAGE_DEBUG_TYPE_VC_FEATURE.
  • (04dad2d) Added parser for IMAGE_DEBUG_TYPE_REPRO.
  • (04dad2d) Added parser for IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS.
  • (24879d6) Added parser for IMAGE_DEBUG_TYPE_POGO.
  • (04dad2d) Added decent integration tests for DebugData parsers.
  • (22e1a3a) (bfa48ca) Removed impl ImageDebugDirectory and it has been merged to DebugData::parse_*.

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fine to me, other than the fixes w.r.t. &Vec<T> -> &[T]

src/pe/debug.rs Outdated Show resolved Hide resolved
src/pe/debug.rs Outdated Show resolved Hide resolved
src/pe/debug.rs Outdated Show resolved Hide resolved
src/pe/debug.rs Outdated Show resolved Hide resolved
src/pe/debug.rs Outdated Show resolved Hide resolved
src/pe/debug.rs Outdated Show resolved Hide resolved
@m4b
Copy link
Owner

m4b commented May 13, 2024

@kkent030315 thanks for this PR, I think if we fix the basic nits this is ready to go, thank you!

@m4b
Copy link
Owner

m4b commented May 20, 2024

I'd also like to see this one go in for sure :)

@kkent030315
Copy link
Contributor Author

@m4b Thank you for the review! I'm going to mess with this PR very soon.

@kkent030315 kkent030315 changed the title PE: Support multiple debug directories and VCFeature metadata PE: Support multiple debug directories and VCFeature, Repro, ExDllCharacteristics parsers Oct 28, 2024
@kkent030315
Copy link
Contributor Author

@m4b Hi, this PR has been refactored, please take a look #403 (comment) for up-to-date changelists.
Since there's lots of things changed and a little bit challenging code I guess so I'd like to get your review again. Thank you :)

@kkent030315 kkent030315 changed the title PE: Support multiple debug directories and VCFeature, Repro, ExDllCharacteristics parsers PE: Support multiple debug directories and VCFeature, Repro, ExDllCharacteristics, POGO parsers Oct 28, 2024
@kkent030315 kkent030315 deleted the tls branch November 18, 2024 20:14
@kkent030315 kkent030315 restored the tls branch November 19, 2024 15:22
@kkent030315 kkent030315 reopened this Nov 19, 2024
@kkent030315 kkent030315 mentioned this pull request Nov 19, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants