avast / avast/retdec-idaplugin

Propagate modified binary data to RetDec for decompilation

Open
#50 0 comments 0 reactions 1 assignee Claimed by @PeterMatula View on GitHub
enhancement
Dominant language
C++
Stars
799
Forks
132
PR merge metrics
No merged PRs in 30d

Description

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 #15 for more details.
3. The same goes for potential custom plugins - see #30 for more details.
4. Also, passing the original binary limits decompilations only to files that RetDec can handle - see #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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.