-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
Currently, IDA plugin passes the original binary file to RetDec for decompilation. This has several problems:
- If user modifies the binary, modification is done on a loaded image inside IDA - the original binary is not modified. Therefore, RetDec decompiles the original, not the modified version - modification is not reflected in the output.
- If input file gets rebased, RetDec decompiles something completely different than intended - see Decompilation of object or rebased files #15 for more details.
- The same goes for potential custom plugins - see Custom loader plugin decompilation output is nonsense #30 for more details.
- Also, passing the original binary limits decompilations only to files that RetDec can handle - see Support of DOL and REL file formats (Gamecube Wii) #14 for more details.
A possible solution is to apply (path) changes to the original binary before the decompilation. This would however not solve problem 4. and I'm if it would work for problems 2. and 3.
The best solution would be to establish a communication channel (callback function) between IDA and RetDec, which could be used by RetDec to query IDA about bytes on addresses as needed. Ghidra decompiler does it this way. However, this is currently not possible since RetDec is not a library.
Encoding all the data to JSON config could be a solution that would solve all the problems.