correcter natives fix

pull/557/head
Nathan 6 years ago
parent c428df83ee
commit 6509c46305
  1. 13
      mythril/laser/ethereum/instructions.py
  2. 2
      mythril/laser/ethereum/natives.py

@ -1030,17 +1030,8 @@ class Instruction:
return [global_state]
if type(data) == Calldata: # identity() returns calldata
new_memory = []
for i in range(mem_out_sz):
new_memory.append(data[i])
for i in range(0, len(new_memory), 32):
global_state.mstate.memory[mem_out_start + i] = simplify(Concat(new_memory[i:i+32]))
else:
for i in range(min(len(data), mem_out_sz)): # If more data is used then it's chopped off
global_state.mstate.memory[mem_out_start + i] = data[i]
for i in range(min(len(data), mem_out_sz)): # If more data is used then it's chopped off
global_state.mstate.memory[mem_out_start + i] = data[i]
# TODO: maybe use BitVec here constrained to 1
return [global_state]

@ -70,7 +70,7 @@ def ripemd160(data):
def identity(data):
return copy.copy(data)
return copy.copy(data.starting_calldata)
def native_contracts(address, data):

Loading…
Cancel
Save