Skip to content
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

Propagate modified binary data to RetDec for decompilation #50

Open
PeterMatula opened this issue Sep 16, 2019 · 0 comments
Open

Propagate modified binary data to RetDec for decompilation #50

PeterMatula opened this issue Sep 16, 2019 · 0 comments
Assignees

Comments

@PeterMatula
Copy link
Collaborator

Currently, IDA plugin passes the original binary file to RetDec for decompilation. This has several problems:

  1. 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.
  2. If input file gets rebased, RetDec decompiles something completely different than intended - see Decompilation of object or rebased files #15 for more details.
  3. The same goes for potential custom plugins - see Custom loader plugin decompilation output is nonsense #30 for more details.
  4. 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.

@PeterMatula PeterMatula added this to the RetDec IDA plugin v1.0 milestone Sep 16, 2019
@PeterMatula PeterMatula self-assigned this Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant