Help! HOW TO HOOK SLIDERVALUE ON VOID??

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
how to hook slidervalue in void??
does my code really work? and what's wrong?

C++:
// HEALTH FOR ENEMY BAR

void (*old_UpdateHealth)(void *instance, int HP, int BASEHP);
void HealthUpdate(void *instance, int HP, int BASEHP) {
    if(instance != NULL && sliderValue > 1) {
        return old_UpdateHealth(instance, HP, BASEHP);
    }
    return old_UpdateHealth(instance, HP, BASEHP);
}
and I call the hook with
[//CODE=cpp]
A64HookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0xB44234), (void *)HealthUpdate, (void **)&old_UpdateHealth); [/CODE]
 

Numark

Awesome Active Platinian
May 23, 2017
116
929
193
You can't hook a void, (I mean yes you can, but not like that). I mean a void does not return a value on what you're doing. I can see you're trying to modify it's parameters which is your HP and BASEHP.

I guarantee there's a function pointer tutorial in here, first of all, I don't think a slider would be very useful for health. Just you a switch/toggle to enable the health.

Anyways if you want to modify the parameters of the health with slider.

Just do return old_UpdateHealth(instance, slidervalue, slidervalue);
 

MuhdHafy

Rookie
Apr 6, 2022
3
0
1
27
Malaysia
Hi Sorry if i Disturd you, i still new about hooking
if i want bypass anticheats
does my code works thx


void (*old_StartDetection)(void *instance, void Action detectionCallback, void Action<TimeCheatingDetector);
void StartDetection(void *instance, void Action detectionCallback, void Action<TimeCheatingDetector) {
if(instance != NULL){
return old_StartDetection(instance, Action detectionCallback, Action<TimeCheatingDetector);
}
return old_StartDetection(instance, Action detectionCallback, Action<TimeCheatingDetector);
}


A64HookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x11612E8), (void *)StartDetection, (void **)&old_StartDetection);
 

·҉ dollaz·҉. .

Approved iModder
Approved iModder
Mar 26, 2021
159
1,819
193
Somewhere
Hi Sorry if i Disturd you, i still new about hooking
if i want bypass anticheats
does my code works thx


void (*old_StartDetection)(void *instance, void Action detectionCallback, void Action<TimeCheatingDetector);
void StartDetection(void *instance, void Action detectionCallback, void Action<TimeCheatingDetector) {
if(instance != NULL){
return old_StartDetection(instance, Action detectionCallback, Action<TimeCheatingDetector);
}
return old_StartDetection(instance, Action detectionCallback, Action<TimeCheatingDetector);
}


A64HookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x11612E8), (void *)StartDetection, (void **)&old_StartDetection);
No
 

Daleon228_09

Solid & Active Platinian
Aug 19, 2022
63
9
8
Poland
void (*old_UpdateHealth)(void *instance, int HP, int BASEHP);
void HealthUpdate(void *instance, int HP, int BASEHP) {
if(instance != NULL && sliderValue > 1) {
return old_UpdateHealth(instance, sliderValue , sliderValue );
}
return old_UpdateHealth(instance, HP, BASEHP);
}
 

Daleon228_09

Solid & Active Platinian
Aug 19, 2022
63
9
8
Poland
void (*old_UpdateHealth)(void *instance, int HP, int BASEHP);
void HealthUpdate(void *instance, int HP, int BASEHP) {
if(instance != NULL && sliderValue > 1) {
return old_UpdateHealth(instance, sliderValue , sliderValue );
}
return old_UpdateHealth(instance, HP, BASEHP);
}
You can use this method


void (*old_UpdateHealth)(void *instance, int HP, int BASEHP);
void HealthUpdate(void *instance, int HP, int BASEHP) {
if(instance != NULL && sliderValue > 1) {
HP = sliderValue;
BASEHP = sliderValue;
return old_UpdateHealth(instance, HP, BASEHP);
}
return old_UpdateHealth(instance, HP, BASEHP);
}