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

Add IDA Pro brancher. #868

Merged
merged 2 commits into from
Sep 6, 2018
Merged

Conversation

abhcs
Copy link
Contributor

@abhcs abhcs commented Sep 5, 2018

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.

Specify --brancher=ida to utilize IDA's brancher information. Adapted from BinaryAnalysisPlatform#550 for BinaryAnalysisPlatform#861.
plugins/ida/ida_main.ml Outdated Show resolved Hide resolved
@@ -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 =
Copy link
Contributor Author

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.

Copy link
Member

@ivg ivg left a 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:

  1. switch to a more efficient data representation (e.g., a hashtable)

  2. 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)

  3. Do not use assoc_opt it is not available on many versions of compiler (also do not use OCaml stdlib, use Core_kernel instead).

  4. 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.

plugins/ida/ida_main.ml Outdated Show resolved Hide resolved
plugins/ida/ida_main.ml Outdated Show resolved Hide resolved
plugins/ida/ida_main.ml Outdated Show resolved Hide resolved
plugins/ida/ida_main.ml Outdated Show resolved Hide resolved
Copy link
Member

@ivg ivg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@ivg ivg merged commit 2a5c076 into BinaryAnalysisPlatform:master Sep 6, 2018
@abhcs abhcs deleted the ida_brancher branch September 7, 2018 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants