Help! hooking update

power2020202020

Solid & Active Platinian
Original poster
Nov 3, 2022
58
15
8
34
brazil
Hello, in my game there is more than one update function and I counted there are 10 lateupdate functions and 5 update functions. All the functions are different and which ones do I use when hooking void coins and crystals? Will either work? or I know the right function to work with each update I make.
 
  • Like
Reactions: nowhere_222

blank667

Platinian
Nov 30, 2023
7
2
3
France
It depends on the context of the application. Can you give me the names of the classes that contain the Update method so that I can help you?
 

power2020202020

Solid & Active Platinian
Original poster
Nov 3, 2022
58
15
8
34
brazil
You can try using another method in the same class, it doesn't always have to be "update"

I can use this 2 class like this example is in the game update plus name of the function that will work or just works update example public void update { } nothing else written

private int maxShards; // 0x78
private void UpdateMaxShards() { } 0x13FE830
 

libModz

Awesome Active Platinian
Jun 2, 2022
167
29
28
UK
I can use this 2 class like this example is in the game update plus name of the function that will work or just works update example public void update { } nothing else written

private int maxShards; // 0x78
private void UpdateMaxShards() { } 0x13FE830
Try them they'll either work or they won't.
 

power2020202020

Solid & Active Platinian
Original poster
Nov 3, 2022
58
15
8
34
brazil
Try them they'll either work or they won't.
I tested it and it didn't work so I always have to use the update from the same class because these were from different classes... I can only get an update from the same class or this update could be hidden in a different class or the codestage doesn't let the hack work? because there are many updates in dump.cs
 

power2020202020

Solid & Active Platinian
Original poster
Nov 3, 2022
58
15
8
34
brazil
Try them they'll either work or they won't.
bool goldss = false;

bool shardss = false;

void(*old_Golds)(void *instance);
void Golds(void *instance) {
if(instance != NULL) {
if (goldss) {
*(int *) ((uint64_t) instance + 0x18) = 100000;
*(int *) ((uint64_t) instance + 0x12AD11C) = 100000;
}
}
old_Golds(instance);
}

void(*old_shards)(void *instance);
void shards(void *instance) {
if(instance != NULL) {
if (shardss) {
*(int *) ((uint64_t) instance + 0x1C) = 1000000;
*(int *) ((uint64_t) instance + 0x12AD124) = 1000000;
}
}
old_shards(instance);
}

MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x16CB0C0), (void *) Golds, (void **) &old_Golds);

MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x13FE830), (void *) shards, (void **) &old_shards)


OBFUSCATE("20_Toggle_golds"),
OBFUSCATE("30_Toggle_shards"),

switch (featNum) {
case 20:
goldss = !goldss;
break;
case 30:
shardss = !shardss;
break;
}
}
}


The game stays on a black screen, why?
 

libModz

Awesome Active Platinian
Jun 2, 2022
167
29
28
UK
bool goldss = false;

bool shardss = false;

void(*old_Golds)(void *instance);
void Golds(void *instance) {
if(instance != NULL) {
if (goldss) {
*(int *) ((uint64_t) instance + 0x18) = 100000;
*(int *) ((uint64_t) instance + 0x12AD11C) = 100000;
}
}
old_Golds(instance);
}

void(*old_shards)(void *instance);
void shards(void *instance) {
if(instance != NULL) {
if (shardss) {
*(int *) ((uint64_t) instance + 0x1C) = 1000000;
*(int *) ((uint64_t) instance + 0x12AD124) = 1000000;
}
}
old_shards(instance);
}

MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x16CB0C0), (void *) Golds, (void **) &old_Golds);

MSHookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x13FE830), (void *) shards, (void **) &old_shards)


OBFUSCATE("20_Toggle_golds"),
OBFUSCATE("30_Toggle_shards"),

switch (featNum) {
case 20:
goldss = !goldss;
break;
case 30:
shardss = !shardss;
break;
}
}
}


The game stays on a black screen, why?
What game?