NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.21k stars 5.83k forks source link

How to export/publish binary annotation legally #2016

Open Godzil opened 4 years ago

Godzil commented 4 years ago

Hi, sorry if that was already asked; I was not able to find an answer.

I've been in disassembling and annotating the boot rom of a device (the WonderSwan and WonderSwan color for the curious) which is obviously copyrighted material; but I would like to be able to distribute the annotation legally without giving the binary itself as distributing it would be illegal of course.

Is there is a way to do that? That would also allow other people to work on it again without the need to share the binary

And if it is not currently possible; that would a really nice feature to have.

Thanks

emteere commented 4 years ago

Can't comment on the legality of what you are trying to do one way or the other

However, you can export to XML and just dump the comments/labels, and not the original bytes. Then if someone would have the binary in the future for whatever reason, they can import the binary, and then import the XML with add to program checked so it will apply it to your open program.

Godzil commented 4 years ago

Well on the legality point of view, the exploration of that ROM was done in the most possible legal way (dumping it myself) and the reason for it is for interoperability reason: to make hardware/software for the device and explore more of the device hardware as there some potentially useful IOs are only used by that ROM and an EEPROM with unknown content up to now. Basically trying to document as much as possible the hardware.

On the XML part, that an idea, feel a bit hackish though but worth a try!

Godzil commented 4 years ago

It does work when exporting the whole thing but seems that the equate are not fully exported which is surprising. But it is too late for me now to dive more into it. Thanks @emteere for the pointers!

emteere commented 4 years ago

The XML is not a perfect copy of everything in the program. It was meant to be somewhat of a common denominator of standard things. However in many cases, it a good enough mechanism, and if there are issues with it, like not exporting the equates directly that should be reported as an issue. There are some things in the XML that haven't kept up with in data types, possibly tags on defined data (settings), or custom calling conventions.

For data types, you can export a .gdt file from all the data types you have defined in the program. Which will give you a pristine set of data definitions.