-
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
Nearly fully documented the optional PE header. #399
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.
to be honest this is quite a lot of documentation to review, though not a bad thing, thank you for the PR! What a strange world we're entering with gen ai though :)
my only major concerns are about the various doc aliases, they appear to alias things that don't exist, and i think that should be fixed before merging
pub characteristics: u16, | ||
} | ||
|
||
pub const SIZEOF_COFF_HEADER: usize = 20; | ||
/// PE\0\0, little endian | ||
pub const PE_MAGIC: u32 = 0x0000_4550; | ||
pub const SIZEOF_PE_MAGIC: usize = 4; | ||
/// The contents of this field are assumed to be applicable to any machine type | ||
|
||
// Q (JohnScience): doesn't it make sense to move all these constants to a dedicated module |
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.
possibly, yes; it's what we do for other formats iirc
// Q (JohnScience): doesn't it make sense to move all these constants to a dedicated module | ||
// and then re-export them from here? This way, the module will be more organized. | ||
// | ||
// Also, don't we want to declare them in a macro to remove the boilerplate and make the implementation |
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.
file a issue if you feel theres room for improvement :)
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.
@m4b I will do so and leave a TODO item with the explanation.
#[derive(Debug, PartialEq, Copy, Clone, Default)] | ||
pub struct Header { | ||
pub dos_header: DosHeader, | ||
/// DOS program for legacy loaders | ||
pub dos_stub: DosStub, | ||
|
||
// Q (JohnScience): should we care about the "rich header"? | ||
// https://0xrick.github.io/win-internals/pe3/#rich-header |
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 might be a good thing if it is real and people use it for stuff 🤷
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.
@JohnScience would you mind filing an issue for the rich header?
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.
@m4b It is mostly useful for cybersecurity.
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.
@JohnScience would you mind filing an issue for the rich header?
Done, #400
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.
thanks!
release: non-breaking |
Doc aliases improve the searchability of various items by allowing users finding them by their Windows name. See Rustdoc > Advanced features > Add aliases for an item in documentation search |
There's still some work needed for documentation of data directories field in the optional header but it's a separate module.
This PR also...
dll_characteristic
andsubsystem
).