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

Add parsing for IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS #365

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

aursulis
Copy link
Contributor

@aursulis aursulis commented Feb 6, 2023

@erocarrera I've had a go at doing something for #303. This parses the IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS debug directory entry type according to what I've seen from self-built and Microsoft's own PE files. Their documentation at https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#debug-type is a bit lacking so I've had to invent names for fields etc.

What this doesn't do is pretty print the flags from dump_info. I have another commit for that here: aursulis@0ca80ed however looking at the full output it is really out of place.

Let me know what you think.

@erocarrera erocarrera self-assigned this Aug 26, 2024
@erocarrera erocarrera merged commit 77e233e into erocarrera:master Aug 26, 2024
3 checks passed
@erocarrera
Copy link
Owner

This is great, thanks!

erocarrera added a commit that referenced this pull request Aug 26, 2024
Added additional flags from https://www.pinvoke.dev/debug/image_dll_characteristics
and output the information in dump_info() (based on aursulis/pefile@0ca80ed)
Javagedes added a commit to Javagedes/mu_basecore that referenced this pull request Aug 29, 2024
This commit modifies the PE parsing functionality to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit (erocarrera/pefile#365)
in pefile resulted in efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.
Javagedes added a commit to Javagedes/mu_basecore that referenced this pull request Aug 29, 2024
This commit modifies the PE parsing functionality to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit (erocarrera/pefile#365)
in pefile resulted in efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.
Javagedes added a commit to microsoft/mu_basecore that referenced this pull request Aug 29, 2024
## Description

This commit modifies the PE parsing functionality to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit
(erocarrera/pefile#365) in pefile resulted in
efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.

See: microsoft/mu_tiano_platforms#1025 and
erocarrera/pefile#421

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Validated pipelines build on mu_tiano_platforms

## Integration Instructions

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants