wasm-edit

Crates.iowasm-edit
lib.rswasm-edit
version0.1.7
sourcesrc
created_at2022-11-01 10:17:44.583955
updated_at2023-05-27 17:05:10.228568
descriptionEdit and instrument already compiled Wasm binaries
homepage
repositoryhttps://github.com/xtuc/wasm-edit
max_upload_size
id702745
size22,057
Sven Sauleau (xtuc)

documentation

README

wasm-edit

Edit and instrument already compiled Wasm binaries

Coredump generation

Moved to https://github.com/xtuc/wasm-coredump.

Install

cargo install wasm-edit

Edit the main memory

Change the initial memory amount (in pages):

wasm-edit edit-memory --initial-memory=1000 < input.wasm > output.wasm

Trace calls to memory.grow

Trace calls to the memory.grow instruction:

wasm-edit instrument-memory < input.wasm > output.wasm

Requires Wasi, but doesn't require any change on the host. Tested with Rust and theoretically working with C/C++ (clang).

Running into stack overflow

Some Wasm binaries have very recursive flow of control, increase the maximum stack size:

$ ulimit -s 160000
Commit count: 25

cargo fmt