Help! hook without update

BeginnerBR

Solid & Active Platinian
Original poster
Sep 4, 2022
62
14
8
24
Brasil
Can someone more experienced show the error?

I'm trying to hook a field that doesn't have an update but something is going wrong, could someone show me the error?
C++:
bool Coin;

void (*old_update)(void* _this);
void update(void* _this) {
if(_this != NULL) {
void *MoneyClass = *(void**)((uint64_t)_this + 0x20);
{
if(Coin != NULL) {
*(int *) ((uint64_t) MoneyClass + 0x10) = 999;
}
}
}
        old_update(_this);
}



MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x81C0EC), (void *) update, (void **) &old_update);
 
  • Like
Reactions: Snety Aviles

sobogamer_2020

Approved Modder
Approved Modder
Apr 6, 2022
376
14,566
1,193
23
Romania
Pretty sure most of the games doesnt have the Coins as a field Offset, so the chances to work will be very low, also if that class doesnt have an update function, Search up for other classes that are similar with your class and use its update class, but before this i suggest you to Make sure You have looked attently when You searched for update because "Private void update()" is not the only update function that could work, there can be Like "LateUpdate" or "FixedUpdate" so Make sure =)
 

BeginnerBR

Solid & Active Platinian
Original poster
Sep 4, 2022
62
14
8
24
Brasil
Pretty sure most of the games doesnt have the Coins as a field Offset, so the chances to work will be very low, also if that class doesnt have an update function, Search up for other classes that are similar with your class and use its update class, but before this i suggest you to Make sure You have looked attently when You searched for update because "Private void update()" is not the only update function that could work, there can be Like "LateUpdate" or "FixedUpdate" so Make sure =)
I already checked this class does not have lateupdate, fixedupdate or private update, and I checked this field is the value of the coins (I tested it via gameguardian)
Sorry if you don't understand what I said, my English is terrible.