Help! How to hook protected field offset

HekaHeka709

Solid & Active Platinian
Original poster
Dec 29, 2021
57
9
8
20
Phillipines
How to hook a field offset like this
protected int _moneyPoints; //0x68
field offset hooking tutorial by slicecast don't work
but work for others just this
 
  • Like
Reactions: BernardSoft

Meepoooo

Platinian
May 9, 2022
12
2
3
38
Viet Nam
Try this
C++:
void(* old_UpdateGold)(void * instance);

void UpdateGold(void*instance) {

    if(instance != NULL) {

        if(isUpdateGold) {

            isUpdateGold = false;

            *(int )(uint64_t ) instance + 0x68) = value;

        }

    }

    old_UpdateGold(instance);

}
 
  • Like
Reactions: Mahmoud Gaming

CM_OfficialYT

1/3 Games Approved
Jun 16, 2023
16
1
3
16
Philippines
I'm a Unity Developer just for 10 days making a game.

Everything is built-in C-Sharp language.

Update is called every frame, if the MonoBehaviour is enabled.

That means the update will work after the hook was called.