Skip to content

Instantly share code, notes, and snippets.

@ariary
Created January 26, 2022 08:59
Show Gist options
  • Save ariary/b5a6062b89a62ba33734ba4638b0b20b to your computer and use it in GitHub Desktop.
Save ariary/b5a6062b89a62ba33734ba4638b0b20b to your computer and use it in GitHub Desktop.
Gather wasm file used by webpages
GENERAL="WebAssembly"
OLDER="WebAssembly.compile|WebAssembly.instantiate"
NEWER="WebAssembly.compileStreaming|WebAssembly.instantiateStreaming"
WASM="$GENERAL|$OLDER|$NEWER"
grep --color -C 5 -E $WASM /dev/stdin

wasme.sh is the pendant of jse to extract wasm file. It is within a shell as long as Webassembly won't be integrated with <script type='module'> or ES2015 import statements

Note: It provides a way to detect if the webpage use WebAssembly. Fetching the wasm module eventually need js code review.

To use it:

export URL=[endpoint]
curl $URL -s | jse -gather-src -u $URL | ./wasme.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment