Cleanup get_call_data

pull/871/head
Nathan 6 years ago
parent 6a59cb4954
commit 30d3b9a74e
  1. 18
      mythril/laser/ethereum/call.py

@ -179,29 +179,23 @@ def get_call_data(
else memory_size else memory_size
) )
try:
uses_entire_calldata = False
try:
uses_entire_calldata = simplify( uses_entire_calldata = simplify(
memory_size - global_state.environment.calldata.calldatasize == 0 memory_size - global_state.environment.calldata.calldatasize == 0
) )
except Z3Exception:
pass
if uses_entire_calldata: if uses_entire_calldata == True:
call_data = global_state.environment.calldata return global_state.environment.calldata
else:
try:
calldata_from_mem = state.memory[ calldata_from_mem = state.memory[
util.get_concrete_int(memory_start) : util.get_concrete_int( util.get_concrete_int(memory_start) : util.get_concrete_int(
memory_start + memory_size memory_start + memory_size
) )
] ]
call_data = ConcreteCalldata(transaction_id, calldata_from_mem) return ConcreteCalldata(transaction_id, calldata_from_mem)
except TypeError: except TypeError:
log.debug("Unsupported symbolic calldata offset") log.debug("Unsupported symbolic calldata offset")
call_data = SymbolicCalldata(transaction_id) return SymbolicCalldata(transaction_id)
return call_data
def native_call( def native_call(

Loading…
Cancel
Save