Help! I need help with the distinction between friend and foe.

Super丶Xuan

Solid & Active Platinian
Original poster
Feb 13, 2020
82
21
8
26
How do I mount this method function to differentiate between the enemy and myself, I hope someone can help me, preferably by writing an example image for me to look at, thanks! My English is not very good, I'm sorry!
 

Attachments

libModz

Awesome Active Platinian
Jun 2, 2022
167
29
28
UK
Looks like it uses enum which is the same as int to determine the team color.

I could be wrong but I'd hook it like this...

C++:
int (*General_get_Team)(void *instance);
Then use it in in a hook like so...

C++:
void (*old_Update)(void *instance);
void Update(void *instance) {
    if(instance!=NULL) {
        int Team = General_get_Team(instance);
        if(Team=1) { // Type whatever team color number here, I use 1 as an example. Look in TeamType for this.
            // Some code that you want to do here
        }
    }
    old_Update(instance);
}

Then this under hack thread...

C++:
General_get_Team = (int(*)(void*)) getAbsoluteAddress(targetLibName, 0xA70C54);
 

libModz

Awesome Active Platinian
Jun 2, 2022
167
29
28
UK
There's a method in that class called "IsEmemy" which is probably a bool with an int parameter to check the team color. It might be better to use that instead of "get_Team"
 

Super丶Xuan

Solid & Active Platinian
Original poster
Feb 13, 2020
82
21
8
26
There's a method in that class called "IsEmemy" which is probably a bool with an int parameter to check the team color. It might be better to use that instead of "get_Team"
Thank you so much for taking the time to answer my question, I will go ahead and try to hook it up.
I have another question for you, how do I write the hook about this "Fixed" type method? I don't know what type it is!Maybe “Double”?
 

Attachments