LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

wasm2wat

Disassemble WebAssembly binary to text

TLDR

Convert to WAT
$ wasm2wat [input.wasm]
copy
Output to file
$ wasm2wat [input.wasm] -o [output.wat]
copy
Fold expressions
$ wasm2wat --fold-exprs [input.wasm]
copy
Generate names
$ wasm2wat --generate-names [input.wasm]
copy

SYNOPSIS

wasm2wat [-o output] [--fold-exprs] [options] input

DESCRIPTION

wasm2wat is a disassembler from the WABT (WebAssembly Binary Toolkit) that converts WebAssembly binary (.wasm) files into the human-readable WebAssembly Text Format (WAT). The WAT output uses S-expression syntax that represents the module structure, functions, types, imports, and exports in a readable form.The tool is essential for debugging and inspecting compiled WebAssembly modules, allowing developers to examine the actual instructions generated by compilers. Options like --fold-exprs produce more compact output by nesting expressions, and --generate-names assigns readable names to unnamed functions and variables.Output can be written to a file or printed to stdout for piping to other tools. The reverse operation (text to binary) is performed by the companion tool wat2wasm.

PARAMETERS

-o FILE

Output file.
--fold-exprs
Fold expressions.
--generate-names
Generate names.
--inline-exports
Inline exports.
--help
Show help.

INSTALL

sudo apt install wabt
copy
sudo dnf install wabt
copy
sudo pacman -S wabt
copy
brew install wabt
copy
nix profile install nixpkgs#wabt
copy

CAVEATS

One-way mostly. Part of WABT. Large output for big modules.

HISTORY

wasm2wat is part of WABT (WebAssembly Binary Toolkit), converting binary WASM to readable WAT text format.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid