Liking cljdoc? Tell your friends :D

helins.wasm.read

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.
raw docstring

block'clj/s

(block' opvec ctx view)

blocktype'clj/s

(blocktype' view)

br'clj/s

(br' opvec _ctx view)

br_if'clj/s

(br_if' opvec _ctx view)

br_table'clj/s

(br_table' opvec _ctx view)

byte'clj/s

(byte' view)

call'clj/s

(call' opvec _ctx view)

call_indirect'clj/s

(call_indirect' opvec _ctx view)

code'clj/s

(code' hmap view)

codesec'clj/s

(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.
raw docstring

codesec'2clj/s

(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
raw docstring

custom'clj/s

(custom' ctx view)

customsec'clj/s

(customsec' ctx view)

data'clj/s

(data' ctx view)

data-drop'clj/s

(data-drop' opvec _ctx view)

datacountsec'clj/s

(datacountsec' ctx view)

dataidx'clj/s


datasec'clj/s

(datasec' ctx view)

elem'clj/s

(elem' ctx view)

elem-drop'clj/s

(elem-drop' opvec _ctx view)

elemidx'clj/s


elemkind'clj/s

(elemkind' view)

elemsec'clj/s

(elemsec' ctx view)

elemtype'clj/s


else'clj/s

(else' ctx view)

export'clj/s

(export' ctx view)

exportdesc'clj/s

(exportdesc' ctx view hmap)

exportdesc-anyclj/s

(exportdesc-any ctx hmap k-space idx)

exportdesc-funcclj/s

(exportdesc-func ctx view hmap)

Helper for reading an exported func.

Helper for reading an exported func.
raw docstring

exportdesc-globalclj/s

(exportdesc-global ctx view hmap)

Helper for reading an exported global.

Helper for reading an exported global.
raw docstring

exportdesc-memclj/s

(exportdesc-mem ctx view hmap)

Helper for reading an exported mem.

Helper for reading an exported mem.
raw docstring

exportdesc-tableclj/s

(exportdesc-table ctx view hmap)

Helper for reading an exported table.

Helper for reading an exported table.
raw docstring

exportsec'clj/s

(exportsec' ctx view)

expr'clj/s

(expr' ctx view)

For a vector of instr'.

For a vector of [[instr']].
raw docstring

f32'clj/s

(f32' view)

f64'clj/s

(f64' view)

funcclj/s

(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.
raw docstring

func'clj/s

(func' hmap ctx view)

funcidx'clj/s


funcref'clj/s

(funcref' view)

funcsec'clj/s

(funcsec' ctx view)

functype'clj/s

(functype' view)

global'clj/s

(global' ctx view)

globalidx'clj/s


globalsec'clj/s

(globalsec' ctx view)

globaltype'clj/s

(globaltype' hmap view)

i32'clj/s

(i32' view)

i64'clj/s

(i64' view)

idxclj/s

(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.
raw docstring

if'clj/s

(if' opvec ctx view)

import'clj/s

(import' ctx view)

importdesc'clj/s

(importdesc' ctx view hmap)

importdesc-funcclj/s

(importdesc-func ctx view hmap)

Helper for reading an imported function.

Helper for reading an imported function.
raw docstring

importdesc-globalclj/s

(importdesc-global ctx view hmap)

Helper for reading an imported global.

Helper for reading an imported global.
raw docstring

importdesc-memclj/s

(importdesc-mem ctx view hmap)

Helper for reading an imported mem.

Helper for reading an imported mem.
raw docstring

importdesc-tableclj/s

(importdesc-table ctx view hmap)

Helper for reading an imported table.

Helper for reading an imported table.
raw docstring

importsec'clj/s

(importsec' ctx view)

instr'clj/s

(instr' ctx view)
(instr' ctx opcode view)

instr'+clj/s

(instr'+ ctx view)

Behaves same as expr'.

Behaves same as [[expr']].
raw docstring

labelidx'clj/s


limits'clj/s

(limits' hmap view)

localidx'clj/s


locals'clj/s

(locals' view)

loop'clj/s

(loop' opvec ctx view)

magic'clj/s

(magic' view)

mem'clj/s

(mem' ctx view)

memarg'clj/s

(memarg' vect view)

memidx'clj/s


memory-copy'clj/s

(memory-copy' opvec _ctx view)

memory-fill'clj/s

(memory-fill' opvec _ctx view)

memory-init'clj/s

(memory-init' opvec _ctx view)

memsec'clj/s

(memsec' ctx view)

memtype'clj/s

(memtype' hmap view)

module'clj/s

(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'+]].
raw docstring

mut'clj/s

(mut' view)

name'clj/s

(name' view)

op-constvalclj/s

(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.
raw docstring

op-main->fclj/s

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
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
raw docstring

op-memargclj/s

(op-memarg opvec _ctx view)

Used for memory instructions that have a memarg'.

Used for memory instructions that have a [[memarg']].
raw docstring

op-memoryclj/s

(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.
raw docstring

op-misc->fclj/s

Map of immediate to "misc" opcode (0xFC)** -> reading function.

Map of **immediate** to "misc" opcode (0xFC)** -> **reading function**.
raw docstring

op-tableclj/s

(op-table opvec _ctx view)

Table instruction involving a table index immediate.

Table instruction involving a table index immediate.
raw docstring

op-var-globalclj/s

(op-var-global opvec _ctx view)

Used for global variable instructions.

Used for global variable instructions.
raw docstring

op-var-localclj/s

(op-var-local opvec _ctx view)

Used for local variable instructions.

Used for local variable instructions.
raw docstring

opcode->fclj/s


ref-func'clj/s

(ref-func' opvec _ctx view)

ref-null'clj/s

(ref-null' opvec _ctx view)

reftype'clj/s

(reftype' view)

resulttype'clj/s

(resulttype' view)

s32'clj/s

(s32' view)

s33'clj/s

(s33' view)

s64'clj/s

(s64' view)

section'clj/s

(section' view)

section'+clj/s

(section'+ ctx)

After applying module', actually reads those sections as BinF views.

After applying [[module']], actually reads those sections as BinF views.
raw docstring

section-id'clj/s

(section-id' view)

select-t'clj/s

(select-t' opvec _ctx view)

start'clj/s

(start' hmap view)

startsec'clj/s

(startsec' ctx view)

table'clj/s

(table' ctx view)

table-copy'clj/s

(table-copy' opvec _ctx view)

table-init'clj/s

(table-init' opvec _ctx view)

tableidx'clj/s


tablesec'clj/s

(tablesec' ctx view)

tabletype'clj/s

(tabletype' hmap view)

typeidx'clj/s


typesec'clj/s

(typesec' ctx view)

u32'clj/s

(u32' view)

u64'clj/s

(u64' view)

valtype'clj/s

(valtype' view)

vec'clj/s

(vec' f view)
(vec' ctx f view)

version'clj/s

(version' view)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close