Raised This Month: $51 Target: $400
 12% 

CollisionHook


Post New Thread Reply   
 
Thread Tools Display Modes
GuStAvOS
Member
Join Date: Mar 2018
Old 04-26-2018 , 13:24   Re: CollisionHook
Reply With Quote #71

hello again :v
someone could help me compile the
CollisionHook.ext.so for the SourceMod v1.7.3-dev + 5290
on l4d2 ... thanks in advance
GuStAvOS is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-26-2018 , 22:15   Re: CollisionHook
Reply With Quote #72

What error do you get? The extension should work on L4D2, unless you get the symbol error.
__________________
Spirit_12 is offline
GuStAvOS
Member
Join Date: Mar 2018
Old 04-27-2018 , 08:42   Re: CollisionHook
Reply With Quote #73

I see this error ...

<FAILED> file "collisionhook.ext.so": /home/gustavo/serverfiles/left4dead2/addons/sourcemod/extensions/collisionhook.ext.so: undefined symbol: g_pMemAlloc


[SM] Unable to load plugin "l4d2_collision_adjustments.smx": Required extension "CollisionHook" file("collisionhook.ext") not running

help me please
GuStAvOS is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-27-2018 , 09:38   Re: CollisionHook
Reply With Quote #74

Haven’t used this in a while, but try the one from my repo.

https://github.com/Satanic-Spirit/Co....ext.2.l4d2.so
__________________
Spirit_12 is offline
Morell
AlliedModders Donor
Join Date: Jun 2010
Location: World
Old 05-15-2018 , 16:06   Re: CollisionHook
Reply With Quote #75

We need a gamedata update.
__________________
Morell is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-18-2018 , 03:06   Re: CollisionHook
Reply With Quote #76

I did a bit of investigation on why this doesn't work on CS:GO windows, the gamedata itself is fine but the entity pointer values passed into the detour seem to be messed up.
I noticed that the function is actually a fastcall so the entity pointers are passed in through the ecx/edx registers, I'm guessing thats why the detour "fails".

EDIT: I tested this and that seems to have been the issue. After changing the detour function into a fastcall it all works fine.

Source for the fix: https://github.com/SlidyBat/CollisionHook
Windows binary also attached
Attached Files
File Type: dll collisionhook.ext.2.csgo.dll (534.0 KB, 463 views)
File Type: txt collisionhook.txt (549 Bytes, 490 views)

Last edited by hmmmmm; 05-18-2018 at 03:43.
hmmmmm is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-18-2018 , 14:29   Re: CollisionHook
Reply With Quote #77

Hmm, interesting! Is the function static on Linux and fastcall on windows? If that's true, then I wonder, if that's the same reason why the extension stopped working on l4d2.
__________________
Spirit_12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-18-2018 , 20:03   Re: CollisionHook
Reply With Quote #78

Yeah it seems like only windows is troublesome with these optimisations, not sure why. Easiest way to check if it's a different calling convention in L4D2 is to crack open the binary in IDA and find the function to see how it works, very likely that it's the same reason (or the gamedata actually changed).
hmmmmm is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-18-2018 , 22:07   Re: CollisionHook
Reply With Quote #79

Quote:
Originally Posted by hmmmmm View Post
Yeah it seems like only windows is troublesome with these optimisations, not sure why. Easiest way to check if it's a different calling convention in L4D2 is to crack open the binary in IDA and find the function to see how it works, very likely that it's the same reason (or the gamedata actually changed).
Tried both of them and couldn't figure out the reason. Mind you, the game data is accurate and the extensions works like a charm on Linux. Just Windows is crashing. This is the function from disassembly.

PHP Code:
.text:10208280
.text:10208280 ; =============== S U B R O U T I N E =======================================
.
text:10208280
.text:10208280 Attributesbp-based frame
.text:10208280
.text:10208280 sub_10208280    proc near               CODE XREFsub_1003CC70+28p
.text:10208280                                         sub_1019D5A0+28p ...
.
text:10208280
.text:10208280 arg_0           dword ptr  8
.text:10208280 arg_4           dword ptr  0Ch
.text:10208280
.text:10208280                 push    ebp
.text:10208281                 mov     ebpesp
.text:10208283                 push    edi
.text:10208284                 mov     edi, [ebp+arg_4]
.
text:10208287                 test    ediedi
.text:10208289                 jnz     short loc_10208290
.text:1020828B                 mov     al1
.text:1020828D                 pop     edi
.text:1020828E                 pop     ebp
.text:1020828F                 retn
.text:10208290 ; ---------------------------------------------------------------------------
.
text:10208290
.text:10208290 loc_10208290:                           ; CODE XREFsub_10208280+9j
.text:10208290                 push    esi
.text:10208291                 mov     esi, [ebp+arg_0]
.
text:10208294                 cmp     esiedi
.text:10208296                 jnz     short loc_1020829E
.text:10208298                 pop     esi
.text:10208299                 xor     alal
.text:1020829B                 pop     edi
.text:1020829C                 pop     ebp
.text:1020829D                 retn
.text:1020829E ; ---------------------------------------------------------------------------
.
text:1020829E
.text:1020829E loc_1020829E:                           ; CODE XREFsub_10208280+16j
.text:1020829E                 mov     ecxdword_107D1C00
.text:102082A4                 mov     eax, [ecx]
.
text:102082A6                 mov     edx, [eax+0Ch]
.
text:102082A9                 push    ebx
.text:102082AA                 push    esi
.text:102082AB                 call    edx
.text:102082AD                 test    alal
.text:102082AF                 jz      short loc_102082B5
.text:102082B1                 xor     ebxebx
.text:102082B3                 jmp     short loc_102082C0
.text:102082B5 ; ---------------------------------------------------------------------------
.
text:102082B5
.text:102082B5 loc_102082B5:                           ; CODE XREFsub_10208280+2Fj
.text:102082B5                 mov     eax, [esi]
.
text:102082B7                 mov     edx, [eax+14h]
.
text:102082BA                 mov     ecxesi
.text:102082BC                 call    edx
.text:102082BE                 mov     ebxeax
.text:102082C0
.text:102082C0 loc_102082C0:                           ; CODE XREFsub_10208280+33j
.text:102082C0                 mov     ecxdword_107D1C00
.text:102082C6                 mov     eax, [ecx]
.
text:102082C8                 mov     edx, [eax+0Ch]
.
text:102082CB                 push    edi
.text:102082CC                 call    edx
.text:102082CE                 test    alal
.text:102082D0                 jz      short loc_102082D6
.text:102082D2                 xor     esiesi
.text:102082D4                 jmp     short loc_102082E1
.text:102082D6 ; ---------------------------------------------------------------------------
.
text:102082D6
.text:102082D6 loc_102082D6:                           ; CODE XREFsub_10208280+50j
.text:102082D6                 mov     eax, [edi]
.
text:102082D8                 mov     edx, [eax+14h]
.
text:102082DB                 mov     ecxedi
.text:102082DD                 call    edx
.text:102082DF                 mov     esieax
.text:102082E1
.text:102082E1 loc_102082E1:                           ; CODE XREFsub_10208280+54j
.text:102082E1                 test    ebxebx
.text:102082E3                 jz      short loc_1020830C
.text:102082E5                 test    esiesi
.text:102082E7                 jz      short loc_1020830C
.text:102082E9                 mov     ecxebx
.text:102082EB                 call    sub_1003BCE0
.text:102082F0                 cmp     eaxesi
.text:102082F2                 jnz     short loc_102082FB
.text:102082F4                 pop     ebx
.text:102082F5                 pop     esi
.text:102082F6                 xor     alal
.text:102082F8                 pop     edi
.text:102082F9                 pop     ebp
.text:102082FA                 retn
.text:102082FB ; ---------------------------------------------------------------------------
.
text:102082FB
.text:102082FB loc_102082FB:                           ; CODE XREFsub_10208280+72j
.text:102082FB                 mov     ecxesi
.text:102082FD                 call    sub_1003BCE0
.text:10208302                 cmp     eaxebx
.text:10208304                 pop     ebx
.text:10208305                 pop     esi
.text:10208306                 setnz   al
.text:10208309                 pop     edi
.text:1020830A                 pop     ebp
.text:1020830B                 retn
.text:1020830C ; ---------------------------------------------------------------------------
.
text:1020830C
.text:1020830C loc_1020830C:                           ; CODE XREFsub_10208280+63j
.text:1020830C                                         sub_10208280+67j
.text:1020830C                 pop     ebx
.text:1020830D                 pop     esi
.text:1020830E                 mov     al1
.text:10208310                 pop     edi
.text:10208311                 pop     ebp
.text:10208312                 retn
.text:10208312 sub_10208280    endp
.text:10208312 
__________________
Spirit_12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-18-2018 , 22:32   Re: CollisionHook
Reply With Quote #80

I don't have the game or the binary myself, but you'll have to attach a debugger to see where its failing. The function assembly looks normal to me, no weird calling convention or anything.
hmmmmm is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode