-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add UEFI support #23
Comments
Hi, i don't know much about UEFI. Is it similar to an executable format like ELF? haven't look close at the go package, for fq to be able to use it you probably have to have some kind of API that supports iterate thru strucutres or some way of accessing offsets/lengths where things are located. |
It is basically a tree structure, where roughly speaking on the leafs it may contain PE32 or other files.
Yeah, this is exactly what fiano/pkg/uefi package is about (for UEFI layouts). |
Ok! Interesting, and PE32 here is a 32-bit portable executable (windows exe)? Don't have much to look into it right now but it would be helpful for me or someone who wants to work on it to have some resources like small examples files or links to tools to create own files. |
Yeaaaaah. I also was a bit shocked when found out they use EXE files inside UEFI images. Though it works different (from Windows) there, but the executable container is the same, yes.
At this stage I was just wondering if this makes sense, just to keep this opportunity in mind :) |
Feels like it could be a good fit. Also fq has infrastructure to do "subformat" decoding so once where is a PE decode (or other formats in UEFI) it could automatically do nested decoding. Im currently working on a much improved ELF decoder (https://github.com/wader/fq/tree/elf if you want to sneak peak) and i hope PE is not that much different, but i've heard it's quite legacy heavy :) |
I am working on adding MBR support for looking at the 512 byte section of bootable iso images. I'll look into UEFI next since that's the successor to the legacy MBR BIOS booting scheme. |
@tlehman Great to hear! Feel free to open issues or give me a shout if you have any questions |
BTW i've thought about adding x86, arm, etc ISA decoders to fq if that is interesting for MBR, UEFI etc?. Have some branch somewhere with an early prototype that add text section decode to the elf decoder and even do some symbol resolution |
Yes! MBR is 16bit x86 only. Since it's a special rigid format, it may even work to disassemble it and view the instructions. For my first pass, I just want to identify the regions used for the partition table, the post message and the other parts that the BIOS expects. |
Sounds like a good plan. A strategy i've used to decode formats i don't know much about it so try not decode to "deep" at first but instead try decode most size, length fields etc and add raw fields to begin with to verify and get overall feel of the format. After that start add depth and details. I will try cleanup the prototype ISA branch so you can have a look. My idea is to have separate formats for ISAs so ex a |
@tlehman Here is a PR with a cleaned up version of my old branch #215 the symbol lookup stuff seems to be broken. I don't really remember if it ever worked. Probably need some rethinking and it's not unlikely i've misunderstood how it works. If you want to work on it feel free to use it or totally redo it another way :) |
@tlehman Hi, i think what is missing is an import in The documentation is lacking a bit but there is some general help for adding a decoder here https://github.com/wader/fq/blob/master/doc/dev.md#implement-a-decoder and also some dev tips how to generate actual test output and documentation here https://github.com/wader/fq/blob/master/doc/dev.md#development-tips |
Awesome, thank you! |
👍 My usual workflow is to run/iterate with Also useful to do things like |
Yeah I would love to see a "from 0 to 1, how to add a new binary format to fq". This comment goes most of the way, can you add this or link to it from the README? |
That is a good idea, i should come up with some format that can show most decode api concepts 🤔 maybe should be directly linked to from the readme for visibility |
Just in case wondering: does it make sense to add support of UEFI files (using https://github.com/linuxboot/fiano)?
The text was updated successfully, but these errors were encountered: