Skip to content

Read and write custom sections in WASM modules.

Notifications You must be signed in to change notification settings

leighmcculloch/wasm-cs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-cs

Read and write custom sections in WASM modules.

Install

cargo install --locked wasm-cs

Usage

List custom sections

$ wasm-cs file.wasm ls
hello (6 bytes)
test (47 bytes)

Read a custom section

$ wasm-cs file.wasm read SECTION_NAME
Length: 47 (0x2f) bytes
0000:   54 68 65 20  71 75 69 63  6b 20 62 72  6f 77 6e 20   The quick brown
0010:   66 6f 78 20  6a 75 6d 70  73 20 6f 76  65 72 20 74   fox jumps over t
0020:   68 65 20 6c  61 7a 79 20  64 6f 67 2e  2e 2e 0a      he lazy dog....
$ wasm-cs file.wasm read SECTION_NAME -f hex
54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e2e2e0a
$ wasm-cs file.wasm read SECTION_NAME -f base64
VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4uLgo=
$ wasm-cs file.wasm read SECTION_NAME -f binary
The quick brown fox jumps over the lazy dog...

Write a custom section

$ wasm-cs file.wasm write SECTION_NAME < FILE

Thanks

wasm-cs is a fork of wasm-custom-sections, by Sven Sauleau.

License: MIT

About

Read and write custom sections in WASM modules.

Resources

Stars

Watchers

Forks

Languages

  • Rust 97.7%
  • Makefile 2.3%