Comments (18)
Works for me:
$ myth -d -a "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208"
0 PUSH1 0x60
2 PUSH1 0x40
4 MSTORE
5 CALLDATASIZE
Do you still get the error in the latest version (0.4.2)?
from mythril.
@step21 I was seeing the same error, and I found I had version 0.1.6
$ pip show mythril
Name: mythril
Version: 0.1.6
Summary: Mythril is an assembler and disassembler for Ethereum VM bytecode
Home-page: https://github.com/b-mueller/mythril
Author: Bernhard Mueller
Author-email: [email protected]
License: MIT
Location: /home/yh/.local/lib/python2.7/site-packages
Requires: ethereum
from mythril.
@step21 I also saw the same error when I connected to a cpp-ethereum
node.
from mythril.
@pirapira does the error still occur in 0.5.6?
Try to install with:
$ pip install mythril==0.5.6
from mythril.
@b-mueller yes, but only when I use eth
from cpp-ethereum
instead of geth
. Your README is explicit about using geth
.
from mythril.
Maybe a difference in the RPC protocol. Would be great if you can commit a fix if you figure it out (I don't have cpp-ethereum available myself).
from mythril.
Ok, just installed 0.5.6 (z3-solver took forever) but this still happens. I don't think it is related to cpp-ethereum as such, or not only, as I only ever used geth with mythril. However, when writing the ipc code, I switched between rpc and ipc sometimes. While I think that for the most part the code should have failed if the ipc code returned something unexpected, I did not directly compare this and I think it wasn't necessary as in geth internally the rpc/ipc calls do the same thing and return the same thing. Still, can you think of a good way to check data consistency of the mythril storage? (otherwise I'll try to just resync everything and see if that fixes it)
from mythril.
I don't think it has anything to do with the database because mythril -a
doesn't require it.
Actually, with the symbolic EVM a lot of the code disassembly.py isn't needed anymore so I'm gonna get rid of that. Maybe that will fix the error. I'll also add some more debugging options just in case.
from mythril.
I just release 0.5.7 which removes block parsing from disassembly.py. It probably won't fix the error though, because from the output you are getting it seems that core of the problem is the RPC/IPC response.
If you install the update and run it with -v2
, it should print the received bytecode as follows:
$ pip install mythril==0.5.7
$ myth -d -a "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208" -v2
DEBUG:root:Input bytecode: 0x6060604052361561012d5763ffffffff60e060020a60003(...)
I assume that would return some kind of error or an empty code string?
from mythril.
Mmh yeah true. Actually I found another error when initially syncing with ipc, as web3py doesn't require a hex_to_dec helper function (it returns dec) and somehw for blockNumber I had not removed it. But so far it does not seem to be related (still syncing).
I manually added some print statements for debugging, though it didn't give me a solution so far. But in case it helps:
safe_decode hex string 0x
signatures size 5914
jmptable_indices []
blocklen 0
num_instructions 0
instruction_list []
I hope the description is sufficient to show 'what is what'.
from mythril.
For your new version, it is the same, it gives the 'hex string' with 0x such as
myth --ipc -d -a "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208" -v2
DEBUG:root:Input bytecode: 0x
from mythril.
Sounds like RPC / IPC is returning an empty result? Can you try to dump the whole IPC response?
Does it work with any other address?
from mythril.
Another reason could be if your geth node is not fully synced & the contract code is not available yet..
from mythril.
Yeah. It is actually not fully synced up, but not really old either, so I assumed it should be fine. Sorry if that turns out to be the culprit, but I do most work on my small laptop so I do not always let it sync because it makes the fan/cpu go crazy...
I cannot easily dump the ipc response as that is handled by web3py. If I dump the rpc response it is {'id': 1, 'result': '0x', 'jsonrpc': '2.0'}
Edit: Ok, so I think this really was the problem. F.e. if I use 0xFa52274DD61E1643d2205169732f29114BC240b3
it works. Thanks for helping to debug and sorry for not thinking of this myself. Maybe it was even the same for @pirapira
from mythril.
ok, cool! I'll add a note on this to the README.
from mythril.
If you get an infura key you can try remote RPC:
./myth --rpchost "mainnet.infura.io/{INFURA_KEY}" --rpcport "443" --rpctls="True" -g ./graphlol.html -a "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208"
from mythril.
Yeah, that is a great feature as well. At least for direct querying it should be nice.
from mythril.
I'm assuming this is resolved :)
from mythril.
Related Issues (20)
- rlp import error HOT 1
- Mythril Installation Issue HOT 4
- Integer Vulnerabilities that Mythril can Detect but Fail to Detect HOT 4
- Docker run on file directory using Foundry fails with unclear errors HOT 5
- Overflow analysis not respecting types smaller than `uint256` HOT 1
- mythril install with last web3=6 HOT 2
- Can't run analysis using Docker on M1 Mac HOT 2
- `AttributeError: 'NoneType' object has no attribute 'get'` in `mythril/solidity/features.py` HOT 7
- An incorrect warning result
- Mythril analyze returning AttributeError HOT 2
- How to run custom plugin along with mythril? HOT 1
- Mythril cannot identify imported openzeppelin contracts in foundry project. HOT 5
- DeclarationError: Identifier already declared. HOT 8
- Does mythril have the following features HOT 4
- Mythril 0.24.4 raises an error on macOS HOT 2
- Inconsistency in the results of function seqeunce execution HOT 23
- Mythril is producing one liner success report without details. HOT 1
- External call does not change the storage of the callee contract.
- Solc experienced a fatal error while running myth on a Foundry-based project importing an OpenZeppelin library HOT 2
- Unchecked return value not flagged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mythril.