-
Notifications
You must be signed in to change notification settings - Fork 160
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
Extract PDR section of Flash #36
Conversation
FlashRegionSectionType already parses PdrBase and PdrLimit. This bit of the code just makes sure that FlashDescriptor uses that information to extract that region out.
You should also add reserved regions, which are typical for SPS systems. Take SPSFullME.bin file from this archive as example. Thanks to @lordkag for finding it. |
So I had a look around the UEFI Spec and I can't seem to find anything that specs out the reserved regions. Does anyone know where these are documented or is this just something that SPS Systems use that is out of spec? I think this should be a separate feature request because this would require changing the structs definitions in here: https://github.com/theopolis/uefi-firmware-parser/tree/master/uefi_firmware/structs @theopolis The test seems to be failing because of SSH hanging at key-auth, is this something you can fix? |
@timevortex the tests attempt to pull from a private repo using an encrypted ssh private key. The key is encrypted using Travis' API with the assumption that their build hosts will be able to decrypt. There's no sensitive information in this private repo but it does host vendor-copyrighted UEFI/firmware distributions so I cannot rehost them, publicly, legally. It looks like (from a small bit of debugging), that Travis is only decryption the key for branched to this repo, as opposed to anyone's branch an the appropriate PR. |
I actually don't mind that the private repo "uefi-firmware-samples" can be "leaked". I can embed a deploy key, that's not encrypted, into the |
Thanks for re-running the test!
This seems OK given that we're probably extracting the extra PDR region for this flash now. @theopolis, is this ready for merging or is there anything else? |
"base": pdr_base, | ||
"limit": pdr_limit, | ||
}) | ||
pdr_region.process() |
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.
Usually the return boolean within .process()
should be the return off all the inter-processing. But since the flash processing already violates this we should be OK to merge.
Sure, I'll take care of the tests in a follow up PR. Thanks @timevortex! |
Extract PDR section of Flash
Cheers! Happy to help. I'm happy to contribute more as well. This was a simple change but for other request I think I want make sure you're onboard as well. e.g. #35 probably requires some major code restructuring. I'm happy to do it but I don't want to send you a PR that's huge and unexpected! |
Yeah that'd be great! I'm happy to test offline if needed. I'm also sending some emails to figure out if I can just open the samples repository. There is a script in that private repo that tracks the expected number of "objects" discovered in each-- that's used to make sure no code changes remove functionality. But if we're adding more parsing then those should be updated inline to reflect the new (larger) counts. |
FlashRegionSectionType already parses PdrBase and PdrLimit. This bit of the code just makes sure that FlashDescriptor uses that information to actually extract that region out.
I've tested this against a BIOS that has PDR section and it seems to work fine:
8192 bytes for the PDR region is correct - confirmed by extracting using UEFIExtract:
Diff confirms that the outputs between UEFIExtract and uefi_firmware are identical :)