diff --git a/laser b/laser new file mode 120000 index 00000000..02a8188d --- /dev/null +++ b/laser @@ -0,0 +1 @@ +../laser-ethereum/laser/ \ No newline at end of file diff --git a/lol.py b/lol.py new file mode 100644 index 00000000..a22bf109 --- /dev/null +++ b/lol.py @@ -0,0 +1,35 @@ +import os +from mythril.ether.contractstorage import get_persistent_storage +from mythril.rpc.client import EthJsonRpc +from mythril.disassembler.disassembly import Disassembly +from laser.ethereum import laserfree +import logging + +app_root = os.path.dirname(os.path.realpath(__file__)) +db_dir = os.path.join(app_root, "database") + +eth = EthJsonRpc("localhost", 8545) + +contract_storage = get_persistent_storage(os.path.join(os.path.expanduser('~'), ".mythril")) + +logging.basicConfig(level=logging.INFO) + +def searchCallback(contract_hash, contract, addresses, balances): + + try: + + print("Checking contract: " + str(contract_hash)) + + print(addresses[0]) + + disas = Disassembly(contract.code) + + laserfree.fire(disas) + + except Exception as e: + + print(str(e)) + +print("Searching " +str(len(list(contract_storage.contracts))) + " contracts...") + +contract_storage.search("code#PUSH#", searchCallback) diff --git a/setup.py b/setup.py index ecc70085..f6a9eb3f 100755 --- a/setup.py +++ b/setup.py @@ -254,7 +254,8 @@ setup( install_requires=[ 'ethereum>=2.0.4', 'ZODB>=5.3.0', - 'graphviz>=0.8' + 'graphviz>=0.8', + 'web3' ], python_requires='>=3.5',