Skip to content

Commit 25744a1

Browse files
abhcsivg
authored andcommitted
Add IDA Pro brancher. (#35)
* Add IDA Pro brancher. Specify --brancher=ida to utilize IDA's brancher information. Adapted from #550 for #861. * Remove py24 from tox.ini Since Travis does not support python 2.4
1 parent 3cd56ee commit 25744a1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

plugins/bap/utils/ida.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ def output_types(out):
8686
@service.provider('brancher')
8787
def output_branches(out):
8888
"""Dump static successors for each instruction """
89+
out.write('(')
8990
for addr in addresses():
9091
succs = Succs(addr)
91-
if succs.jmps:
92+
if succs.jmps or (succs.fall is not None):
9293
out.write('{}\n'.format(succs.dumps()))
93-
94+
out.write(')')
9495

9596
def set_color(addr, color):
9697
idc.SetColor(addr, idc.CIC_ITEM, color)
@@ -137,7 +138,7 @@ def dumps(self):
137138
return ''.join([
138139
'({:#x} '.format(self.addr),
139140
' ({:#x}) '.format(self.fall) if self.fall else '()',
140-
'{})'.format(sexps(self.dests))
141+
'{})'.format(sexps(self.jmps))
141142
])
142143

143144

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist=py27,py24,py3
2+
envlist=py27,py3
33

44
[testenv]
55
deps=pytest

0 commit comments

Comments
 (0)