Skip to content

Commit

Permalink
Merge pull request #30 from ivg/propagate-taint-with-primus
Browse files Browse the repository at this point in the history
Propagate taint with primus
  • Loading branch information
ivg authored Sep 14, 2017
2 parents f39fc06 + ed194e9 commit 65af9f3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugins/bap/plugins/bap_taint.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@
('taints', 'yellow')
]


class PropagateTaint(BapIda):
ENGINE='primus'

"Propagate taint information using BAP"
def __init__(self, addr, kind):
super(PropagateTaint,self).__init__()

self.action = 'taint propagating from {:s}0x{:X}'.format(
'*' if kind == 'ptr' else '',
addr)
self.passes = ['taint','propagate-taint','map-terms','emit-ida-script']
propagate = 'run' if self.ENGINE == 'primus' else 'propagate-taint'
self.passes = ['taint', propagate, 'map-terms','emit-ida-script']
self.script = self.tmpfile('py')
scheme = self.tmpfile('scm')
for (pat,color) in patterns:
Expand All @@ -50,6 +53,14 @@ def __init__(self, addr, kind):
'--emit-ida-script-file', self.script.name
]

if self.ENGINE == 'primus':
self.args += [
'--run-entry-points=all-subroutines',
'--primus-limit-max-length=100',
'--primus-propagate-taint-run',
'--primus-promiscuous-mode',
'--primus-greedy-scheduler'
]


class BapTaint(idaapi.plugin_t):
Expand Down

0 comments on commit 65af9f3

Please sign in to comment.