Skip to content

Memory

The game’s memory. Pages are checked first, so bad addresses error instead of crashing. Returned text and slices are good till the thread’s next call into Wraith. Any thread.

Results to narrow down, like Cheat Engine’s. Freed with the plugin, or destroy. A stopped search gives Cancelled.

count(): bigint
next(compare: Wraith.Memory.Scan.Compare | Wraith.Memory.Scan.CompareName, value: string, high: string): Promise<void>
results(offset: number | bigint, limit: number): Array<number>
destroy(): void

Keeps results where compare holds, on a worker. Their values become the next baseline.

Async. Fails with ScanError. Uses Memory.Scan.Compare.

At most limit addresses from offset. 0 is a thousand.

Frees its results now, stopping a running search.

Get it with Api.memory().

readU8(address: number | bigint): number
readU16(address: number | bigint): number
readU32(address: number | bigint): number
readU64(address: number | bigint): bigint
readI8(address: number | bigint): number
readI16(address: number | bigint): number
readI32(address: number | bigint): number
readI64(address: number | bigint): bigint
readF32(address: number | bigint): number
readF64(address: number | bigint): number
readPointer(address: number | bigint): number
writeU8(address: number | bigint, value: number): void
writeU16(address: number | bigint, value: number): void
writeU32(address: number | bigint, value: number): void
writeU64(address: number | bigint, value: number | bigint): void
writeI8(address: number | bigint, value: number): void
writeI16(address: number | bigint, value: number): void
writeI32(address: number | bigint, value: number): void
writeI64(address: number | bigint, value: number | bigint): void
writeF32(address: number | bigint, value: number): void
writeF64(address: number | bigint, value: number): void
writePointer(address: number | bigint, value: number | bigint): void
readString(address: number | bigint, max: number): string
readUtf16(address: number | bigint, max: number): string
writeString(address: number | bigint, value: string): void
writeUtf16(address: number | bigint, value: string): void
readBytes(address: number | bigint, length: number): Uint8Array | null
writeBytes(address: number | bigint, bytes: Array<number>): void
isReadable(address: number | bigint, length: number | bigint): boolean
main(): Wraith.Memory.Module
findModule(name: string): Wraith.Memory.Module
containing(address: number | bigint): Wraith.Memory.Module
find(module: string, name: string, pattern: string): number
findAll(module: string, pattern: string, max: number): Array<number>
regions(module: string, all: boolean): Array<Wraith.Memory.Region>
protect(address: number | bigint, length: number | bigint, protection: Wraith.Memory.Protection | Wraith.Memory.ProtectionName): Wraith.Memory.Protection
scan(options: import("salamander").Given<Wraith.Memory.Scan.Options>): Promise<Wraith.Memory.Scan>

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Fails with MemoryError.

Up to a 0 or max bytes. 0 is 4096.

Fails with MemoryError.

UTF-16 up to a 0 or max chars, as UTF-8. 0 is 4096.

Fails with MemoryError.

With a 0 after.

Fails with MemoryError.

Fails with MemoryError.

A copy, which the caller owns.

Fails with MemoryError.

Fails with MemoryError.

The game’s exe.

Uses Memory.Module.

Fails with MemoryError. Uses Memory.Module.

Fails with MemoryError. Uses Memory.Module.

Where pattern matches once in module. name is logged with the time taken.

Fails with MemoryError.

Every match, at most max. 0 is a thousand.

Fails with MemoryError.

Readable regions, or every committed one with all. Just module’s unless it’s empty.

Fails with MemoryError. Uses Memory.Region.

Gives the first page’s old protection. Put back when the plugin goes.

Fails with MemoryError. Uses Memory.Protection.

Looks for a value on a worker.

Async. Fails with ScanError. Uses Memory.Scan.Options, Memory.Scan.

What can go wrong, besides Cancelled, Unsupported and Gone.

Code Error
1 Unreadable Not mapped, or not readable or writable
2 Unwritable
3 NoModule No module by that name, or the address isn’t in one
4 InvalidPattern A byte pattern that didn’t parse
5 NotFound
6 NotUnique A pattern that matched more than once
7 TooBig
8 ProtectFailed Windows wouldn’t change it
9 Failed

What can go wrong, besides Cancelled, Unsupported and Gone.

Code Error
1 InvalidValue A value that doesn’t parse as its type, or a compare that doesn’t suit it
2 NoModule
3 Busy Still running its last search
4 Failed

An enum of u8.

Value Name
0 no_access
1 read
2 read_write
3 read_execute
4 read_write_execute

A loaded exe or DLL.

A struct, 0x20 bytes, aligned to 8.

Offset Field Type
0x0 name string Like game.exe
0x10 base usize
0x18 size usize
name: string
base: number
size: number

A stretch of memory with the same protection.

A struct, 0x28 bytes, aligned to 8.

Offset Field Type
0x0 start usize
0x8 length usize
0x10 readable bool
0x11 writable bool
0x12 executable bool
0x18 module string The module it’s in, if any
start: number
length: number
readable: boolean
writable: boolean
executable: boolean
module: string

string is UTF-8, utf16 is UTF-16 and bytes is a pattern.

An enum of u8.

Value Name
0 u8
1 u16
2 u32
3 u64
4 i8
5 i16
6 i32
7 i64
8 f32
9 f64
10 string
11 utf16
12 bytes

exact, greater and less take a value, between two, inclusive. The rest compare with last time.

An enum of u8.

Value Name
0 exact
1 changed
2 unchanged
3 increased
4 decreased
5 greater
6 less
7 between

A struct, 0x40 bytes, aligned to 8.

Offset Field Type
0x0 type Memory.Scan.Type
0x8 value string As text, like 100, -1.5, hello or 48 8B ?? C3
0x18 module string Just this module, instead of all readable memory
0x28 start usize Or just length bytes from here
0x30 length usize
0x38 unaligned bool Every byte, not just multiples of the value’s size. Far slower and noisier.
0x39 read_only bool Read-only memory too, when scanning all of it
0x3c limit u32 Stops after this many. 0 is a million.
type: Wraith.Memory.Scan.Type | Wraith.Memory.Scan.TypeName
value: string
module: string
start: number
length: number
unaligned: boolean
read_only: boolean
limit: number

Made with ♥ by Asgard