Fixing Unity Game Hooking Problems (Game Crashes/Enemies Also get Inf HP...etc) Part 1

Channel:
Subscribers:
4,620
Published on ● Video Link: https://www.youtube.com/watch?v=WynxFNoAfzw



Duration: 0:00
97 views
7


So as discussed in the tutorial guys, in some games hooking the GET float or INT function doesn't do anything for you. In that particular situation you would need to hook a VOID Set function. Below you can find the proper syntax for that. If it's an INT instead of a float then replace everything that says "float" with "INT" and replace where it says ANYNAME with whatever you want such as GodMode, Ammo, Grenades, Speed....etc

void (*ANYNAME)(void *instance,float value);
void (*_Voidfloathooking)(void *instance);
void Voidfloathooking(void *instance){
if (instance != NULL) {
if(VoidHookingfloat) {
bool isControlByLocalPlayer = get_isControlByLocalPlayer(instance);
if(isControlByLocalPlayer) {
ANYNAME(instance, 2147483647); //you can replace this number with any value you want such as 999999 for example
}
}
}
return _Voidfloathooking(instance);
}


Call the HOOK like this (if your LIB file name is something other than "libil2cpp.so" then use your proper LIB file name of course):
HOOK_LIB("libil2cpp.so","0xUpdateOffset",Voidfloathooking,_Voidfloathooking);
ANYNAME = (void (*)(void *, float))getAbsoluteAddress("libil2cpp.so",0xFunctionOffset);

*********************************************

To unlink enemies you need a special/unique identifier from the same class you are modding to check if it's YOU in order to apply the cheat. So use the syntax below and be sure to replace where it says "get_isControlByLocalPlayer" with whatever your unique identifier is.

bool (*get_isControlByLocalPlayer)(void *instance);
void (*ANYNAME)(void *instance,float value);
void (*_Voidfloathooking)(void *instance);
void Voidfloathooking(void *instance) {
if (instance != NULL) {
if(VoidHookingfloat) {
bool isControlByLocalPlayer = get_isControlByLocalPlayer(instance);
if(isControlByLocalPlayer) {
ANYNAME(instance, 2147483647); //you can replace this value with any number you want such as 999999 for example
}
}
}
return _Voidfloathooking(instance);
}

Call your HOOK like this. Be sure to replace where it says "get_isControlByLocalPlayer" with whatever your unique identifier is, as well as the name of your LIB file.

HOOK_LIB("libil2cpp.so","0xUpdateOffset",Voidfloathooking,_Voidfloathooking);
Godmode = (void (*)(void *, float))getAbsoluteAddress("libil2cpp.so",0xFunctionOffset);
get_isControlByLocalPlayer = (bool (*)(void*))getAbsoluteAddress("libil2cpp.so", 0xOffsetOfYourIdentifer);

***********************************************
REMNDER:
If you're using the same unique identifier for multiple cheats, remember that you can only have it declared in one cheat. Don't duplicate it in multiple cheats. Otherwise you will get errors when you compile. Don't worry, it will still work for all your other cheats even if it's only declared once.

If you don't have a unique identifier (to check if it's YOU) in the same class, then you can use one from a different class like this. Just remember to replace "isControlByLocalPlayer" with the name of YOUR OWN unique identifier, and pay attention to where it says INT. If you have Float instead, then replace it with that. And keep in mind that you need to have unique names of voidinthooking or voidfloathooking. So number them voidinthooking1, voidinthooking2....or voidfloathooking1, voidfloahooking2....etc
Same with where it says ANYNAME. They need to be unique. So name them GODMODE or AMMO or GRENADE....etc.
The part that says "NetworkPlayer" below is the name of the field in my current class, which has the same name as the class I need access to. It will give me access to that class. Replace "NetworkPlayer" with your own field name, and add it's field offset where it says 0xFieldOffset.

bool (*get_isControlByLocalPlayer)(void *instance);         
void (*ANYNAME)(void *instance,int value);
void (*_voidinthooking)(void *instance);
void Voidinthooking(void *instance) {
if (instance != NULL) {
void *NetworkPlayer = *(void**)((uint64_t)instance + 0xFieldOffset); // This is where you put the name of the field in your current class, which is the same name as the class you are trying to get access to.
if(NetworkPlayer != NULL) //
{
if (VoidHookingint) {
bool isControlByLocalPlayer = get_isControlByLocalPlayer(NetworkPlayer);
if(isControlByLocalPlayer) {
(instance, 999); //you can replace it with any number you want
}
}
}
return _voidinthooking(instance);
}
}

Call your hook like this, (with your correct LIB file's name if it's not the same as libil2cpp.so)

HOOK_LIB("libil2cpp.so","0x59709C",Voidinthooking3,_voidinthooking3);
ANYNAME = (void (*)(void *, int))getAbsoluteAddress("libil2cpp.so",0x59708C);

NOTE:
Keep in mind, if you've used this in another hook call:
get_isControlByLocalPlayer = (bool (*)(void*))getAbsoluteAddress("libil2cpp.so", 0xOffsetOfYourIdentifer);

then you can only have it in one place. Don't repeat it. Otherwise you will get errors when you compile. Don't worry, it will still work for all your other hook calls even if it's only declared in one place.