Prompt file imported from Yimura/LabyMenu (
.claude/commands/update-pointers.md). Fill in{{arguments}}before use. Copyright stays with the author.
Update Game Pointers
Verify and update the byte patterns in src/game/pointers/Pointers.cpp against the current GameAssembly.dll loaded in Ghidra.
Scope
{{arguments}}
If no specific pointers are given, verify ALL active (non-commented) patterns in Pointers.cpp.
Steps
-
Read
src/game/pointers/Pointers.cppandPointers.hppto understand the current patterns, what they resolve to, and how they're used (Add/Sub/Rip offsets, SimpleStaticWrapper vs raw pointer, etc.). -
Search each byte pattern in Ghidra using
search_byte_patternsonGameAssembly.dll. UseFFmask for literal bytes and00mask for wildcard (??) bytes. Record which patterns match and which are broken (no matches). -
For broken patterns, find the corresponding function in Ghidra:
- Use
search_functionsto locate the function by its IL2CPP name (e.g.Mirror.NetworkManager$$SetupServer,LobbyManager$$Awake). - Use
disassemble_functionto get the assembly. - Use
read_memoryto get raw bytes for pattern construction.
- Use
-
Construct new unique patterns:
- Include enough context bytes to ensure uniqueness (verify with
search_byte_patterns- must return exactly 1 match). - Use
??wildcards for RIP-relative offsets in MOV/LEA instructions (the 4 bytes after48 8B 05,48 8D 0D, etc.). - Do NOT wildcard register+displacement encodings like
B8 00 00 00inMOV RCX, [RAX+0xB8]- these are fixed struct offsets. - Prefer patterns that encode game-specific field offsets for stability across minor updates.
- Include enough context bytes to ensure uniqueness (verify with
-
Verify static field offsets for SimpleStaticWrapper pointers:
- IL2CPP stores class static fields at
TypeInfo + 0xB8(pointer to static fields struct). - The singleton instance may be at any offset within that struct (not always 0x0).
- Check the actual offset by reading the disassembly (e.g.
MOV RCX, [RCX + 0x10]means offset 0x10). - If the offset differs from what
SimpleStaticWrapperexpects, update theFieldOffsettemplate parameter inPointers.hpp.
- IL2CPP stores class static fields at
-
Calculate Sub/Add offsets for hook pointers (like SetupServer):
- The pattern match address minus the function entry address gives the Sub offset.
- Use
get_function_by_addressto confirm the function entry point.
-
Update the code:
- Update patterns in
Pointers.cpp. - Update Add/Sub/Rip calculations in the scanner callbacks.
- Update
SimpleStaticWrapperfield offsets inPointers.hppif needed.
- Update patterns in
-
Report results in a table showing each pointer's status (OK/UPDATED), old vs new pattern, and any structural changes.
Pattern format reference
Patterns use hex bytes separated by spaces, with ?? for wildcards:
constexpr auto name = Pattern<"48 8B 05 ?? ?? ?? ?? 48 8B 90 B8 00 00 00">("Description");
SimpleStaticWrapper chain
The pointer dereference chain is: *TypeInfo -> +0xB8 (static_fields ptr) -> +FieldOffset -> instance. The FieldOffset template parameter (default 0) controls the offset within static_fields where the instance pointer lives.
