Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

laundervictim package

Overview

Package laundervictim is the "victim" realm in the launder-game tests. It exposes a package-level g that an attacker tries to mutate by various means. Two shapes are exposed:

  • gVal is `launderpkg.Object` (value type).
  • gPtr is `*launderpkg.Object` (pointer to a fresh Object).

Both are allocated at init under this realm's context, so their PkgID stamp is /r/.../laundervictim. The attacker's job is to make the stamp not match m.Realm at the write site — by laundering the stamp, capturing the value, or exploiting a borrow-rule shift.

Functions

GetBuf

func GetBuf() []byte

GetBuf returns the victim's own byte buffer. The returned slice aliases the victim's persisted backing array (/r/laundervictim-stamped).

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.GetBuf()"

Result

GetImm

func GetImm() *launderpkg.Immutable

GetImm returns the pointer to gImm — a *Immutable, which has no mutator method in /p/launderpkg. Victim's intent: callers can read but not write.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.GetImm()"

Result

GetPtr

func GetPtr() *launderpkg.Object

GetPtr returns the pointer to gPtr's underlying Object. The returned pointer aliases the victim's persisted state.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.GetPtr()"

Result

GetVal

func GetVal() launderpkg.Object

GetVal returns g by VALUE (caller gets a copy).

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.GetVal()"

Result

GetValAddr

func GetValAddr() *launderpkg.Object

GetValAddr returns &gVal — a pointer to the value-typed slot. The returned pointer aliases the victim's persisted state.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.GetValAddr()"

Result

Invoke

func Invoke(e Exploiter)

Invoke calls the attacker's methods passing the victim's g by both value and by pointer.

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.Invoke()"

Result

ReadBuf

func ReadBuf() string

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.ReadBuf()"

Result

ReadImm

func ReadImm() string

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.ReadImm()"

Result

ReadPtr

func ReadPtr() string

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.ReadPtr()"

Result

ReadVal

func ReadVal() string

ReadVal / ReadPtr / ReadImm / ReadBuf report the current values for after-attack verification.

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/tests/vm/laundervictim.ReadVal()"

Result