From 33bf710abcdd2342008135ece7d1ebf4e960343d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 26 Nov 2016 14:02:03 +0300 Subject: [PATCH] engine: analyze: Add cases of conflicting flags to Problem List. And skip processing such addresses, instead of throwing assert. --- engine.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine.py b/engine.py index b15fafd..7570069 100644 --- a/engine.py +++ b/engine.py @@ -850,9 +850,14 @@ def analyze(callback=lambda cnt:None): if analysis_current_func: if fl == ADDRESS_SPACE.CODE | ADDRESS_SPACE.FUNC: continue - assert fl in (ADDRESS_SPACE.CODE, ADDRESS_SPACE.UNK) + if fl not in (ADDRESS_SPACE.CODE, ADDRESS_SPACE.UNK): + log.warn("Unexpected flags 0x%x at 0x%x while tracing code branch, skipping it", fl, ea) + ADDRESS_SPACE.add_issue(ea, "Jump/flow into non-code") + continue else: if fl != ADDRESS_SPACE.UNK: + if fl != ADDRESS_SPACE.CODE: + ADDRESS_SPACE.add_issue(ea, "Jump/flow into non-code") continue elif analisys_stack_calls: finish_func(analysis_current_func)