Skip to content

Commit

Permalink
Ida 7 integration + minor fixes (#37)
Browse files Browse the repository at this point in the history
* minor fix to makel bap plugins woth with IDA 7

* few fixes to increase robustness
  • Loading branch information
gitoleg authored and ivg committed Nov 15, 2018
1 parent f1cdd95 commit 3a64cf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ disassembly and decompilation views.
BAP has the ability to tag a lot of possible attributes to
instructions. These BIR attributes can be tagged automatically as
comments in IDA, by running arbitrary plugins in BAP. Just hit
`Ctrl+S`.
`Shift+S`.

Here's an example of output for Saluki showing that a certain malloc
is unchecked (pointing to a potential vulnerability).
Expand All @@ -68,7 +68,7 @@ to the attribute location by selecting it.
### BAP Task Manager and Viewer

Every instance of BAP will have a corresponding view, that will
accumulate all data written by BAP. The BAP Viewer (`Ctrl-Alt-F5`)
accumulate all data written by BAP. The BAP Viewer (`Ctrl-Shift-F5`)
provides an easy way to switch between multiple BAP Views.

Since you can run multiple instances of BAP asynchronously, it is
Expand Down
7 changes: 5 additions & 2 deletions plugins/bap/plugins/bap_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ def location(self):
if self.level == 2:
top = index_up(self.index, 1)
location_id = self.incident.locations[top.row()]
return self.model.locations[location_id]
if self.model.locations is None:
return None
else:
return self.model.locations.get(location_id)

@property
def point(self):
Expand Down Expand Up @@ -523,7 +526,7 @@ def number_of_locations(msg):

@defmethod('row-count', level=1, column=0)
def backtrace_length(msg):
return len(msg.location)
return 0 if msg.location is None else len(msg.location)


class Incident(object):
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugin_loader_bap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def init(self):
path = os.path.join(plugin_path, plugin)
if not plugin.endswith('.py') or plugin.startswith('__'):
continue # Skip non-plugins
idc.Message('BAP> Loading {}\n'.format(plugin))
idaapi.msg('BAP> Loading {}\n'.format(plugin))
self.plugins.append(idaapi.load_plugin(path))
return idaapi.PLUGIN_KEEP

Expand Down

0 comments on commit 3a64cf9

Please sign in to comment.