EVM cfg builder written in Python 3.
Project description
# EVM CFG BUILDER
evm-cfg-builder is used to extract a control flow graph (CFG) from EVM bytecode. It is used by Ethersplay, Manticore, and other tools from Trail of Bits. It is a reliable foundation to build program analysis tools for EVM.
We encourage contributions that address any known [issues](https://github.com/trailofbits/evm_cfg_builder/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and will pay out bounties for accepted PRs. Join us on the [Empire Hacking Slack](https://empireslacking.herokuapp.com) to discuss using or extending evm-cfg-builder.
## Features
Reliably recovers a Control Flow Graph (CFG) from EVM bytecode using a dedicated Value Set Analysis
Recovers functions names
Recovers attributes (e.g., payable, view, pure)
Outputs the CFG to a dot file
Library API
## Usage
### Command line
To export basic dissassembly information, run: ` evm-cfg-builder mycontract.evm `
To export the CFG of each function (dot format), run: ` evm-cfg-builder mycontract.evm --export-dot my_dir `
dot files can be read using xdot.
### Library See [examples/explore_cfg.py](examples/explore_cfg.py) and [examples/explore_functions.py](examples/explore_functions.py) for library examples.
## How to install
### Using Pip ` $ pip install evm-cfg-builder `
### Using Git ` git clone https://github.com/trailofbits/evm_cfg_builder pip install . `
## Requirements
Python >= 3.6
[pyevmasm](https://github.com/trailofbits/pyevmasm)
## Getting Help
Feel free to stop by our [Slack channel](https://empireslacking.herokuapp.com) (#ethereum) for help using or extending evm-cfg-builder.
## License
evm-cfg-builder is licensed and distributed under the AGPLv3. [Contact us](mailto:opensource@trailofbits.com) if you’re looking for an exception to the terms.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for evm_cfg_builder-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e42c7cac628d82d8f907ea9ceb76f205041a35afaae784aa9a39b89cedf8b9cf |
|
MD5 | f807f4b81d6fd697ab5ce991ff87411d |
|
BLAKE2b-256 | 579a5fd39131dd0a2843f84898dbb71d2db6dbaa5207ac810c4c9455e7d77b24 |