Reading data from a WASM module represented as a BinF view. In other words, decompilation.
Unless one wants to design a custom module parsing environment, ultimately, one should use the decompile
function
from the helins.wasm
namespace which does all the job for decompiling a whole WASM module.
See README for namespace organization and naming scheme.
Reading data from a WASM module represented as a BinF view. In other words, decompilation. Unless one wants to design a custom module parsing environment, ultimately, one should use the `decompile` function from the `helins.wasm` namespace which does all the job for decompiling a whole WASM module. See README for namespace organization and naming scheme.
(codesec' ctx view)
This function only finds functions and split them into individual BinF views.
This allows for implementing, if needed one day, multithreaded reading on a function-per-function basis.
For full decompilation, codesec'2
is used later.
This function only finds functions and split them into individual BinF views. This allows for implementing, if needed one day, multithreaded reading on a function-per-function basis. For full decompilation, [[codesec'2]] is used later.
(codesec'2 ctx)
After applying codesec'
, this function takes those function BinF views
and actually reads them
After applying [[codesec']], this function takes those function BinF views and actually reads them
(exportdesc-func ctx view hmap)
Helper for reading an exported func.
Helper for reading an exported func.
(exportdesc-global ctx view hmap)
Helper for reading an exported global.
Helper for reading an exported global.
(exportdesc-mem ctx view hmap)
Helper for reading an exported mem.
Helper for reading an exported mem.
(exportdesc-table ctx view hmap)
Helper for reading an exported table.
Helper for reading an exported table.
(func hmap view)
For functions found in the funcsec and in imports.
WASM specification does not have a special name for it since binary-wise it is simply a type index.
For functions found in the funcsec and in imports. WASM specification does not have a special name for it since binary-wise it is simply a type index.
(idx view)
For the time being at least, all WASM indices are represented as u32'
and hence,
are read by this function.
For the time being at least, all WASM indices are represented as [[u32']] and hence, are read by this function.
(importdesc-func ctx view hmap)
Helper for reading an imported function.
Helper for reading an imported function.
(importdesc-global ctx view hmap)
Helper for reading an imported global.
Helper for reading an imported global.
(importdesc-mem ctx view hmap)
Helper for reading an imported mem.
Helper for reading an imported mem.
(importdesc-table ctx view hmap)
Helper for reading an imported table.
Helper for reading an imported table.
(module' ctx view)
Finds sections and split them into BinF views.
Then, see section'+
.
Finds sections and split them into BinF views. Then, see [[section'+]].
(op-constval const)
(op-constval const opvec _ctx view)
Used for numerical operations declaring a constant value.
Used for numerical operations declaring a constant value.
Map of opcode -> reading function for opcodes which:
Map of **opcode** -> **reading function** for opcodes which: - Have any kind of immediate(s) - Is not 0xFC (the "misc" opcode that leads to a second-level opcode
(op-memarg opvec _ctx view)
Used for memory instructions that have a memarg'
.
Used for memory instructions that have a [[memarg']].
(op-memory opvec _ctx view)
Used for memory instructions that have a memidx'
as only immediate.
Used for memory instructions that have a [[memidx']] as only immediate.
Map of immediate to "misc" opcode (0xFC)** -> reading function.
Map of **immediate** to "misc" opcode (0xFC)** -> **reading function**.
(op-table opvec _ctx view)
Table instruction involving a table index immediate.
Table instruction involving a table index immediate.
(op-var-global opvec _ctx view)
Used for global variable instructions.
Used for global variable instructions.
(op-var-local opvec _ctx view)
Used for local variable instructions.
Used for local variable instructions.
(section'+ ctx)
After applying module'
, actually reads those sections as BinF views.
After applying [[module']], actually reads those sections as BinF views.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close