-
Notifications
You must be signed in to change notification settings - Fork 163
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
Public utils + more examples #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me modulo the dev dep, thanks for the PR!
Generic case is possible but you’ll need a TryFromCtx bound. Probably not worth the trouble for an example :)
See official microsoft pe format documentation it names CLR |
@Pzixel In my opinion, to make changes that are consistent with the documentation and ESMA-335, you should send an issue to https://github.com/MicrosoftDocs, and then, when it is approved, change it in this repo. |
Yep, but ECMA-335 conserns CLI specification (not .Net as you said) and this header is specifically CLI header, so it must be the most competent in this question. However, you are right that docs should be updated. I'm creating an issue. However, I don't see corresponding repository for it. |
So what is the resolution (if any) for CLR/CLI data directory naming ? I would prefer to not make a breaking change and I used the original documentation that @kgv linked. We can always update it in a later PR if need be. And thanks for both your investigations here! |
@m4b I created a PR in MS documentation repo, however, it keeps silent. It looks like it takes 2-3 days until someone react on it. I can revert this change if you wish, OTOH I have strong feeling that CLI specification is more compenent in this question. |
I reverted rename change. P.S. I wonder why you keep rust 1.20. It doesn't make sense to me since rust is pretty well backward compatible. |
Ping? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo comments I think this is ready to go. I will probably squash the commits since many of them aren’t informative or are fixes
src/pe/utils.rs
Outdated
@@ -74,3 +76,24 @@ pub fn try_name<'a>(bytes: &'a [u8], rva: usize, sections: &[section_table::Sect | |||
} | |||
} | |||
} | |||
|
|||
pub fn get_data<'a, T>(bytes: &'a [u8], sections: &[section_table::SectionTable], directory: &DataDirectory, file_alignment: u32) -> Result<T, DataDirectoryConversionError> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it belongs as a method in DataDirectories ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, because it belongs to SectionTable as well.. Utils is the good place for this imo
Pong? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for this @Pzixel !
Fixes #115