avast / avast/retdec-idaplugin

Use control flow info from IDA

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

Description

At the moment, when user selects a function to decompile, `retdec` is provided with function's range and a JSON generated from IDA database with metainformation to use. The range is decoded using `retdec` decoder, without any hints on control flow from IDA - just as if `retdec` was used without IDA plugin.

Although `retdec` decoder has an ambition to be as good as IDA, it is not there yet. Moreover, even if it was as good or better, users using `retdec` from `retdec-idaplugin` would probably appreciate if the decompiled result had the same exact control flow as IDA disassembly - things might get confusing otherwise.

Therefore, it would be the best if `retdec` could use control flow information provided by IDA (or any other JSON producer). The following needs to be done in order to make this happen:
1. Add control flow representation capabilities to `retdec-config` - BB ranges, control flow changing instruction, their types, and targets (e.g. (un)cond branches, returns, calls).
2. Modify `retdec-idaplugin` to produce this info into JSON.
3. Modify `retdec`'s `decoder` pass to use this info - each control flow changing instruction is inspected in order to determine its type and targets (i.e. next BBs). It should not be hard to query potential JSON info for this info before `decoder` tries to determine it on its own.

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.