Help! How to hook protected field offset

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);

}
 
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.
 
Back
Top Bottom