Skip to content

Commit

Permalink
adds a support for Primus taint propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
ivg committed Aug 18, 2017
1 parent d0d7bf8 commit 20d386c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 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,12 @@ def __init__(self, addr, kind):
'--emit-ida-script-file', self.script.name
]

if self.ENGINE == 'primus':
self.args += [
'--primus-propagate-taint-run',
'--primus-promiscuous-mode',
'--primus-greedy-scheduler'
]


class BapTaint(idaapi.plugin_t):
Expand Down

0 comments on commit 20d386c

Please sign in to comment.