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)
source

blocktype'clj/s

(blocktype' view)
source

br'clj/s

(br' opvec _ctx view)
source

br_if'clj/s

(br_if' opvec _ctx view)
source

br_table'clj/s

(br_table' opvec _ctx view)
source

byte'clj/s

(byte' view)
source

call'clj/s

(call' opvec _ctx view)
source

call_indirect'clj/s

(call_indirect' opvec _ctx view)
source

code'clj/s

(code' hmap view)
source

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

custom'clj/s

(custom' ctx view)
source

customsec'clj/s

(customsec' ctx view)
source

data'clj/s

(data' ctx view)
source

data-drop'clj/s

(data-drop' opvec _ctx view)
source

datacountsec'clj/s

(datacountsec' ctx view)
source

dataidx'clj/s

source

datasec'clj/s

(datasec' ctx view)
source

elem'clj/s

(elem' ctx view)
source

elem-drop'clj/s

(elem-drop' opvec _ctx view)
source

elemidx'clj/s

source

elemkind'clj/s

(elemkind' view)
source

elemsec'clj/s

(elemsec' ctx view)
source

elemtype'clj/s

source

else'clj/s

(else' ctx view)
source

export'clj/s

(export' ctx view)
source

exportdesc'clj/s

(exportdesc' ctx view hmap)
source

exportdesc-anyclj/s

(exportdesc-any ctx hmap k-space idx)
source

exportdesc-funcclj/s

(exportdesc-func ctx view hmap)

Helper for reading an exported func.

Helper for reading an exported func.
sourceraw docstring

exportdesc-globalclj/s

(exportdesc-global ctx view hmap)

Helper for reading an exported global.

Helper for reading an exported global.
sourceraw docstring

exportdesc-memclj/s

(exportdesc-mem ctx view hmap)

Helper for reading an exported mem.

Helper for reading an exported mem.
sourceraw docstring

exportdesc-tableclj/s

(exportdesc-table ctx view hmap)

Helper for reading an exported table.

Helper for reading an exported table.
sourceraw docstring

exportsec'clj/s

(exportsec' ctx view)
source

expr'clj/s

(expr' ctx view)

For a vector of instr'.

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

f32'clj/s

(f32' view)
source

f64'clj/s

(f64' view)
source

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

func'clj/s

(func' hmap ctx view)
source

funcidx'clj/s

source

funcref'clj/s

(funcref' view)
source

funcsec'clj/s

(funcsec' ctx view)
source

functype'clj/s

(functype' view)
source

global'clj/s

(global' ctx view)
source

globalidx'clj/s

source

globalsec'clj/s

(globalsec' ctx view)
source

globaltype'clj/s

(globaltype' hmap view)
source

i32'clj/s

(i32' view)
source

i64'clj/s

(i64' view)
source

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

if'clj/s

(if' opvec ctx view)
source

import'clj/s

(import' ctx view)
source

importdesc'clj/s

(importdesc' ctx view hmap)
source

importdesc-funcclj/s

(importdesc-func ctx view hmap)

Helper for reading an imported function.

Helper for reading an imported function.
sourceraw docstring

importdesc-globalclj/s

(importdesc-global ctx view hmap)

Helper for reading an imported global.

Helper for reading an imported global.
sourceraw docstring

importdesc-memclj/s

(importdesc-mem ctx view hmap)

Helper for reading an imported mem.

Helper for reading an imported mem.
sourceraw docstring

importdesc-tableclj/s

(importdesc-table ctx view hmap)

Helper for reading an imported table.

Helper for reading an imported table.
sourceraw docstring

importsec'clj/s

(importsec' ctx view)
source

instr'clj/s

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

instr'+clj/s

(instr'+ ctx view)

Behaves same as expr'.

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

labelidx'clj/s

source

limits'clj/s

(limits' hmap view)
source

localidx'clj/s

source

locals'clj/s

(locals' view)
source

loop'clj/s

(loop' opvec ctx view)
source

magic'clj/s

(magic' view)
source

mem'clj/s

(mem' ctx view)
source

memarg'clj/s

(memarg' vect view)
source

memidx'clj/s

source

memory-copy'clj/s

(memory-copy' opvec _ctx view)
source

memory-fill'clj/s

(memory-fill' opvec _ctx view)
source

memory-init'clj/s

(memory-init' opvec _ctx view)
source

memsec'clj/s

(memsec' ctx view)
source

memtype'clj/s

(memtype' hmap view)
source

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

mut'clj/s

(mut' view)
source

name'clj/s

(name' view)
source

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.
sourceraw 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
sourceraw 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']].
sourceraw 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.
sourceraw docstring

op-misc->fclj/s

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

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

op-tableclj/s

(op-table opvec _ctx view)

Table instruction involving a table index immediate.

Table instruction involving a table index immediate.
sourceraw docstring

op-var-globalclj/s

(op-var-global opvec _ctx view)

Used for global variable instructions.

Used for global variable instructions.
sourceraw docstring

op-var-localclj/s

(op-var-local opvec _ctx view)

Used for local variable instructions.

Used for local variable instructions.
sourceraw docstring

opcode->fclj/s

source

ref-func'clj/s

(ref-func' opvec _ctx view)
source

ref-null'clj/s

(ref-null' opvec _ctx view)
source

reftype'clj/s

(reftype' view)
source

resulttype'clj/s

(resulttype' view)
source

s32'clj/s

(s32' view)
source

s33'clj/s

(s33' view)
source

s64'clj/s

(s64' view)
source

section'clj/s

(section' view)
source

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

section-id'clj/s

(section-id' view)
source

select-t'clj/s

(select-t' opvec _ctx view)
source

start'clj/s

(start' hmap view)
source

startsec'clj/s

(startsec' ctx view)
source

table'clj/s

(table' ctx view)
source

table-copy'clj/s

(table-copy' opvec _ctx view)
source

table-init'clj/s

(table-init' opvec _ctx view)
source

tableidx'clj/s

source

tablesec'clj/s

(tablesec' ctx view)
source

tabletype'clj/s

(tabletype' hmap view)
source

typeidx'clj/s

source

typesec'clj/s

(typesec' ctx view)
source

u32'clj/s

(u32' view)
source

u64'clj/s

(u64' view)
source

valtype'clj/s

(valtype' view)
source

vec'clj/s

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

version'clj/s

(version' view)
source

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

× close