Schemas
A schema describes the game’s structs. Once you have one, you can read a player by player.health instead of [rbx+0x98]. Schemas are .sal files, and everything in Wraith can use them.
enum State : u8 { Idle, Walking, Dead }
[Size(0x100)]struct Player { [0x10] utf8[32] name; [0x30] f32 health; State state; [0x40] Vec3 pos; [0x50] Player* target;}
struct Vec3 { f32 x; f32 y; f32 z; }The schema editor
Section titled “The schema editor”View > New schema opens one. Your text is on the left, a struct laid out on the right.
Type an address on the right and it shows that struct in memory, live. Then right-click a row.
- Define field turns a gap into a field. Type its type, and a name if you like.
- Change type, Rename and Delete field edit it. Fields after it stay put.
- New struct makes an empty struct and points this field at it.
- Map through this follows a pointer and lays out what’s there.
- Find what writes this works here too.
Everything you do on the right updates the text on the left, so you can work either way.
Schemas are saved in the project as schemas/<name>.sal once you change them. View > Plugin schemas opens the ones loaded plugins use, so you can check them against the game.
Writing them
Section titled “Writing them”Types read left to right, like C#. Player*[4] is four pointers to players.
| Type | |
|---|---|
u8 u16 u32 u64 |
Unsigned ints |
i8 i16 i32 i64 |
Signed ints |
f32 f64 |
Floats |
bool |
One byte |
usize isize |
Pointer sized |
utf8[32] utf16[32] |
Fixed size text |
T* |
A pointer |
T[8] |
An array |
[0x30] puts a field at an offset. A field without one goes after the last, lined up like C would. [Size(0x100)] sets a struct’s size so the gaps show up.
There’s more when you need it.
struct Actor { [0x8] u32 id; }struct Enemy : Actor { } // starts with an Actor
union Value { i32 int; f32 float; }
bitfield Flags : u32 { bool alive; [Bit(4)] u8 team : 4;}
opaque Handle; // only ever used through a pointerFinding things by signature
Section titled “Finding things by signature”A schema can find globals and functions by their bytes, so it keeps working after updates.
struct Game { [Sig("48 8B 0D ?? ?? ?? ??", Rip)] static Game* instance;}
[VirtualTable("48 8D 05 ?? ?? ?? ??", Rip)]struct Player { [Sig("40 53 48 83 EC 20")] void heal(f32 amount); [Virtual(3)] void update();}
[Sig("E8 ?? ?? ?? ??", Rip)] void spawn(u32 id);- A
staticwith a[Sig]is a global.Ripfollows the instruction to where it points. - A function with a
[Sig]is found by its bytes. In a struct it takesthiswithout you listing it, unless it’sstatic. [Virtual(n)]is a slot in the struct’s vtable. With a[VirtualTable]on the struct, Wraith can find it without an object.
Ctrl+Enter in the editor runs every [Sig] and shows what each found.
Using them
Section titled “Using them”| Where | How |
|---|---|
| A tweak | Put it under @schema. Scripts get it as types |
| A script | salamander.load(name, text) with the schema’s text |
| A JS plugin | .sal files in schemas/, then import { Player } from "schema" |
| A Lua plugin | .sal files in schemas/, then require("schema") |
| A Zig plugin | .sal files in schemas/, then @import("schema") |
A plugin gets the schemas of the plugins it depends on too. The address list can use every loaded plugin’s.
See TypeScript and JavaScript, Lua and Zig for plugins.
Made with ♥ by Asgard
