{"id":13642313,"url":"https://github.com/crytic/rattle","last_synced_at":"2025-04-06T00:09:22.643Z","repository":{"id":37451211,"uuid":"124136597","full_name":"crytic/rattle","owner":"crytic","description":"evm binary static analysis","archived":false,"fork":false,"pushed_at":"2023-09-04T23:49:37.000Z","size":4197,"stargazers_count":355,"open_issues_count":12,"forks_count":43,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-30T05:32:16.547Z","etag":null,"topics":["ethereum","evm","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://www.trailofbits.com/presentations/rattle/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crytic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-06T20:48:37.000Z","updated_at":"2025-03-17T16:25:45.000Z","dependencies_parsed_at":"2023-02-08T20:46:25.096Z","dependency_job_id":"89b6bb4a-9d83-47c7-8243-a2bfce0c2cb9","html_url":"https://github.com/crytic/rattle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Frattle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Frattle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Frattle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Frattle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crytic","download_url":"https://codeload.github.com/crytic/rattle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","evm","reverse-engineering"],"created_at":"2024-08-02T01:01:29.778Z","updated_at":"2025-04-06T00:09:22.627Z","avatar_url":"https://github.com/crytic.png","language":"Python","funding_links":[],"categories":["Python","dApps directory","Static Analysis"],"sub_categories":["Static Analysis Tools"],"readme":"\n# rattle\n\n![Rattle](logo_s.png)\n\nRattle 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.\n\n## Example\n\n```bash\npython3 rattle-cli.py --input inputs/kingofether/KingOfTheEtherThrone.bin -O\n```\n\nWould produce a register machine output like this:\n\n![King of Ether numberOfMonarchs](example.png)\n\nFunctions are recovered and split off. Additionally function arguments, memory locations, and storage locations are recovered.\n\n## Usage\nRattle runs on the runtime contract hex string.\n\nIf you're running rattle on a contract you can compile with solidity, use the `--bin-runtime` option and strip off the header:\n```console\n$ solc --bin-runtime KingOfTheEtherThrone.sol 2\u003e/dev/null | tail -n1 \u003e contract.bin\n```\n\n## Dependencies\n\n* python3\n* graphviz\n* cbor2\n* pyevmasm\n\nTo install the python dependencies, run these commands:\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\nTo install graphviz, run the following command:\n\nLinux:\n\n```bash\nsudo apt-get graphvis\n```\n\nmacOS:\n\n```bash\nbrew install graphviz\n```\n\n## Troubleshooting\n\nIf you get a syntax error like this:\n\n```python\n  File \"rattle-cli.py\", line 16\n    def main() -\u003e None:\n               ^\nSyntaxError: invalid syntax\n```\n\nYou likely ran rattle with python2 instead of python3.\n\n# Presentation\n\nFor more details on the Rattle design and features, see my reCON Montreal presentation, which is annotated [here](https://www.trailofbits.com/presentations/rattle/).\n\n# License\n\nRattle is licensed and distributed under the AGPLv3 license. [Contact us](mailto:opensource@trailofbits.com) if you're looking for an exception to the terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Frattle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrytic%2Frattle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Frattle/lists"}