Skip to content

code4fukui/wasmdump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

wasmdump

Japanese

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.

Build

cc -std=c99 -Wall -Wextra -O2 -o wasmdump wasmdump.c

Usage

./wasmdump file.wasm

Example 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

Supported Output

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.

Notes

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.

About

Small WebAssembly binary dumper written in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages