From af8cb476a71b6bcb9537725a45c031d6f6cba791 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Thu, 26 Oct 2017 09:36:11 +0700 Subject: [PATCH] Capture stderr --- myth | 3 +-- mythril/ether/util.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/myth b/myth index 37145a50..904449a8 100755 --- a/myth +++ b/myth @@ -14,7 +14,6 @@ from mythril.rpc.client import EthJsonRpc from mythril.ipc.client import EthIpc from ethereum import utils from laser.ethereum import laserfree -import yaml import logging import binascii import sys @@ -131,7 +130,7 @@ if (args.code): elif (args.address): encoded_bytecode = eth.eth_getCode(args.address) elif (args.infile): - encoded_bytecode = compile_solidity(args.infile) + encoded_bytecode = compile_solidity(solc_binary, args.infile) else: exitWithError("No input bytecode. Please provide EVM code via -c BYTECODE, -a ADDRESS, or -i SOLIDITY_FILE") diff --git a/mythril/ether/util.py b/mythril/ether/util.py index 3ba70848..83d4016f 100644 --- a/mythril/ether/util.py +++ b/mythril/ether/util.py @@ -12,8 +12,8 @@ def safe_decode(hex_encoded_string): return bytes.fromhex(hex_encoded_string) -def compile_solidity(file): - output = subprocess.check_output(["solc", "--bin-runtime", file]) +def compile_solidity(solc_binary, file): + output = subprocess.check_output(["solc", "--bin-runtime", file], stderr=subprocess.DEVNULL) m = re.search(r"runtime part: \\n(.*)\\n", str(output)) return m.group(1)