Help! How to link HOOK_LIB?

sanyabrz

Platinian
Hello everyone, tell me how to connect HOOK_LIB? I'm going to make an offset tester, but I can't connect HOOK_LIB to functions. It seems like the quotes are in the way, if you remove them the error remains, it just crashes.

HOOK_LIB("MY.libname", "MY.offsetToUpdateField", HookField,_HookField); - don't working.
HOOK_LIB(MY.libname, MY.offsetToUpdateField, HookField,_HookField); - don't working

I took the LGL mod menu as a basis.
 
can you send the define for it?

it should look like this:
#define HOOK_LIB(...
#define MY_HOOK(lib, offset, ptr, orig) hook((void *)getAbsoluteAddress(lib, string2Offset(offset)), (void *)ptr, (void **)&orig)
done

when I paste this into aarch64 the game crashes on startup

I need to do it for 64 bit. but 32 bit works when I insert this into cases.
so i use aarch64

my code that crashes on startup:

#if defined(__aarch64__)

MY_HOOK(MY.libname, MY.offsetToUpdateField, HookField,_HookField);

#else

LOGI(OBFUSCATE("Done"));
#endif
 
HOOK_LIB is a macro for you to use. It makes things easier and readable.

#define MY_HOOK(lib, offset, ptr, orig) (THIS IS A MACRO)
OR
hook((void *)getAbsoluteAddress(lib, string2Offset(offset)), (void *)ptr, (void **)&orig);

To use the macro, you have to understand it and follow its procedures.
It'll be like this. HOOK_LIB("libil2cpp.so", 0x12345, UpdateFromClassPTR, UpdateFromClassOriginalPTR);

the hook is the most basic way to use.
 
Back
Top Bottom