Registry / devops / ethereum-dasm

ethereum-dasm

JSON →
library0.1.5pypypiunverified

An Ethereum bytecode disassembler with static and dynamic analysis features. Current version 0.1.5, low activity.

pip install ethereum-dasm
INSTALL
IMPORT
SIG · ETHEREUM-DASM
E
ethereum-dasm
devopspythonv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EVM
from ethereum_dasm import EVM
Main class for disassembly and analysis
disassemble
from ethereum_dasm.evm import disassemble
Low-level disassembly function

Disassemble raw Ethereum bytecode hex string.

from ethereum_dasm import EVM from binascii import unhexlify bytecode_hex = '60006000' # PUSH1 0; PUSH1 0 bytecode = unhexlify(bytecode_hex) evm = EVM(bytecode) instructions = evm.disassemble() for instr in instructions: print(instr)
Debug
Known issues
breakingIn version 0.1.0+, the main module was renamed from 'ethereum_dasm' (hyphen not allowed in imports) but the package remains 'ethereum-dasm' on PyPI. Import using underscore: 'from ethereum_dasm import EVM'.
fix
Use underscore in import path: from ethereum_dasm import EVM
affects: 0.1.0+
gotchaThe library expects raw bytes, not hex strings. Passing a hex string will cause silent failure or wrong opcodes.
fix
Use binascii.unhexlify() or bytes.fromhex() to convert hex to bytes.
affects: all
deprecatedFunctions like 'disassemble_instructions' from earlier versions are deprecated in 0.1.5. Use EVM.disassemble() instead.
fix
Use the EVM class with disassemble() method.
affects: <0.1.5
Upgrade
Version history
0.1.5latest on PyPI · released Jul 6, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
ethereum-dasm — pip install ethereum-dasm · libregistry