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.
(block' opvec ctx view)
(blocktype' view)
(br' opvec _ctx view)
(br_if' opvec _ctx view)
(br_table' opvec _ctx view)
(byte' view)
(call' opvec _ctx view)
(call_indirect' opvec _ctx view)
(code' hmap view)
(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
(custom' ctx view)
(customsec' ctx view)
(data' ctx view)
(data-drop' opvec _ctx view)
(datacountsec' ctx view)
(datasec' ctx view)
(elem' ctx view)
(elem-drop' opvec _ctx view)
(elemkind' view)
(elemsec' ctx view)
(else' ctx view)
(export' ctx view)
(exportdesc' ctx view hmap)
(exportdesc-any ctx hmap k-space idx)
(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.
(exportsec' ctx view)
(f32' view)
(f64' view)
(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.
(func' hmap ctx view)
(funcref' view)
(funcsec' ctx view)
(functype' view)
(global' ctx view)
(globalsec' ctx view)
(globaltype' hmap view)
(i32' view)
(i64' view)
(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.
(if' opvec ctx view)
(import' ctx view)
(importdesc' ctx view hmap)
(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.
(importsec' ctx view)
(instr' ctx view)
(instr' ctx opcode view)
(limits' hmap view)
(locals' view)
(loop' opvec ctx view)
(magic' view)
(mem' ctx view)
(memarg' vect view)
(memory-copy' opvec _ctx view)
(memory-fill' opvec _ctx view)
(memory-init' opvec _ctx view)
(memsec' ctx view)
(memtype' hmap view)
(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'+]].
(mut' view)
(name' view)
(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.
(ref-func' opvec _ctx view)
(ref-null' opvec _ctx view)
(reftype' view)
(resulttype' view)
(s32' view)
(s33' view)
(s64' view)
(section' view)
(section'+ ctx)
After applying module'
, actually reads those sections as BinF views.
After applying [[module']], actually reads those sections as BinF views.
(section-id' view)
(select-t' opvec _ctx view)
(start' hmap view)
(startsec' ctx view)
(table' ctx view)
(table-copy' opvec _ctx view)
(table-init' opvec _ctx view)
(tablesec' ctx view)
(tabletype' hmap view)
(typesec' ctx view)
(u32' view)
(u64' view)
(valtype' view)
(vec' f view)
(vec' ctx f view)
(version' view)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close