From 26f839aa3c0c1890296b0925ad57e1cf9245c4b1 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 2 Aug 2018 13:02:14 +0700 Subject: [PATCH] Fix processing of search patterns --- mythril/ether/ethcontract.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mythril/ether/ethcontract.py b/mythril/ether/ethcontract.py index 035801c1..0c3214a3 100644 --- a/mythril/ether/ethcontract.py +++ b/mythril/ether/ethcontract.py @@ -38,7 +38,11 @@ class ETHContract(persistent.Persistent): str_eval = '' easm_code = None - tokens = filter(None, re.split("(and|or|not)", expression.replace(" ", ""), re.IGNORECASE)) + # tokens = filter(None, re.split("( and | or | not )", expression.replace(" ", ""), re.IGNORECASE)) + + tokens = re.split("\s+(and|or|not)\s+", expression, re.IGNORECASE) + + print(tokens) for token in tokens: @@ -65,5 +69,7 @@ class ETHContract(persistent.Persistent): str_eval += "\"" + sign_hash + "\" in self.disassembly.func_hashes" continue - + + print(str_eval) + return eval(str_eval.strip())