-
Notifications
You must be signed in to change notification settings - Fork 162
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: preparations for a writer outside of Goblin #389
base: master
Are you sure you want to change the base?
Commits on Jan 23, 2024
-
pe(utils): generic alignment tool
This is a generic function to perform various alignments, this avoids reinventing locally the magic alignment dance and reusable for consumers who may themselves align things.
Configuration menu - View commit details
-
Copy full SHA for 3d1d725 - Browse repository at this point
Copy the full SHA 3d1d725View commit details
Commits on Feb 12, 2024
-
pe(section_table): public constructor for
SectionTable
This is a simple function to assemble a template section table with zeros in the unpredictable fields, it's up to the caller to carry on the fill procedure, e.g. a writer structure which can do the layout. It can automatically set the virtual address and size based on another binary to append it, only the on-disk offsets are left to the caller.
Configuration menu - View commit details
-
Copy full SHA for a690d07 - Browse repository at this point
Copy the full SHA a690d07View commit details -
pe(data_directories): simplify writing data directories
Previously, we were handling the offset ourselves, but we can just use `gwrite_with` to let the offset be moved. We don't need to use the "read" offset, this is only a distraction and can get wrong results sometimes. We only need to write in the order and assume linearity.
Configuration menu - View commit details
-
Copy full SHA for 1e34fbe - Browse repository at this point
Copy the full SHA 1e34fbeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9372220 - Browse repository at this point
Copy the full SHA 9372220View commit details -
pe(data_directories): add
dirs_with_offset
anddata
viewIt is now easy to peek into the data of a data directory and list all directories with their originally parsed offsets.
Configuration menu - View commit details
-
Copy full SHA for e6d2fdc - Browse repository at this point
Copy the full SHA e6d2fdcView commit details -
pe(data_directories): add support for the "reserved" "data directory"
> 216/232 8 Reserved, must be zero According to the table mentioned in https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-data-directories-image-only In the past, we returned errors in case they were present.
Configuration menu - View commit details
-
Copy full SHA for 677f9ac - Browse repository at this point
Copy the full SHA 677f9acView commit details -
pe(utils): expose rva2offset to external consumers
Relative virtual address to disk offset is a classical operation to perform for various things, it is likely this operation won't change and if it changes, we can keep it around and deprecate it quite easily in the next release. An example for external consumers: compute debug directory data offsets from RVAs to write a debug directory.
Configuration menu - View commit details
-
Copy full SHA for 34f7f7f - Browse repository at this point
Copy the full SHA 34f7f7fView commit details -
pe(certificate_table): export
WIN_CERTIFICATE
header- derives additionally `Debug` on it for logging - derives additionally `Pwrite`, `SizeWith` for good developer experience with scroll on it - provides a natural type alias in accordance with `WIN_CERTIFICATE` name
Configuration menu - View commit details
-
Copy full SHA for 335f261 - Browse repository at this point
Copy the full SHA 335f261View commit details -
pe(certificate_table): add EFI certificate types
We forgot those but they come handy in the UEFI ecosystem when you are reading UEFI signature lists.
Configuration menu - View commit details
-
Copy full SHA for 7d7d1c8 - Browse repository at this point
Copy the full SHA 7d7d1c8View commit details -
pe: expose original
bytes
field via functionThere's no reason to render it as private, this enable a user to peek inside the raw structure and perform more complicated reading without holding the original bytes around. Nonetheless, we expose it via a function to make it easier to deprecate it or modify as we need.
Configuration menu - View commit details
-
Copy full SHA for dbdcff1 - Browse repository at this point
Copy the full SHA dbdcff1View commit details -
It can be hard to debug why your writer is not working as intended, here are some `debug!` traces to help in that endeavor.
Configuration menu - View commit details
-
Copy full SHA for 51ba0ed - Browse repository at this point
Copy the full SHA 51ba0edView commit details -
pe(certificate_table): reinforce checks when writing aligned attribut…
…e certificates It's possible that a user may pass an improperly created attribute certificate and the write will cause all sorts of failure. We sprinkle some `debug_assert!` to avoid this.
Configuration menu - View commit details
-
Copy full SHA for d814cbc - Browse repository at this point
Copy the full SHA d814cbcView commit details