-
Notifications
You must be signed in to change notification settings - Fork 494
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
initial commit of BinaryNinja import script #205
Conversation
scripts/import-to-bn.py
Outdated
|
||
def load_analysis(bv): | ||
#not that I expect many files with multiple periods but why not | ||
shortname = '.'.join(os.path.basename(bv.file.filename).split(".")[0:-1]) |
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.
or os.path.splitext
https://docs.python.org/2/library/os.path.html#os.path.splitext
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.
Oh, that's a good suggestion, cleaner. Thanks.
scripts/import-to-bn.py
Outdated
log_info("ok") | ||
|
||
|
||
PluginCommand.register("Load CAPA file", "Loads an analysis file from capa", load_analysis) |
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.
nit: capa
not CAPA
since its not an acronym or anything.
|
||
This script will verify that the report matches the workspace. | ||
Check the log window for any errors, and/or the summary of changes. | ||
|
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.
would you like to add your handle here for recognition?
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.
Sure, thanks. Will amend.
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.
this is awesome!
this is ready to merge. @psifertex if you want to add your handle, please do! let me know when i should press "merge". |
Derived from: https://github.com/fireeye/capa/blob/master/scripts/import-to-ida.py | ||
""" | ||
import json | ||
import os |
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.
style: order by line length, so use this:
import os
import json
I'm bad at GH PR modification so I"m just closing this and re-submitting with the requested changes. :-) |
What is the problem exactly? Maybe we can help 😉 |
I was under the impression that merely pushing to my fork and would update the PR but that didn't appear to be the case? I started to create a PR and saw it was just going to make a fresh one in addition to the prior one. Maybe I should have ignored it and continued the process? |
That should be exactly the case. In fact, this PR has exactly the same commits as the new one you open. I think it worked. You may need to reload the page to see the new changes. GitHub shows a If you add changes to an already pushed commit (for example using |
Yup, I first tried the amend commit option but didn't see anything on the PR page when I checked it. Probably the case that I needed to do a forced reload of the page. Thanks, good to know I was on the right track. Next time I won't give up so easily. :-) Also, thanks for catching the other bug that crept in on the first line. vim motion leftover that snuck in after testing. |
Just the import script for now. One feature I did add that might be worth pulling into the IDA script is to attempt to first load a
.js
or.json
version of the exectuable/dll automatically if it exists since that seems like a common naming convention for capa outputs.Two remaining (larger!) tasks are to implement a replacement for the vivisect analysis since that would provide python3 support, and then of course an implementation of the full IDA plugin for BN.