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

read/pe: add ExportTable #353

Merged
merged 1 commit into from
Aug 17, 2021
Merged

read/pe: add ExportTable #353

merged 1 commit into from
Aug 17, 2021

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Aug 16, 2021

Also:

  • fix parsing of export tables that have no names
  • add parsing of strings for forwarded exports
  • add more support in readobj example
  • some arbitrary style changes

cc @daladim

Copy link
Contributor

@daladim daladim left a comment

Choose a reason for hiding this comment

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

Thanks for notifying me of these changes :)

And thanks for upgrading my work to a first-class ExportTable

src/read/pe/export.rs Show resolved Hide resolved

/// Return the forward string if the export address table entry is a forward.
pub fn forward_string(&self, address: u32) -> Result<Option<&'data [u8]>> {
let offset = address.wrapping_sub(self.virtual_address) as usize;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not reuse is_forward for these first two lines, that would de-duplicate them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we need the offset value, which is_forward doesn't return. I've moved these lines into a new function.

Also:
- fix parsing of export tables that have no names
- add parsing of strings for forwarded exports
- add more support in readobj example
- some arbitrary style changes
@philipc philipc merged commit c33bf5a into gimli-rs:master Aug 17, 2021
@philipc philipc deleted the pe_export branch August 17, 2021 02:11
mcbegamerxx954 pushed a commit to mcbegamerxx954/object that referenced this pull request Jun 15, 2024
Also:
- fix parsing of export tables that have no names
- add parsing of strings for forwarded exports
- add more support in readobj example
- some arbitrary style changes
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