Help! Hook void multi parameter & different type

please help master, how to offset the hook like in this picture!
 

Attachments

  • IMG_20241227_033139.jpg
    IMG_20241227_033139.jpg
    60.9 KB · Views: 75
C++:
bool (*old_CanAttack)(void* instance, bool check_block, const char** reason, void* sbase);
bool (*old_CanBeAttack)(void* instance, const char** reason, bool ignore_attack_failed);
bool (*old_IsEnemy)(void* instance, void* target);

// Hooked method for CanAttack
bool Hooked_CanAttack(void* instance, bool check_block, const char** reason, void* sbase) {
    // Add your logic here
    if (instance != nullptr) {
        // Log or modify behavior as needed
        return true; // Force always true, or customize
    }

    return old_CanAttack(instance, check_block, reason, sbase);
}

// Hooked method for CanBeAttack
bool Hooked_CanBeAttack(void* instance, const char** reason, bool ignore_attack_failed) {
    // Add your logic here
    if (instance != nullptr) {
        // Log or modify behavior as needed
        return true; // Force always true, or customize
    }

    return old_CanBeAttack(instance, reason, ignore_attack_failed);
}

// Hooked method for IsEnemy
bool Hooked_IsEnemy(void* instance, void* target) {
    // Add your logic here
    if (instance != nullptr) {
        // Log or modify behavior as needed
        return true; // Force always true, or customize
    }

    return old_IsEnemy(instance, target);
}
 
It doesn't have nothing to do with unlinking lol, if the 2 methods was witht he enemy then yes
 
Back
Top Bottom