|
|
|
@ -238,7 +238,6 @@ if args.search or args.init_db: |
|
|
|
|
except ConnectionError as e: |
|
|
|
|
exitWithError("Could not connect to RPC server. Make sure that your node is running and that RPC parameters are set correctly.") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys.exit() |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +246,7 @@ if args.search or args.init_db: |
|
|
|
|
contracts = [] |
|
|
|
|
|
|
|
|
|
if (args.code): |
|
|
|
|
contracts.append(ETHContract(args.code, name="MAIN", address = util.get_indexed_address(0))) |
|
|
|
|
contracts.append(ETHContract(args.code, name="MAIN", address=util.get_indexed_address(0))) |
|
|
|
|
|
|
|
|
|
# Get bytecode from a contract address |
|
|
|
|
|
|
|
|
@ -305,7 +304,7 @@ elif (len(args.solidity_file)): |
|
|
|
|
json.dump(sigs, f) |
|
|
|
|
|
|
|
|
|
else: |
|
|
|
|
exitWithError(args.outform,"No input bytecode. Please provide EVM code via -c BYTECODE, -a ADDRESS, or -i SOLIDITY_FILES") |
|
|
|
|
exitWithError(args.outform, "No input bytecode. Please provide EVM code via -c BYTECODE, -a ADDRESS, or -i SOLIDITY_FILES") |
|
|
|
|
|
|
|
|
|
# Commands |
|
|
|
|
|
|
|
|
@ -333,14 +332,14 @@ if args.storage: |
|
|
|
|
|
|
|
|
|
if array: |
|
|
|
|
position_formated = str(position).zfill(64) |
|
|
|
|
position = int(Web3.sha3(position_formated),16) |
|
|
|
|
position = int(Web3.sha3(position_formated), 16) |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
if length == 1: |
|
|
|
|
print("{}: ".format(position) + eth.eth_getStorageAt(args.address, position)); |
|
|
|
|
print("{}: ".format(position) + eth.eth_getStorageAt(args.address, position)) |
|
|
|
|
else: |
|
|
|
|
for i in range(position, position + length): |
|
|
|
|
print("{}: ".format(hex(i)) + eth.eth_getStorageAt(args.address, i)); |
|
|
|
|
print("{}: ".format(hex(i)) + eth.eth_getStorageAt(args.address, i)) |
|
|
|
|
except FileNotFoundError as e: |
|
|
|
|
exitWithError(args.outform, "IPC error: " + str(e)) |
|
|
|
|
except ConnectionError as e: |
|
|
|
@ -419,7 +418,7 @@ elif (args.graph) or (args.fire_lasers): |
|
|
|
|
offset = contract.mappings[index].offset |
|
|
|
|
length = contract.mappings[index].length |
|
|
|
|
|
|
|
|
|
issue.code = solidity_file.data[offset:offset+length] |
|
|
|
|
issue.code = solidity_file.data[offset:offset + length] |
|
|
|
|
issue.lineno = contract.mappings[index].lineno |
|
|
|
|
|
|
|
|
|
for issue in issues: |
|
|
|
|