From 98f3e1d71602ebfa816d0c6389724e9c64c2075c Mon Sep 17 00:00:00 2001 From: Dominik Muhs Date: Tue, 27 Nov 2018 20:25:21 +0100 Subject: [PATCH] Fix 4byte lookup abort condition (#760) --- mythril/support/signatures.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mythril/support/signatures.py b/mythril/support/signatures.py index a9c06d21..210f6f90 100644 --- a/mythril/support/signatures.py +++ b/mythril/support/signatures.py @@ -124,11 +124,12 @@ class SignatureDB(object): if text_sigs: return [t[0] for t in text_sigs] - # otherwise try the online lookup if we're allowed to - if not ( - self.enable_online_lookup - and byte_sig not in self.online_lookup_miss - and time.time() > self.online_lookup_timeout, + # abort if we're not allowed to check 4byte or we already missed + # the signature, or we're on a timeout + if ( + not self.enable_online_lookup + or byte_sig in self.online_lookup_miss + or time.time() < self.online_lookup_timeout, ): return []