-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add IDA Pro brancher. #868
Conversation
Specify --brancher=ida to utilize IDA's brancher information. Adapted from BinaryAnalysisPlatform#550 for BinaryAnalysisPlatform#861.
plugins/ida/ida_main.ml
Outdated
@@ -136,13 +136,103 @@ let loader path = | |||
else code, Memmap.add data mem sec) in | |||
Project.Input.create arch path ~code ~data | |||
|
|||
let int64_to_word arch = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A constant width (32) was used in #550: I thought that this was more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, thanks!
A couple of changes that we need to do before we can merge it:
-
switch to a more efficient data representation (e.g., a hashtable)
-
use word everywhere as soon as possible (it's fine to use int64 as a wire format, but after we receive it, let's use
word
for everything) -
Do not use
assoc_opt
it is not available on many versions of compiler (also do not use OCaml stdlib, use Core_kernel instead). -
Do not rely on the default brancher (which is not guaranteed to be default), use
Insn.is_conditional
to determine the kind of the other flow branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
These changes allow a user to specify the argument '--brancher=ida' to ask BAP to utilize IDA's brancher information. These changes have been adapted from pull request #550 for #861. Pull request #550 was also concerned with kernel symbol recovery; only the changes specific to brancher information from IDA have been used in the current changes. The bap-ida-python repository also needs some complementary changes, which can be viewed here.