Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crytic/evm_cfg_builder
EVM CFG recovery
https://github.com/crytic/evm_cfg_builder
cfg ethereum evm reversing
Last synced: 5 days ago
JSON representation
EVM CFG recovery
- Host: GitHub
- URL: https://github.com/crytic/evm_cfg_builder
- Owner: crytic
- License: agpl-3.0
- Created: 2018-09-18T05:42:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T20:08:36.000Z (over 1 year ago)
- Last Synced: 2024-10-14T11:14:31.717Z (about 1 month ago)
- Topics: cfg, ethereum, evm, reversing
- Language: Python
- Size: 13.8 MB
- Stars: 118
- Watchers: 14
- Forks: 29
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blockchain-security - EVM GFG builder
README
# EVM CFG BUILDER
[![Build Status](https://travis-ci.org/crytic/evm_cfg_builder.svg?branch=master)](https://travis-ci.org/crytic/evm_cfg_builder)
[![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com)
[![PyPI version](https://badge.fury.io/py/evm-cfg-builder.svg)](https://badge.fury.io/py/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:
```bash
evm-cfg-builder mycontract.evm
```To export the CFG of each function (dot format), run:
```bash
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
```bash
pip install evm-cfg-builder
```### Using Git
```bash
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:[email protected]) if you're looking for an exception to the terms.