-
Notifications
You must be signed in to change notification settings - Fork 129
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
Use control flow info from IDA #7
Comments
I think it needs to go one step further. Currently retdec is only useful as IDA plugin if it can decode file itself - IDA however has a lot of loaders that can take care of complicated binary formats and process something like firmwares even. Ideally retdec should be used what it is designed for - decompilation and use as mush as possible from IDA. I.e. for function decompilation it should be possible for IDA to pass on entire disassembly of the function with resolved symbols (if any) that should aid decompilation. There should be no need for retdec to decode the binary. |
|
I see (2) is certainly a blocker for this. Perhaps the approach to explore here is for plugin to pass a binary block to decompile with the metadata? For example if the function is selected for decompilation, pass the function body as bytecodes (that is accessible from IDA API and since it was loaded is not file format specific) together with any symbolic information (variables, types etc). I got particularly interested in this since RetDec includes PowerPC an I have a custom loader for firmware that I am maintaining which uses PowerPC code. Generally speaking though the main strength of IDA is that disassembly of the code is happening interactively and in the process the data gets refined, variables could be named and typed etc - so just using the binaries and decoding them in RetDec is sort of loosing all that information. |
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 usingretdec
decoder, without any hints on control flow from IDA - just as ifretdec
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 usingretdec
fromretdec-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:retdec-config
- BB ranges, control flow changing instruction, their types, and targets (e.g. (un)cond branches, returns, calls).retdec-idaplugin
to produce this info into JSON.retdec
'sdecoder
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 beforedecoder
tries to determine it on its own.The text was updated successfully, but these errors were encountered: