Help! Hooked function does not get called

mIsmanXP

Approved Modder
Original poster
Approved Modder
Feb 20, 2022
205
9,573
193
Republic of Indonesia
some functions from each games i tried to mod just cannot be hooked. like the hooked functions are not being called

I've tried several hooking libraries like Dobby Hook, And64InlineHook, and Shadowhook.
each of these libraries return SUCCESS code.
DobbyInstrument works, but I have to manually inspect the registers to find the parameter/argument that I need, I'm using arm64, but I've also tried arm, and the issue remains the same.
does anyone know what's going on?
 

mIsmanXP

Approved Modder
Original poster
Approved Modder
Feb 20, 2022
205
9,573
193
Republic of Indonesia
Maybe youve hooked them wrong, are you using lgl 3.2?
Yes, but i think that's irrelevant because im calling the hooking function directly instead of using macros.
I can hook other function but there's just some function that can't get hooked
im hooking the methodPointer property of MethodInfo
C++:
void *MethodInfo::replace(T func) {
    if (_isAlreadyHooked((uintptr_t) methodPointer)) {
        LOGD("Already hooked");
        return methodPointer;
    }
//    A64HookFunction(methodPointer, (void *) func, &methodPointer);
    DobbyHook(methodPointer, (void *) func, &methodPointer);
    _addToHookedMap((uintptr_t) methodPointer);
    return methodPointer;
}
 

mIsmanXP

Approved Modder
Original poster
Approved Modder
Feb 20, 2022
205
9,573
193
Republic of Indonesia
turns out i have to store the original function to other variable instead of replacing methodPointer.
it still confuse me how some functions can be hooked and some cant