void (*old_gravity)(void *instance);
void gravity(void *instance) {
if (instance != NULL) {
if (Gravity) {
*(float *) ((uint32_t) instance + 0x30) = 0;
}
}
return old_gravity(instance);
}
void (*old_fly)(void *instance);
void fly(void *instance) {
if (instance != NULL) {
if (Fly) {
*(float *) ((uint32_t) instance + 0x40) = 0.5;
}
}
return old_fly(instance);
}
HOOK_LIB("libil2cpp.so", "0xA64C08", gravity, old_gravity);
HOOK_LIB("libil2cpp.so", "0xA64C08", fly, old_fly);
What's wrong for only one to work? (I'm a beginner)
void(*old_GameManager)(void *instance);
void GameManager(void *instance) {
if(instance != NULL) {
if (isReloading) {
*(float *) ((uint32_t) instance + 0x30) = 0.0f;
}
if (Ammo) { //if Toggle
*(int *) ((uint32_t) instance + 0x32) = 99999;
}
if (UnlockPremium) { //if Toggle
*(bool *) ((uint32_t) instance + 0x343) = true;
}
}
old_GameManager(instance);
}
U gotta use them in one hook
HOOK_LIB("libil2cpp.so", "0x00000", GameManager, old_GameManager);
void (*old_PlayerClass)(void *instance);
void PlayerClass(void *instance) {
if (instance != NULL) {
if (Gravity) {
*(float *) ((uint32_t) instance + 0x30) = 0.00f;
}
if (fly) {
*(float *) ((uint32_t) instance + 0x40) = 0.00f;
}
}
return old_PlayerClass(instance);
}
One address cannot be hooked twice, and indeed ... For example, one variable field cannot be divided into two during the game and work differently.
void(*old_GameManager)(void *instance);
void GameManager(void *instance) {
if(instance != NULL) {
if (isReloading) {
*(float *) ((uint32_t) instance + 0x30) = 0.0f;
}
if (Ammo) { //if Toggle
*(int *) ((uint32_t) instance + 0x32) = 99999;
}
if (UnlockPremium) { //if Toggle
*(bool *) ((uint32_t) instance + 0x343) = true;
}
}
old_GameManager(instance);
}
U gotta use them in one hook
HOOK_LIB("libil2cpp.so", "0x00000", GameManager, old_GameManager);
void(*old_GameManager)(void *instance);
void GameManager(void *instance) {
if(instance != NULL) {
if (isReloading) {
*(float *) ((uint32_t) instance + 0x30) = 0.0f;
}
if (Ammo) { //if Toggle
*(int *) ((uint32_t) instance + 0x32) = 99999;
}
if (UnlockPremium) { //if Toggle
*(bool *) ((uint32_t) instance + 0x343) = true;
}
}
old_GameManager(instance);
}
U gotta use them in one hook
HOOK_LIB("libil2cpp.so", "0x00000", GameManager, old_GameManager);
Thanks!
Void can return value replace return old_PlayerClass(instance) just de returnC++:void (*old_PlayerClass)(void *instance); void PlayerClass(void *instance) { if (instance != NULL) { if (Gravity) { *(float *) ((uint32_t) instance + 0x30) = 0.00f; } if (fly) { *(float *) ((uint32_t) instance + 0x40) = 0.00f; } } ; }
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies