Results 1 to 10 of 28

Thread: Pro tips for hooking up the function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    *(char**)foo casts foo to a char-pointer-pointer. char-pointers are basically arrays of characters, more commonly referred to as strings. So a char-pointer-pointer is a string-pointer. The * in front of it dereferences the pointer, so it dereferences a char** into a char*.

    The +0 is probably a leftover from trying different addresses near it.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following 3 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (5th May 2016),voron00 (5th May 2016),Whiskas (4th May 2016)

  3. #2
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Finally(?) got seg fault with your libcod's function:

    Code:
    [45709.850790] cod2_lnxded_1_0[1722]: segfault at 0 ip b7725b42 sp bf9a7330 error 4 in libcod2_1_0_hookLessSpam.so[b7711000+20000]
    [45711.750596] UDP: bad checksum. From 197.1.146.216:28960 to 89.36.219.214:28960 ulen 45
    [45715.700044] UDP: bad checksum. From 197.1.146.216:28960 to 89.36.219.214:28960 ulen 54
    [45735.651877] UDP: bad checksum. From 197.1.146.216:28960 to 89.36.219.214:28960 ulen 77
    [45739.513702] UDP: bad checksum. From 197.1.146.216:28960 to 89.36.219.214:28960 ulen 122
    And the screen's log:

    Code:
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: enfield_scope_mp
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: kar98k_mp
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: none
    hook_BG_IsWeaponValid -- Last weapon used: kar98k_sniper_mp
    hook_BG_IsWeaponValid -- Last weapon used: webley_mp
    Segmentation fault (core dumped)
    ==854== 
    ==854== HEAP SUMMARY:
    ==854==     in use at exit: 532 bytes in 27 blocks
    ==854==   total heap usage: 33 allocs, 6 frees, 1,137 bytes allocated
    ==854== 
    ==854== 16 bytes in 1 blocks are still reachable in loss record 1 of 5
    ==854==    at 0x482A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x1140CA: ??? (in /bin/dash)
    ==854==    by 0x11B2FD: ??? (in /bin/dash)
    ==854==    by 0x11BD98: ??? (in /bin/dash)
    ==854==    by 0x10AD6F: main (in /bin/dash)
    ==854== 
    ==854== 16 bytes in 1 blocks are still reachable in loss record 2 of 5
    ==854==    at 0x482A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x48BC9C7: strdup (strdup.c:42)
    ==854==    by 0x11414A: ??? (in /bin/dash)
    ==854==    by 0x10C179: ??? (in /bin/dash)
    ==854==    by 0x11BDC3: ??? (in /bin/dash)
    ==854==    by 0x10AD6F: main (in /bin/dash)
    ==854== 
    ==854== 20 bytes in 1 blocks are still reachable in loss record 3 of 5
    ==854==    at 0x482A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x1140CA: ??? (in /bin/dash)
    ==854==    by 0x11B3E6: ??? (in /bin/dash)
    ==854==    by 0x10C1C0: ??? (in /bin/dash)
    ==854==    by 0x11BDC3: ??? (in /bin/dash)
    ==854==    by 0x10AD6F: main (in /bin/dash)
    ==854== 
    ==854== 112 bytes in 1 blocks are still reachable in loss record 4 of 5
    ==854==    at 0x482A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x482C3AF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x114112: ??? (in /bin/dash)
    ==854==    by 0x1135D9: ??? (in /bin/dash)
    ==854==    by 0x10DCD0: ??? (in /bin/dash)
    ==854==    by 0x10CA06: ??? (in /bin/dash)
    ==854==    by 0x113E37: ??? (in /bin/dash)
    ==854==    by 0x10ADEF: main (in /bin/dash)
    ==854== 
    ==854== 368 bytes in 23 blocks are still reachable in loss record 5 of 5
    ==854==    at 0x482A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==854==    by 0x1140CA: ??? (in /bin/dash)
    ==854==    by 0x11B2FD: ??? (in /bin/dash)
    ==854==    by 0x11BD53: ??? (in /bin/dash)
    ==854==    by 0x10AD6F: main (in /bin/dash)
    ==854== 
    ==854== LEAK SUMMARY:
    ==854==    definitely lost: 0 bytes in 0 blocks
    ==854==    indirectly lost: 0 bytes in 0 blocks
    ==854==      possibly lost: 0 bytes in 0 blocks
    ==854==    still reachable: 532 bytes in 27 blocks
    ==854==         suppressed: 0 bytes in 0 blocks
    ==854== 
    ==854== For counts of detected and suppressed errors, rerun with: -v
    ==854== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    ==12416== Memcheck, a memory error detector
    ==12416== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
    ==12416== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
    ==12416== Command: ./start
    ==12416== 
    > [INFO] Compiled for: CoD2 1.0
    Compiled: May  4 2016 17:05:07 using GCC 4.8.4
    > [PLUGIN LOADED]
    CoD2 MP 1.0 build linux-i386 Oct 24 2005
    ----- FS_Startup -----
    Current search path:
    I don't really think that webley is causing the problem :|. And yes it was used before without segfault.

Posting Permissions

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