Wasp is a C++ library designed to make it easy to work with WebAssembly modules. Unlike tools like wabt, it is designed to be used as a library.
It also includes the wasp
tool, which has the following commands:
wasp dump
: Dump the contents of a WebAssembly modulewasp callgraph
: Generate a dot graph of the module's callgraphwasp cfg
: Generate a dot graph of a function's control-flow graphwasp dfg
: Generate a dot graph of a function's data-flow graph
Disassemble all functions in a module:
$ wasp dump -d mod.wasm
Display all sections in a module:
$ wasp dump -h mod.wasm
Display the contents of the "import" section:
$ wasp dump -j import -x mod.wasm
Write the callgraph as a DOT file to stdout.
$ wasp callgraph mod.wasm
Write the callgraph as a DOT file to file.dot
.
$ wasp callgraph mod.wasm -o file.dot
Write the CFG of function 0 as a DOT file to stdout.
$ wasp cfg -f 0 mod.wasm
Write the CFG of function foo
as a DOT file to file.dot
.
$ wasp cfg -f foo mod.wasm -o file.dot
Write the DFG of function 0 as a DOT file to stdout.
$ wasp dfg -f 0 mod.wasm
Write the DFG of function foo
as a DOT file to file.dot
.
$ wasp dfg -f foo mod.wasm -o file.dot