Jump to content

Modern Combat 5 Auto Knife Source


42 posts in this topic

Recommended Posts

Posted

its patched online, therefore useless.

 

When you can't find the offset that does the trick, use the game's functions to your advantage.

 

My problem was that I was able to find an offset that makes you knife automatically, without touching the screen, but I didn't want a hack that constantly makes you knife, that's useless, so I went to try and find the offset that checked if you were in range and tapping the knife icon. I couldn't, so I went to find the big knife function. I just backtraced a ton. Figured that everything would be getting called from some huge function and I was right. Anyway:

 

Hidden Content

    #include <substrate.h>
    
    //this function is all about showing the knife button, checking knife range, deciding what type of animation to use, etc
    //I printed arg0 and its return value to syslog and saw that arg0 is always 1
    //but the return value is like 4 million whenever you get in range of a knife attack and 0 when you
    //aren't in range
    int (*isKnifeAvailableOld)(void *self, int arg0);
    
    int isKnifeAvailable(void *self, int arg0){
    //here I test to see if I'm in range of a knife attack
    if(isKnifeAvailableOld(self, arg0)>0){
    write(0x1b1cd4,0x0120c046); //this offset will make an if statement before the knife offset false so it never branches therefore letting the auto knife offset take effect
    write(0x1b1cdc,0x0422c046); //auto knife activate, I can also control knifing animations with this which is hella cool, MOV R2, #4 = snap neck
    }
    else{
    //write back original hex when you aren't in range of a knife attack
    write(0x1b1cd4,0x9ef14af8); 
    write(0x1b1cdc,0xd4f8a423);
    }
    
    return isKnifeAvailableOld(self, arg0);
    }
    
    %ctor{
    MSHookFunction((void*)(_dyld_get_image_vmaddr_slide(0) + 0x1b3d98 + 1),(void*)isKnifeAvailable,(void**)&isKnifeAvailableOld);
    }
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines