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
Some raw types for your elf pattern. #34
Comments
Finally got around to implement those into a pattern that basically has feature-parity with the 010 template |
Super-awesome. I'm glad it worked out and we can slowly dethrone 010 with opensource. ;-) I think this is a small thing, but it seems that the Elf32_Phdr and Elf32_Shdr fields were missed. I noticed it because of the '@' pointer syntax. ImHex-Patterns/patterns/elf.hexpat Lines 733 to 738 in 62b1eb9
With your example on choosing the type for the section contents (ElfXX_Shdr), it seems that I might be able to add the definitions for the section header types and copy the logic for the program header types too.. which'd get it pretty close to PT_DYNAMIC and verdef/verneed/versym. I'll try to work on a PR for those. |
You're right I forgot to add those, thank you! The most annoying thing was really just to write the whole pattern twice basically, once for 32 bit and once for 64 bit. There's currently no way to conditionally define types which made it harder. Other than that, the types you gave me were great and didn't need many changes If you'd like to make PRs for anything, please absolutely feel free :) |
Here's that raw data for your elf pattern that I promised.
First of all, some apologies for not making this into a proper PR as since I don't actually use ImHex I don't have it forked or anything (ui allergies, but I'm still an admirer). Plus, I didn't want to smash up the original elf pattern since I haven't tested this data with your parser. Hence it still being raw.
Also an apology for not doing the conditionals that glue the fields together, or that switch between types based on the values in the headers. As you can imagine that requires parsing logic out of my definitions, and rigging things with Python's ast library would definitely be more time consuming than just a simple type conversion.
In my definitions, I have the header split out, and then based on the header I use either the Elf32 or the Elf64 types.
Some of the bitfields might be wrong because they're in "microsoft-order" which is high-bit first, and it's a little bit clumsy because the byteorder can change based on E_DATA. So those bitfields should be little-endian.
for-werwolv.txt
If there's something you think I can fix, or that would make it easier for you to fit within your syntax, let me know as I can generate these again.
The text was updated successfully, but these errors were encountered: