Watches
Memory watches on the CPU’s debug registers, like “find what writes to this”. Four across all plugins. The game doesn’t stop.
remove(): voidremove()void Remove()void remove() constpub fn remove(&self)fn remove(self: Wraith.Watch) voidvoid Wraith_Watch_remove(Wraith_Watch self)remove
Section titled “remove”Fine to call twice.
Watches
Section titled “Watches”Get it with Api.watches().
add(address: number | bigint, length: number, kind: Wraith.Watch.Kind | Wraith.Watch.KindName, handler: Wraith.Watch.Handler): Wraith.Watchadd(address: integer, length: integer, kind: Wraith.Watch.Kind|Wraith.Watch.KindName, handler: Wraith.Watch.Handler): Wraith.WatchWraith.Watch? Add(nuint address, byte length, Wraith.Watch.Kind kind, Wraith.Watch.Handler? handler)sal::Result<Wraith::Watch, Wraith::WatchError> add(uintptr_t address, uint8_t length, Wraith::Watch_Kind kind, Wraith::Watch_Handler handler) constpub fn add(&self, address: usize, length: u8, kind: wraith::WatchKind, handler: wraith::WatchHandler) -> Result<wraith::Watch, wraith::WatchError>fn add(self: Wraith.Watches, address: usize, length: u8, kind: Wraith.Watch.Kind, handler: Wraith.Watch.Handler) (Wraith.WatchError || rt.Failure)!Wraith.Watchuint32_t Wraith_Watches_add(Wraith_Watches self, uintptr_t address, uint8_t length, Wraith_Watch_Kind kind, Wraith_Watch_Handler handler, Wraith_Watch *out)Until it’s removed or the plugin goes.
Fails with WatchError. Uses Watch.Kind, Watch.Handler, Watch.
WatchError
Section titled “WatchError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | Unavailable |
They couldn’t be set up in this game |
| 2 | NoFreeSlot |
All four are in use |
| 3 | Misaligned |
The address isn’t a multiple of the length |
| 4 | InvalidLength |
1, 2, 4, or 8 on x64. execute takes 1. |
| 5 | Failed |
Watch.Kind
Section titled “Watch.Kind”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | write |
|
| 1 | access |
Reads or writes, since the CPU can’t watch reads alone |
| 2 | execute |
About to run |
Watch.Hit
Section titled “Watch.Hit”A struct, 0x20 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | address |
usize |
What’s watched |
| 0x8 | instruction |
usize |
The instruction that hit if known, else ip. For execute, the one about to run. |
| 0x10 | ip |
usize |
Just past the instruction for write and access |
| 0x18 | thread |
u32 |
address: numberinstruction: numberip: numberthread: numberaddress: integerinstruction: integerip: integerthread: integernuint Addressnuint Instructionnuint Ipuint Threaduintptr_t addressuintptr_t instructionuintptr_t ipuint32_t threadpub address: usizepub instruction: usizepub ip: usizepub thread: u32address: usizeinstruction: usizeip: usizethread: u32uintptr_t addressuintptr_t instructionuintptr_t ipuint32_t threadWatch.Handler
Section titled “Watch.Handler”On the render thread at the start of the next frame, with the registers as they were.
Wraith.Watch.HandlerWraith.Watch.HandlerWraith.Watch.HandlerWraith::Watch_Handlerwraith::WatchHandlerWraith.Watch.HandlerWraith_Watch_Handlerwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
