Help! how to mod small field ? 0x8, 0xc

You need to use hook function.

C++:
//No need
struct My_Patches {
    MemoryPatch blah, blah, blah;
} hexPatches;


//Do this:

bool Example = false;

void (*old_AnyName)(void *instance);
void AnyName(void* instance) {
    if (instance != NULL) {
        if (Example) {
            *(int/*Example if the Offset is BOOL, FLOAT, INT, VOID, DOUBLE. Then replace the int.*/ *) ((uint64_t/*Change the 64 if you're going to use 32.*/) instance + 0xABCD/*The Field Offset here*/) = 1234567890/*Change this to TRUE, FALSE, VALUE/NUMBER. If you Offset has a ability of something else.*/;
        }
    }
    return/*Remove this return, if you're going to use something else. But i prefer for you to keep this.*/ old_AnyName(instance);
}



#if defined(__aarch64__) //If you want to do Armv8 Hook Function then:

    A64HookFunction((void *)getAbsoluteAddress(targetLibName/* <-- Just replace something else if #define targetLibName OBFUSCATE("TargetLibNameHere") is not working.*/, 0x123456/* <-- The Normal Offset Here.*/), (void *)AnyName, (void **)&old_AnyName);

#else //If you are going to do Armv7 Hook Function then:

    MSHookFunction((void*)getAbsoluteAddress(targetLibName/*Same as above*/, 0x123456/*Same as above's explanation*/), (void*)AnyName, (void**)&old_AnyName);



switch (featNum) {
    case 0:
        Example = boolean;
        break;
}
 
Back
Top Bottom