Solved void

Status
Not open for further replies.

Viktorovich31

Platinian
Original poster
Sep 16, 2022
38
0
6
42
Russian
Hello! Help me please. This code increases the coins in the game. After each stage, a lot of coins are added, and after several stages, when there are a lot of coins, the game just freezes. Help fix this so that a lot of coins are not added. Or freeze this value (999999)

Code:
void (*old_set_coinCount)(void *instance, int);
void set_coinCount(void *instance, int) {
    if (instance != NULL) {
    }
    old_set_coinCount(instance, 999999);
}
 

BeginnerBR

Solid & Active Platinian
Sep 4, 2022
62
14
8
24
Brasil
try this
C++:
void (*addcoin)(void *instance, int value);
void (*old_update)(void *instance);
void update(void *instance) {
if (instance != NULL) {
if (Coin) {
addcoin(instance, 99999);
  }
}
old_update(instance);
}

addcoin = (void(*)(void *,int))getAbsoluteAddress("libil2cpp.so", 0x81C4FC);
HOOK_LIB("libil2cpp.so","0x7C5D64", update, old_update);
 

Viktorovich31

Platinian
Original poster
Sep 16, 2022
38
0
6
42
Russian
try this
C++:
void (*addcoin)(void *instance, int value);
void (*old_update)(void *instance);
void update(void *instance) {
if (instance != NULL) {
if (Coin) {
addcoin(instance, 99999);
  }
}
old_update(instance);
}

addcoin = (void(*)(void *,int))getAbsoluteAddress("libil2cpp.so", 0x81C4FC);
HOOK_LIB("libil2cpp.so","0x7C5D64", update, old_update);
The class does not have an update method.
 

Viktorovich31

Platinian
Original poster
Sep 16, 2022
38
0
6
42
Russian
try this
C++:
void (*addcoin)(void *instance, int value);
void (*old_update)(void *instance);
void update(void *instance) {
if (instance != NULL) {
if (Coin) {
addcoin(instance, 99999);
  }
}
old_update(instance);
}

addcoin = (void(*)(void *,int))getAbsoluteAddress("libil2cpp.so", 0x81C4FC);
HOOK_LIB("libil2cpp.so","0x7C5D64", update, old_update);
Have a look, please! The money is kept here. How to break?
 

Attachments

Poison Modz

Approved Modder
Approved Modder
Aug 27, 2020
158
11,006
1,193
India
void (*old_add)(void *instance, int value);
void add(void *instance, int value) {
if (instance != NULL) {
if (AddCoins) {
old_addkeys(instance, 1000000);
return;
}
}
old_add(instance, value);

HOOK_LIB("libil2cpp.so","0x7C5D64", add, old_add);
 

NewbieNoobz

Platinian
Jun 3, 2022
5
2
3
24
Asia
Bool AddCoins;

void (*old_add)(void *instance, int value);
void add(void *instance, int value) {
if (instance != NULL) {
if (AddCoins) {
old_addkeys(instance, 1000000);
return;
}
}
old_add(instance, value);
 

DaRealPanDa

Co-Administrator
Staff member
Supporting-Team
Global Moderator
Social Media
Mar 12, 2018
6,771
15,651
2,120
27
Skyrim
Thread will be set to "solved" and closed.
When you're not happy with that just send me a message and i will re-open the thread for you.

Thanks.
 
Status
Not open for further replies.