Guide:Finding pointers and offsets: Difference between revisions
Guide:Finding pointers and offsets (view source)
Revision as of 18:52, 9 September 2022
, 1 year agoMinor text fixes
TheOnlyZac (talk | contribs) (Fixed typo, minor tweak) |
TheOnlyZac (talk | contribs) (Minor text fixes) |
||
Line 1:
This tutorial will teach you how to find pointers to structs and use offsets to access values stored within those structs. Basically every value the game uses is stored in a struct somewhere in memory, so if you can find a global pointer to a struct, and then figure out the offset to access a value in that struct, you can access that value in any map without having to scan for it. The steps below should work for all three games,
{{Needs images|
==How to find the pointer/offset to a value stored in any struct==
#'''Find the address of the value within the struct you want to find the pointer for.'''
#*In this tutorial we will use [[Sly 2:Jt|Sly
#*We don't need to the 0x20 at the front of the address because the <tt>0x20000000</tt> is the emulator base address, and pointers are automatically read relative to the base address.
#'''Set a read breakpoint on that address in the PCSX2 debugger.'''
Line 11:
#*Once it opens, click '''Set Breakpoint'''.
#*In the '''Address''' box, enter 0xFB3710,
#*Check the box for
#*Click '''OK'''.
#:{{No image}}
#'''Do something to make the game read the value.'''
#*In
#*When your breakpoint hits, the game will freeze and the debugger will show you which instruction it broke on.
#'''In the Debugger, look at the assembly code instruction that reads the value, and see what address is in the register it used.'''
Line 37:
====Option B====
Use the tutorial below to find the base address of the Sly entity struct using the [[Sly 2:FK$x|FK$
|