|
|
@ -1,7 +1,7 @@ |
|
|
|
import logging |
|
|
|
import logging |
|
|
|
import copy |
|
|
|
import copy |
|
|
|
from typing import Union, List, Tuple |
|
|
|
from typing import Union, List, Tuple |
|
|
|
from z3 import BitVecNumRef |
|
|
|
from z3 import ExprRef |
|
|
|
import mythril.laser.ethereum.util as helper |
|
|
|
import mythril.laser.ethereum.util as helper |
|
|
|
from mythril.laser.ethereum.cfg import JumpType, Node |
|
|
|
from mythril.laser.ethereum.cfg import JumpType, Node |
|
|
|
from mythril.laser.ethereum.state import GlobalState, Environment |
|
|
|
from mythril.laser.ethereum.state import GlobalState, Environment |
|
|
@ -238,7 +238,7 @@ class TaintRunner: |
|
|
|
record.stack[l], record.stack[i] = record.stack[i], record.stack[l] |
|
|
|
record.stack[l], record.stack[i] = record.stack[i], record.stack[l] |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def mutate_mload(record: TaintRecord, op0: BitVecNumRef) -> None: |
|
|
|
def mutate_mload(record: TaintRecord, op0: ExprRef) -> None: |
|
|
|
_ = record.stack.pop() |
|
|
|
_ = record.stack.pop() |
|
|
|
try: |
|
|
|
try: |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
@ -250,7 +250,7 @@ class TaintRunner: |
|
|
|
record.stack.append(record.memory_tainted(index)) |
|
|
|
record.stack.append(record.memory_tainted(index)) |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def mutate_mstore(record: TaintRecord, op0: BitVecNumRef) -> None: |
|
|
|
def mutate_mstore(record: TaintRecord, op0: ExprRef) -> None: |
|
|
|
_, value_taint = record.stack.pop(), record.stack.pop() |
|
|
|
_, value_taint = record.stack.pop(), record.stack.pop() |
|
|
|
try: |
|
|
|
try: |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
@ -261,7 +261,7 @@ class TaintRunner: |
|
|
|
record.memory[index] = value_taint |
|
|
|
record.memory[index] = value_taint |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def mutate_sload(record: TaintRecord, op0: BitVecNumRef) -> None: |
|
|
|
def mutate_sload(record: TaintRecord, op0: ExprRef) -> None: |
|
|
|
_ = record.stack.pop() |
|
|
|
_ = record.stack.pop() |
|
|
|
try: |
|
|
|
try: |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
@ -273,7 +273,7 @@ class TaintRunner: |
|
|
|
record.stack.append(record.storage_tainted(index)) |
|
|
|
record.stack.append(record.storage_tainted(index)) |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def mutate_sstore(record: TaintRecord, op0: BitVecNumRef) -> None: |
|
|
|
def mutate_sstore(record: TaintRecord, op0: ExprRef) -> None: |
|
|
|
_, value_taint = record.stack.pop(), record.stack.pop() |
|
|
|
_, value_taint = record.stack.pop(), record.stack.pop() |
|
|
|
try: |
|
|
|
try: |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
|
index = helper.get_concrete_int(op0) |
|
|
|