// This class have Update method and CharacterData field
public class CharacterManager
{
private CharacterData characterData; // 0x68
// update method
// RVA: 0x273C3CC Offset: 0x273B3CC VA: 0x273C3CC
private void Update() { }
}
// This class doesn't have Update method, but this class used in CharacterManager
public class CharacterData
{
private int characterHealth; // 0x60
}
void (*orig_CharacterUpdate)(void *_this);
void CharacterUpdate(void *_this) {
if (_this != NULL) {
// so we can get the CharacterData class from CharacterManager
// 0x273B3CC is the offset of Update method from CharacterManager
// 0x68 is the offset of CharacterData class from CharacterManager
// 0x60 is the offset of Health from CharacterData class
// so 0x273B3CC + 0x68 + 0x60 = characterHealth
*(int *) ((uint64_t) _this + 0x68 + 0x60) = 9999999; // you can set the health value here
}
}
DobbyHook((void *) getAbsoluteAddress("libil2cpp.so",0x273B3CC), (void *) &CharacterUpdate, (void **) &orig_CharacterUpdate);