|
|
@ -1,11 +1,11 @@ |
|
|
|
import binascii |
|
|
|
import binascii |
|
|
|
import logging |
|
|
|
import logging,sys |
|
|
|
from copy import copy, deepcopy |
|
|
|
from copy import copy, deepcopy |
|
|
|
|
|
|
|
|
|
|
|
import ethereum.opcodes as opcodes |
|
|
|
import ethereum.opcodes as opcodes |
|
|
|
from ethereum import utils |
|
|
|
from ethereum import utils |
|
|
|
from z3 import BitVec, Extract, UDiv, simplify, Concat, ULT, UGT, BitVecNumRef, Not, \ |
|
|
|
from z3 import BitVec, Extract, UDiv, simplify, Concat, ULT, UGT, BitVecNumRef, Not, \ |
|
|
|
is_false |
|
|
|
is_false, BitVecRef |
|
|
|
from z3 import BitVecVal, If, BoolRef |
|
|
|
from z3 import BitVecVal, If, BoolRef |
|
|
|
|
|
|
|
|
|
|
|
import mythril.laser.ethereum.util as helper |
|
|
|
import mythril.laser.ethereum.util as helper |
|
|
@ -899,10 +899,14 @@ class Instruction: |
|
|
|
return [global_state] |
|
|
|
return [global_state] |
|
|
|
|
|
|
|
|
|
|
|
global_state.mstate.mem_extend(mem_out_start, mem_out_sz) |
|
|
|
global_state.mstate.mem_extend(mem_out_start, mem_out_sz) |
|
|
|
|
|
|
|
if type(data) == BitVecRef: |
|
|
|
|
|
|
|
global_state.mstate.memory[mem_out_start] = data |
|
|
|
|
|
|
|
else: |
|
|
|
try: |
|
|
|
try: |
|
|
|
for i in range(min(len(data), mem_out_sz)): # If more data is used then it's chopped off |
|
|
|
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] |
|
|
|
global_state.mstate.memory[mem_out_start + i] = data[i] |
|
|
|
except: |
|
|
|
except: |
|
|
|
|
|
|
|
sys.stderr.write(str(data)) |
|
|
|
global_state.mstate.memory[mem_out_start] = BitVec(data, 256) |
|
|
|
global_state.mstate.memory[mem_out_start] = BitVec(data, 256) |
|
|
|
|
|
|
|
|
|
|
|
# TODO: maybe use BitVec here constrained to 1 |
|
|
|
# TODO: maybe use BitVec here constrained to 1 |
|
|
|