Lion Cipher Lab

Read a WebAssembly module as text: find what it imports, what it exports, and the string hidden in its memory

Why it matters

WebAssembly lets code written in languages like C, C++ and Rust run in a browser and in server-side runtimes at close to native speed. That is useful, and it also means opaque binary modules arrive on pages and in packages, and an analyst sometimes has to say what one does. The good news is that wasm is designed so that this is easier than for a native program: the code is organised into typed functions, control flow is structured, and every module declares exactly what it imports and exports. This lab builds a small module on purpose and then reads it three ways (as text, as a table of…

What you'll learn

Steps in this lab

  1. What WebAssembly is, in four ideas
  2. Install WABT and check Node
  3. Write a small module in the text format
  4. Assemble it and look at every byte
  5. Triage the file: headers, then imports and exports
  6. Find the hard-coded string in the data segment
  7. Read the code: disassembly and the round trip back to text
  8. Run it end to end with Node
  9. Change it and watch the behaviour change
  10. Why wasm is easier to analyse than native code, and where it is not
  11. Clean up

Open the full interactive lab →

Keep learning