This is the AMP version of this page.
If you want to load the real page instead, click this text.

Tutorial How to unlink functions in IL2CPP and other native games

Estou com uma duvida nesse exemplo abaixo, minha offset isBot é 0x8DA1AC, teria como fazer um exemplo com esse tipo de offset.

int(*old_get_ammoInClip)(void *instance);
int get_ammoInClip(void *instance)
{
if(instance != NULL)
{
void *AccessCharacterController = *(void**)((uint64_t)instance + 0x32); // Use the field and make a pointer to get access to CharacterController
if(AccessCharacterController != NULL) // Since we use a pointer for the field 0x32 to get access to the CharacterController class, we have to check if it isn't null
{
bool IsBot = *(bool*)((uint64_t)AccessCharacterController + 0x24); // use it to access the field isBot in the class CharacterController
if(!IsBot) // Check if it's not a bot
{
return 99999; // Now only you get 99999 ammo
}
}
}
return old_get_ammoInClip(instance); // Return original value for bots
}
MsHookFunction((void*)getAbsoluteAddress(0x34287), (void*)get_ammoInClip, (void**)&old_get_ammoInClip);
 
Thank you so much for this tutorial!
This helped me find a solution for field hooking outside class (i already got a var poitining to the target class but didnt know which datatype it was :>)
Its been 3 days since i started modding and i already can hook and make mod menus for mono- or il2cpp games.
Thank you
 
Can this be used? I want to edit something in the football club that I use but in the club class it is for all clubs and there is a club ID method and I know the list of club IDs, can anyone help me, I am a beginner and have never learned CC, I just followed the tutorial

// RVA: 0x6864C0 Offset: 0x6864C0 VA: 0x6864C0
public short get__clubID() { }
 
Can anyone help me, I want to change the player's defending rating

C++:
// RVA: 0x6B8E30 Offset: 0x6B8E30 VA: 0x6B8E30
    public float get__defending() { }

But it doesn't work because there is player ID

C++:
// RVA: 0x6B8CB0 Offset: 0x6B8CB0 VA: 0x6B8CB0
    public short get__pID() { }

Can this be like unlinking? I know the player ID that I want to edit, but I don't know how and I can only follow the existing tutorial, I tried this unlink tutorial but there is no value Short

C++:
short (*get__pID)(void *instance);

float(*old_get__defending)(void *instance);
float get__defending(void *instance) {
    if(instance != NULL) {
short PlayerID = get__pID(instance);
if(PlayerID = 4254)
    }
return 99.0;
    }
    }
    return old_get__defending(instance);
}

MsHookFunction((void*)getAbsoluteAddress(targetLibName, 0x6B8E30), (void*)get__defending, (void**)&old_get__defending);
get__pID = (short (*)(void*))getAbsoluteAddress(targetLibName, 0x6B8CB0);

I've only been modding for a few weeks, and I'm just following tutorials
 
public void MissionSuccessComplete()

How to hook something like this

public void MissionSuccessComplete()


void *old_missionsucess(void *instance) {
void new_missionsucess(void *instance);
if (missiond) {

return ;

}

old_missionsucess;
}