https://github.com/crytic/pyevmasm

Ethereum Virtual Machine (EVM) disassembler and assembler

https://github.com/crytic/pyevmasm

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 20 committers (5.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.5%) to scientific vocabulary

Keywords

assembler dissassembler ethereum evm python

Keywords from Contributors

solidity symbolic-execution static-analysis security-reviews conference-presentations academic-papers emulation vulnerabilities vulnerability-detection vyper
Last synced: 5 months ago · JSON representation

Repository

Ethereum Virtual Machine (EVM) disassembler and assembler

Basic Info
  • Host: GitHub
  • Owner: crytic
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Size: 182 KB
Statistics
  • Stars: 379
  • Watchers: 22
  • Forks: 49
  • Open Issues: 16
  • Releases: 6
Topics
assembler dissassembler ethereum evm python
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

pyevmasm

Build Status

PyPI version Slack Status

pyevmasm is an assembler and disassembler library for the Ethereum Virtual Machine (EVM). It includes a commandline utility and a Python API.

CLI Examples with evmasm

evmasm is a commandline utility that uses pyevmasm to assemble or disassemble EVM:

``` usage: evmasm -h [-bi] [-bo] [-i [INPUT]] [-o [OUTPUT]] [-f FORK]

pyevmasm the EVM assembler and disassembler

optional arguments: -h, --help show this help message and exit -a, --assemble Assemble EVM instructions to opcodes -d, --disassemble Disassemble EVM to opcodes -t, --print-opcode-table List supported EVM opcodes -bi, --binary-input Binary input mode (-d only) -bo, --binary-output Binary output mode (-a only) -i [INPUT], --input [INPUT] Input file, default=stdin -o [OUTPUT], --output [OUTPUT] Output file, default=stdout -f FORK, --fork FORK Fork, default: byzantium. Possible: frontier, homestead, tangerinewhistle, spuriousdragon, byzantium, constantinople, serenity. Also an unsigned block number is accepted to select the fork. ```

Disassembling the preamble of compiled contract:

$ echo -n "608060405260043610603f57600035" | evmasm -d 00000000: PUSH1 0x80 00000002: PUSH1 0x40 00000004: MSTORE 00000005: PUSH1 0x4 00000007: CALLDATASIZE 00000008: LT 00000009: PUSH1 0x3f 0000000b: JUMPI 0000000c: PUSH1 0x0 0000000e: CALLDATALOAD

Python API Examples

```

from pyevmasm import instructiontables, disassemblehex, disassembleall, assemblehex instructiontable = instructiontables['byzantium'] instructiontable[20] Instruction(0x14, 'EQ', 0, 2, 1, 3, 'Equality comparision.', None, 0) instructiontable['EQ'] Instruction(0x14, 'EQ', 0, 2, 1, 3, 'Equality comparision.', None, 0) instrs = list(disassembleall(binascii.unhexlify('608060405260043610603f57600035'))) instrs.insert(1, instructiontable['JUMPI']) a = assemblehex(instrs) a '0x60805760405260043610603f57600035' print(disassemblehex(a)) PUSH1 0x80 JUMPI PUSH1 0x40 MSTORE ... assemble_hex('PUSH1 0x40\nMSTORE\n') '0x604052' ```

Installation

Python >=2.7 or Python >=3.3 is required.

Install the latest stable version using pip: pip install pyevmasm

Or, install the library from source: git clone https://github.com/trailofbits/pyevmasm cd pyevmasm python setup.py install --user

Documentation

https://pyevmasm.readthedocs.io

New issues, feature requests, and contributions are welcome. Join us in #ethereum channel on the Empire Hacking Slack to discuss Ethereum security tool development.

Owner

  • Name: Crytic
  • Login: crytic
  • Kind: organization
  • Email: opensource@trailofbits.com
  • Location: New York, NY

Blockchain Security, by @trailofbits

GitHub Events

Total
  • Watch event: 16
  • Delete event: 5
  • Push event: 3
  • Pull request event: 5
  • Pull request review event: 5
  • Fork event: 2
  • Create event: 2
Last Year
  • Watch event: 16
  • Delete event: 5
  • Push event: 3
  • Pull request event: 5
  • Pull request review event: 5
  • Fork event: 2
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 89
  • Total Committers: 20
  • Avg Commits per committer: 4.45
  • Development Distribution Score (DDS): 0.64
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
feliam f****o@g****m 32
computerality j****y@c****m 18
defunct d****t@d****o 11
0xPhaze 1****e 4
William Woodruff w****m@t****m 4
Josh Watson j****h@t****m 2
Dan Guido d****n@t****m 2
Disconnect3d d****a@g****m 2
alpharush 0****h@p****m 2
dependabot[bot] 4****] 2
Evan Sultanik e****k@t****m 1
Cryptomental c****m@g****m 1
James Olds j****s@t****m 1
Josselin j****n@t****m 1
Mark Mossberg m****k@t****m 1
Michael Rodler m****r@p****e 1
Panagiotis e****6@c****r 1
georgiypetrov p****1@g****m 1
ggrieco-tob 3****b 1
nveloso n****1@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 20
  • Total pull requests: 46
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 2 months
  • Total issue authors: 9
  • Total pull request authors: 25
  • Average comments per issue: 1.1
  • Average comments per pull request: 0.63
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • computerality (8)
  • offlinemark (4)
  • feliam (2)
  • abusse (1)
  • SillyTin (1)
  • Mikerah (1)
  • zarifpour (1)
  • meyira (1)
  • montyly (1)
Pull Request Authors
  • feliam (10)
  • dependabot[bot] (8)
  • computerality (4)
  • defunctio (2)
  • RaoulSchaffranek (2)
  • IgrXZG22 (2)
  • disconnect3d (2)
  • woodruffw (2)
  • georgiypetrov (2)
  • dguido (1)
  • frabert (1)
  • elopez (1)
  • offlinemark (1)
  • nveloso (1)
  • cryptomental (1)
Top Labels
Issue Labels
help wanted (1) good first issue (1) easy (1) enhancement (1)
Pull Request Labels
dependencies (8) github_actions (1)

Dependencies

setup.py pypi
  • future *
.github/workflows/main.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pip-audit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • trailofbits/gh-action-pip-audit v1.0.8 composite