Raised This Month: $32 Target: $400
 8% 

Solved [L4D2] Tank hits multi players with one punch in Coop?


Post New Thread Reply   
 
Thread Tools Display Modes
Forgetest
Member
Join Date: Aug 2020
Old 04-23-2021 , 12:49   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #11

https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
Forgetest is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 04-23-2021 , 13:03   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #12

Quote:
Originally Posted by Forgetest View Post
https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
I tested windows l4d2 server, and it works!! Thanks, everyone
Hope somebody will test l4d2 linux.
__________________

Last edited by HarryPotter; 04-23-2021 at 13:05.
HarryPotter is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-23-2021 , 14:15   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #13

Quote:
Originally Posted by Forgetest View Post
https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
I didn't get to test this but I did notice that your Tank check only looks for zombie class 8 so the patch will never work in L4D1.

L4D1 only has zombie classes 1 to 5. (Smoker, Boomer, Hunter, Witch?, Tank)
__________________
Psyk0tik is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 04-23-2021 , 14:44   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #14

Quote:
Originally Posted by Forgetest View Post
https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
Working on L4D2 Linux server, great job...
MasterMind420 is offline
Forgetest
Member
Join Date: Aug 2020
Old 04-24-2021 , 01:03   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #15

Quote:
Originally Posted by Crasher_3637 View Post
I didn't get to test this but I did notice that your Tank check only looks for zombie class 8 so the patch will never work in L4D1.

L4D1 only has zombie classes 1 to 5. (Smoker, Boomer, Hunter, Witch?, Tank)
Yes, was careless to forget this, and also to disable the functionality of detours when non-coop mode.
Pushed a fix just now, should be fine.

Edit: Update v1.1 -> Fixed IsTank check for L4D1 and some optimization [2021/4/24 1PM UTC+8]
Update v1.2 -> Fixed server starting on Survival Mode. [2021/4/24 4PM UTC+8]
Update v1.3 -> Redirected the way message gets printed, no longer spamming in console.

Last edited by Forgetest; 04-24-2021 at 09:22. Reason: Some changelog
Forgetest is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-26-2021 , 16:57   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #16

Quote:
Originally Posted by Crasher_3637 View Post
MT has its own simple patching system that I implemented before finding out about SourceScramble.
Those looks quite convenient. Nice work
Also, thanks for detours description )) Will be useful for me at some point.

Harry, nice idea! Love it.

Forgetest, thanks for your work. L4D1 is tested and not functioning. It has completely different prototypes with arguments based on custom registers. Also, L4D1 Linux doesn't call those sig. It uses a [clone] function overload which, BTW, IDA provides an incorrect signature for. So, if somebody happened the same, here are I parsed full list of the correct NIX sigs for L4D1/2.

I updated the gamedata and code for L4D1 Nix.
As for Windows, I didn't completely find out which CC is correct. DHook failed. I leave it closest to the correct as I think. Its prototype:
Code:
/* WIN: __userpurge CTankClaw::SweepFist@<eax>(_BYTE *a1@<ecx>, CTerrorWeapon a2@<edi>, int a3, int a4, float *a5) */
/* NIX: __usercall CTankClaw::SweepFist(CTerrorWeapon *a1@<eax>, float *a2@<edx>, float *a3) [clone] */
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 04-29-2021 at 07:24.
Dragokas is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-27-2021 , 06:14   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #17

Quote:
Originally Posted by Dragokas View Post
Those looks quite convenient. Nice work :)
Also, thanks for detours description )) Will be useful for me at some point.
No problem! :)

Quote:
Originally Posted by Dragokas View Post
Forgetest, thanks for your work. L4D1 is tested and not functioning. It has completely different prototypes with arguments based on custom registers. Also, L4D1 Linux doesn't call those sig. It uses a [clone] function overload which, BTW, IDA provides an incorrect signature for. So, if somebody happened the same, here are I parsed full list of the correct NIX sigs for L4D1/2.

I updated the gamedata and code for L4D1 Nix.
As for Windows, I didn't completely find out which CC is correct. DHook failed. I leave it closest to the correct as I think. Its prototype:
Code:
/* WIN: __userpurge CTankClaw::SweepFist@<eax>(_BYTE *a1@<ecx>, CTerrorWeapon a2@<edi>, int a3, int a4, float *a5) */
/* NIX: __usercall CTankClaw::SweepFist(CTerrorWeapon *a1@<eax>, float *a2@<edx>, float *a3) [clone] */
I tested your version on my Windows server for L4D1 and it kept crashing each time a Tank hits a survivor, with the following error*:
Code:
L 04/27/2021 - 02:53:56: [DHOOKS] FATAL: Failed to find return address of original function. Check the arguments and return type of your detour setup.
* I did not have any other plugins detouring or calling this function while testing.

The original detour setup I provided for L4D1 Windows worked fine. As for L4D1 Linux, I don't think the extra params and specification of registers are necessary. I usually rely on the function prototypes shown in the function list.
Code:
CTankClaw::SweepFist(Vector const&,Vector const&)
CTankClaw::SweepFist(Vector const&,Vector const&) [clone]
As an extra step to confirming the right params and other information for setting up detours, I also compare IDA's decompiled view to Ghidra's decompiled view. Here's what Ghidra shows me for this function:
PHP Code:
/* CTankClaw::SweepFist(Vector const&, Vector const&) */

void __thiscall SweepFist(CTankClaw *this,Vector *param_1,Vector *param_2
PHP Code:
/* CTankClaw::SweepFist(Vector const&, Vector const&) [clone .constprop.248] */

void __thiscall SweepFist(CTankClaw *this,Vector *param_1,Vector *param_2
Ghidra shows that both functions are indeed "thiscall's" with "this" being the Tank claw and they only have two parameters in their prototypes. In your version, you set up the detour for Windows by ignoring "this" and using param2 to access the Tank's claw while setting up a total of 5 parameters, which doesn't make sense.

--

I advise against trusting the function prototype shown in IDA's decompiled view since IDA can get confused often when decompiling Windows binaries. It's also best to compare the function prototype to the Linux symbol as this helps to get an accurate idea of what the real parameters of a function are.

For this function, we can see in the Linux symbol that the function only has 2 vectors as parameters:
Code:
_ZN9CTankClaw9SweepFistERK6VectorS2_.constprop.248
--

The only part I really agree with is the Linux signature that I provided is wrong. As you said, Linux calls the overloaded (clone) function.

I'm not sure how you arrived at your conclusions, but maybe you know other things that I don't know yet or haven't considered in this situation. Feel free to explain to me if I am wrong at any point in this post. I am always willing to improve my knowledge with an open mind.

Note: I use IDA v7.5 so I am not sure if we see the same exact information since I believe v7.0/Free version decompiles functions slightly differently.
__________________

Last edited by Psyk0tik; 04-27-2021 at 06:38.
Psyk0tik is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-28-2021 , 14:18   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #18

Hi Crasher, looks like I failed when I test it on Win platform. Your version works OK.
As about Linux version, it doesn't work without explicit indication of registers.
I also crashes if I use original gamedata - "thiscall" with "this" as entity.

I'm also using IDA 75.

Can I ask you to send me a complete GhidraDec plugin for it?
Looks like I missing some important files, like decompile.exe, and I cannot compile from source. Some errors during compilation related to undeclared identifiers.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-28-2021 , 23:44   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #19

Quote:
Originally Posted by Dragokas View Post
Hi Crasher, looks like I failed when I test it on Win platform. Your version works OK.
As about Linux version, it doesn't work without explicit indication of registers.
I also crashes if I use original gamedata - "thiscall" with "this" as entity.

I'm also using IDA 75.
Since I do not have a testing environment for Linux and therefore cannot test for myself, I will take your word for it.

Quote:
Originally Posted by Dragokas View Post
Can I ask you to send me a complete GhidraDec plugin for it?
Looks like I missing some important files, like decompile.exe, and I cannot compile from source. Some errors during compilation related to undeclared identifiers.
When I mentioned Ghidra, I was referring to the program developed by the National Security Agency. I do not use any plugins for IDA Pro at this moment.

https://ghidra-sre.org/
__________________
Psyk0tik is offline
yzybb
Member
Join Date: Jul 2020
Old 05-02-2021 , 05:27   Re: [L4D2] Tank hits multi players with one punch in Coop?
Reply With Quote #20

Quote:
Originally Posted by Forgetest View Post
https://github.com/Target5150/MoYu_S...eep_fist_patch

Plugin packaging done. But didn't test on entire L4D1 and Linux L4D2.
L 05/02/2021 - 17:02:43: SourceMod error session started
L 05/02/2021 - 17:02:43: Info (map "tgxl") (file "E:\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_202 10502.log")
L 05/02/2021 - 17:02:43: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:02:43: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:02:43: [SM] Call stack trace:
L 05/02/2021 - 17:02:43: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:02:43: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:02:43: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:02:43: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:04:09: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:04:09: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:04:09: [SM] Call stack trace:
L 05/02/2021 - 17:04:09: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:04:09: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:04:09: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:04:09: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:04:11: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:04:11: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:04:11: [SM] Call stack trace:
L 05/02/2021 - 17:04:11: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:04:11: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:04:11: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:04:11: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:06:14: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:06:14: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:06:14: [SM] Call stack trace:
L 05/02/2021 - 17:06:14: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:06:14: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:06:14: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:06:14: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:06:17: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:06:17: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:06:17: [SM] Call stack trace:
L 05/02/2021 - 17:06:17: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:06:17: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:06:17: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:06:17: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:14:09: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:14:09: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:14:09: [SM] Call stack trace:
L 05/02/2021 - 17:14:09: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:14:09: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:14:09: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:14:09: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:14:12: [SM] Exception reported: Cannot create new entity when no map is running
L 05/02/2021 - 17:14:12: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/02/2021 - 17:14:12: [SM] Call stack trace:
L 05/02/2021 - 17:14:12: [SM] [0] CreateEntityByName
L 05/02/2021 - 17:14:12: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/02/2021 - 17:14:12: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/02/2021 - 17:14:12: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/02/2021 - 17:23:13: Error log file session closed.

In this map of “终极特感训练”, I want to call the tank to test it. The result is wrong. This is the wrong message.

L 05/03/2021 - 182:29: SourceMod error session started
L 05/03/2021 - 182:29: Info (map "tumtara") (file "E:\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_202 10503.log")
L 05/03/2021 - 182:29: [SM] Exception reported: Cannot create new entity when no map is running
L 05/03/2021 - 182:29: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/03/2021 - 182:29: [SM] Call stack trace:
L 05/03/2021 - 182:29: [SM] [0] CreateEntityByName
L 05/03/2021 - 182:29: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/03/2021 - 182:29: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/03/2021 - 182:29: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/03/2021 - 184:21: [SM] Exception reported: Cannot create new entity when no map is running
L 05/03/2021 - 184:21: [SM] Blaming: l4d_sweep_fist_patch.smx
L 05/03/2021 - 184:21: [SM] Call stack trace:
L 05/03/2021 - 184:21: [SM] [0] CreateEntityByName
L 05/03/2021 - 184:21: [SM] [1] Line 172, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::IsAllowedGamemode
L 05/03/2021 - 184:21: [SM] [2] Line 111, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnConfigsExecuted
L 05/03/2021 - 184:21: [SM] [3] Line 119, J:\Documents\GitHub\MoYu_Server_Stupid_Plugin s\The Last Stand\l4d_sweep_fist_patch\l4d_sweep_fist_pat ch.sp::OnGameModeChanged
L 05/03/2021 - 184:25: Error log file session closed.


But any map that can generate tank with buttons will make mistakes. Who can fix this mistake?

@Forgetest @Crasher_3637 @HarryPotter

Last edited by yzybb; 05-03-2021 at 07:10.
yzybb is offline
Reply


Thread Tools
Display Modes

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 14:19.


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