From 24712509fb38f0546fe705df4ecd50bf81c9f3fa Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 12 Jul 2018 21:36:03 +0530 Subject: [PATCH] Move the v, r, s for catching exception --- mythril/laser/ethereum/natives.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/natives.py b/mythril/laser/ethereum/natives.py index 9b301007..d5ef22e6 100644 --- a/mythril/laser/ethereum/natives.py +++ b/mythril/laser/ethereum/natives.py @@ -32,14 +32,16 @@ def extract32(data, i): def ecrecover(data): + try: data = bytearray(data) + v = extract32(data, 32) + r = extract32(data, 64) + s = extract32(data, 96) except TypeError: raise NativeContractException + message = b''.join([ALL_BYTES[x] for x in data[0:32]]) - v = extract32(data, 32) - r = extract32(data, 64) - s = extract32(data, 96) if r >= secp256k1n or s >= secp256k1n or v < 27 or v > 28: return [] try: