Results 1 to 10 of 28

Thread: Pro tips for hooking up the function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Ok so the crash is in the BG_IsWeaponValid, which is (i guess ) related to weapons. You proably need to check them out. And this function is small so why not just revere it, going to be a piece of cake, here we go:

    PHP Code:
    cracking_hook_function(0x080E97F0, (int)hook_BG_IsWeaponValid);



    int hook_BG_IsWeaponValid(int a1int a2) {
        
        
    int v3;
        
    char v4;
        
        
    signed int (*sub_80E9758)(int a1);
        *(
    int *)&sub_80E9758 0x80E9758;
        
        
    int (*sub_80D9E84)(int a1signed int a2);
        *(
    int *)&sub_80D9E84 0x80D9E84;
        
        
    int (*sub_80E9270)(int a1);
        *(
    int *)&sub_80E9270 0x80E9270;

        
    v4 1;
        if ( !(
    unsigned int8_t)sub_80E9758(a2) )
            
    v4 0;
        if ( !(
    unsigned int8_t)sub_80D9E84(a1 1348a2) )
            
    v4 0;
        
    v3 sub_80E9270(a2);
        if ( !*(
    long *)(v3 132) && *(char *)(a1 1365) != a2 && *(char *)(a1 1366) != a2 && *(long *)(v3 876) != a2 )
            
    v4 0;
        
        
    // printf("Testcall\n");

        
    return (unsigned int8_t)v4;

    I have no idea why it segfaults though, and it's called from a SV_UserMove (possibly every player's frame). Try playing with this code, it could be that v3 e.g weapon + its somewhat parameter is broken or something.
    Last edited by voron00; 4th May 2016 at 12:01.
    sudo apt-get rekt

  2. The Following User Says Thank You to voron00 For This Useful Post:

    Whiskas (6th May 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •