XboxDev / ghidra-xbe

Xbox Executable Format (XBE) Loader Extension for Ghidra SRE framework
85 stars 18 forks source link

Add more headers, implement showing them in the listing #37

Closed thrimbor closed 3 years ago

thrimbor commented 3 years ago

This adds classes for the certificate header, the TLS header, and the library header. All headers are now also shown in the Listing, which looks like this (the XBE shown is from FlatOut 2):

image

The names of the structs and fields are the same as in nxdk.

There's still room for improvement though. The size of the certificate header is currently harcoded to the minimum size, but we know there are XDK versions that add additional fields (this is also the case for the image header, but I implemented it there). This also means that reading the certificate header should be implemented to be able to read its size field, and use that to generate the properly sized struct. I currently use new XbeCertificateHeader().toDataType() to make it clear that ideally we'd use an actual object with meaningful content here.

Some other details were also changed (renaming the package from the default skeleton, making sure all headers are included in the header section instead of only the image header etc.).

thrimbor commented 3 years ago

I updated the PR to give the additional image header fields proper names, read the certificate header and add the additional certificate fields if it's large enough.

mborgerson commented 3 years ago

Awesome, thanks