Skip to content

Commit

Permalink
Merge pull request #25 from rvantonder/patch-3
Browse files Browse the repository at this point in the history
Update brancher output
  • Loading branch information
ivg authored Aug 25, 2016
2 parents cf5743f + 471db24 commit fe0dbe0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions plugins/bap/utils/ida.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ def dest(ea, flow): # flow denotes whether normal flow is also taken
def pp(l):
return ' '.join('0x%x' % e for e in l)

with open(output_filename, 'w+') as out:
for ea in all_valid_ea():
branch_dests = dest(ea, False)
if len(branch_dests) > 0:
out.write('(0x%x (%s) (%s))\n' % (
ea,
pp(dest(ea, True) - branch_dests),
pp(branch_dests)
with open(output_filename, 'w+') as out:
for ea in all_valid_ea():
branch_dests_false = dest(ea, False)
branch_dests_true = dest(ea,True)
if len(branch_dests_false) > 0 or len(branch_dests_true) > 0:
out.write('(0x%x (%s) (%s))\n' % (
ea,
pp(branch_dests_true - branch_dests_false),
pp(branch_dests_false)
))


Expand Down

0 comments on commit fe0dbe0

Please sign in to comment.