All Projects → crytic → Rattle

crytic / Rattle

evm binary static analysis

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rattle

Burrow
https://wiki.hyperledger.org/display/burrow
Stars: ✭ 851 (+459.87%)
Mutual labels:  ethereum, evm
Chaingear
The consensus computer driven database framework
Stars: ✭ 83 (-45.39%)
Mutual labels:  ethereum, evm
Ette
EVM-based Blockchain Indexer, with historical data query & real-time notification support 😎
Stars: ✭ 37 (-75.66%)
Mutual labels:  ethereum, evm
Intellij Solidity
Solidity plugin for IntelliJ
Stars: ✭ 646 (+325%)
Mutual labels:  ethereum, evm
Hevm
(OLD REPO) A debug-oriented Ethereum VM (EVM)
Stars: ✭ 114 (-25%)
Mutual labels:  ethereum, evm
Ethereumjs Monorepo
Monorepo for the Ethereum VM TypeScript Implementation
Stars: ✭ 813 (+434.87%)
Mutual labels:  ethereum, evm
Py Evm
A Python implementation of the Ethereum Virtual Machine
Stars: ✭ 1,122 (+638.16%)
Mutual labels:  ethereum, evm
Dapptools
Dapp, Seth, Hevm, and more
Stars: ✭ 362 (+138.16%)
Mutual labels:  ethereum, evm
Awesome Cryptocurrency Security
😎 Curated list about cryptocurrency security (reverse / exploit / fuzz..)
Stars: ✭ 102 (-32.89%)
Mutual labels:  ethereum, reverse-engineering
Openzeppelin Contracts
OpenZeppelin Contracts is a library for secure smart contract development.
Stars: ✭ 14,308 (+9313.16%)
Mutual labels:  ethereum, evm
Echidna
Ethereum smart contract fuzzer
Stars: ✭ 571 (+275.66%)
Mutual labels:  ethereum, evm
Remix Ide
Documentation for Remix IDE
Stars: ✭ 1,768 (+1063.16%)
Mutual labels:  ethereum, evm
Capstone
Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.
Stars: ✭ 5,374 (+3435.53%)
Mutual labels:  ethereum, reverse-engineering
Ruby To Solidity
(Secure) Ruby to Solidity (Source-to-Source) Cross-Compiler Cheat Sheet / White Paper
Stars: ✭ 7 (-95.39%)
Mutual labels:  ethereum, evm
Aleth
Aleth – Ethereum C++ client, tools and libraries
Stars: ✭ 3,885 (+2455.92%)
Mutual labels:  ethereum, evm
Remix
This has been moved to https://github.com/ethereum/remix-project
Stars: ✭ 1,063 (+599.34%)
Mutual labels:  ethereum, evm
Evm Opcodes
Ethereum opcodes and instruction reference
Stars: ✭ 344 (+126.32%)
Mutual labels:  ethereum, evm
Awesome Ethereum Security
A curated list of awesome Ethereum security references
Stars: ✭ 345 (+126.97%)
Mutual labels:  ethereum, evm
Evm2wasm
[ORPHANED] Transcompiles EVM code to eWASM
Stars: ✭ 96 (-36.84%)
Mutual labels:  ethereum, evm
Chains
provides metadata for networkIDs and chainIDs
Stars: ✭ 117 (-23.03%)
Mutual labels:  ethereum, evm

rattle

Rattle

Rattle is an EVM binary static analysis framework designed to work on deployed smart contracts. Rattle takes EVM byte strings, uses a flow-sensitive analysis to recover the original control flow graph, lifts the control flow graph into an SSA/infinite register form, and optimizes the SSA – removing DUPs, SWAPs, PUSHs, and POPs. The conversion from a stack machine to SSA form removes 60%+ of all EVM instructions and presents a much friendlier interface to those who wish to read the smart contracts they’re interacting with.

Example

$ python3 rattle-cli.py --input inputs/kingofether/KingOfTheEtherThrone.bin -O

Would produce a register machine output like this:

King of Ether numberOfMonarchs

Functions are recovered and split off. Additionally function arguments, memory locations, and storage locations are recovered.

Usage

Rattle runs on the runtime contract hex string.

If you're running rattle on a contract you can compile with solidity, use the --bin-runtime option and strip off the header:

$ solc --bin-runtime KingOfTheEtherThrone.sol 2>/dev/null | tail -n1 > contract.bin

Dependencies

  • python3
  • graphviz
  • cbor2
  • pyevmasm

To install the python dependencies, run these commands:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Troubleshooting

If you get a syntax error like this:

  File "rattle-cli.py", line 16
    def main() -> None:
               ^
SyntaxError: invalid syntax

You likely ran rattle with python2 instead of python3.

Presentation

For more details on the Rattle design and features, see my reCON Montreal presentation, which is annotated here.

License

Rattle is licensed and distributed under the AGPLv3 license. Contact us if you're looking for an exception to the terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].