wasmdump is a small WebAssembly binary dumper written in C. It reads a
.wasm file and prints its module header, sections, imports, exports, type
information, code bodies, locals, and decoded instructions in a human-readable
text format.
cc -std=c99 -Wall -Wextra -O2 -o wasmdump wasmdump.c./wasmdump file.wasmExample output:
wasm: version=1 size=...
section[1] type offset=0x000a size=...
count: ...
section[7] export offset=0x.... size=...
export[0]: "..." func=...
section[10] code offset=0x.... size=...
code[0]: size=...
locals groups: ...
0010 local.get 0
0012 i32.const 1
0014 i32.add
0015 end
The dumper recognizes standard WebAssembly sections such as:
- custom
- type
- import
- function
- table
- memory
- global
- export
- start
- element
- code
- data
- data_count
It also decodes many common instructions, including control flow, calls,
locals/globals, memory loads and stores, constants, comparisons, and basic
i32 arithmetic and bit operations.
This is a compact inspection tool, not a full WebAssembly validator or disassembler. Unknown sections and instructions are still reported, but not all WebAssembly proposals or extended opcode spaces are decoded in detail.