Skip to content

Commit

Permalink
blacklist for functions to avoid
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrshnmenon committed Oct 27, 2022
1 parent 09afe39 commit 38fe2e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arbiter/master_chief/sa_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ def analyze_one(self, identifier):
logger.error(e)
return

def analyze(self):
def analyze(self, ignore_funcs=[]):
for addr, func in tqdm(self._cfg.functions.items(), desc="Identifying functions"):
if len(ignore_funcs) > 0:
if addr in ignore_funcs or func.name in ignore_funcs:
continue
logger.info("Starting recon of 0x%x" % addr)
try:
if self._check_sinks(func) is True:
Expand Down
5 changes: 5 additions & 0 deletions arbiter/master_chief/symbolic_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ def _explore_one(self, target, site, init_state):
t.join(timeout=1)
logger.debug("Got an exception")
logger.error(e)
except:
logger.debug("Got an exception")
self._watchdog_event.set()
logger.debug("Waiting for watchdog to join")
t.join(timeout=1)

end = time.time()
logger.debug("Found %d paths" % len(pg.found))
Expand Down
3 changes: 3 additions & 0 deletions vuln_templates/run_arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def main(template, target):
parser.add_argument('-f', metavar='VD', type=str, help='The VD template to use', required=True)
parser.add_argument('-t', metavar='TARGET', type=str, help='The target binary to analyze', required=True)
parser.add_argument('-i', metavar='ADDR', type=str, help='Specify a target function identifier (name|addr) to focus the analysis on', required=False, default="")
parser.add_argument('-b', metavar='BLACKLIST', type=str, help='Specify a list of function identifiers (name|addr) to skip analysis', required=False, default=[], nargs="?")
parser.add_argument('-r', metavar='LEVEL', type=int, help='Number of levels for Adaptive False Positive Reduction', required=False, default=-1)
parser.add_argument('-l', metavar='LOG_DIR', type=str, help='Enable logging to LOG_DIR', required=False)
parser.add_argument('-j', metavar='JSON_DIR', type=str, help='Enable verbose statistics dumps to JSON_DIR', required=False)
Expand Down Expand Up @@ -99,6 +100,8 @@ def main(template, target):
else:
IDENTIFIER = args.i

BLACKLIST = args.b

CALLER_LEVEL = args.r

if args.l:
Expand Down

0 comments on commit 38fe2e6

Please sign in to comment.