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

Solved [L4D2]Help update old gamedata for windows


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zomexf
Junior Member
Join Date: Jul 2019
Old 04-29-2020 , 14:52   [L4D2]Help update old gamedata for windows
Reply With Quote #1

Gamedata:
PHP Code:
"Games"
{
    
"left4dead2"
    
{
        
"Addresses"
        
{
            
"OnWindupFinished_Sig"
            
{
                
"linux"
                
{
                    
"signature"    "CTankClaw::OnWindupFinished"
                
}
                
"windows"
                
{
                    
"signature"    "CTankClaw::OnWindupFinished"            
                
}
            }
        }
        
"Signatures"
        
{
            
"CTankClaw::OnWindupFinished"
            
{
                
"library"   "server"
                "linux"     "@_ZN9CTankClaw16OnWindupFinishedEv"
                "windows"   "\x83\xec\x2a\x53\x56\x57\x8b\xf1\xe8\x2a\x2a\x2a\x2a\x8b\xf8\x33\xdb\x3b\xfb\x0f\x84\x2a\x2a\x2a\x2a\xf3\x0f"
            
}
        }
        
"Offsets"
        
{
            
"ClawTargetScan"
            
{
                
"linux"     "248"
                "windows"   "265"
            
}
            
"Platform"
            
{
                
"linux"     "0"
                "windows"   "1"
            
}
        }
    }

Plugin is here:
PHP Code:
#pragma semicolon 1

#include <sourcemod>

public Plugin:myinfo =
{
    
name "L4D2 Tank Claw Fix",
    
author "Jahze(patch data) & Visor(SM)",
    
description "Removes the Tank claw's undocumented auto-aiming ability",
    
version "0.1",
    
url ""
}

public 
OnPluginStart()
{
    new 
Handle:hGamedata LoadGameConfigFile("l4d2_notankautoaim");
    new 
Address:pAddress;

    if (!
hGamedata)
        
SetFailState("Gamedata 'l4d2_notankautoaim.txt' missing or corrupt");

    
pAddress GameConfGetAddress(hGamedata"OnWindupFinished_Sig");
    if (!
pAddress)
        
SetFailState("Couldn't find the 'OnWindupFinished_Sig' address");
        
    new 
bool:bIsWin = (GameConfGetOffset(hGamedata"Platform") == 1);
    new 
iOffset GameConfGetOffset(hGamedata"ClawTargetScan");
    
    new 
offsetCheck[2];
    new 
patchBytes[3];
    if (
bIsWin)
    {
        
offsetCheck = {0x830xEC};
        
patchBytes = {0xEB0x29, -1};
    }
    else
    {
        
offsetCheck = {0x0F0x84};
        
patchBytes = {0xE90x8B0x00};
    }
    
    if (
LoadFromAddress(pAddress Address:iOffsetNumberType_Int8) == offsetCheck[0]
    && 
LoadFromAddress(pAddress Address:(iOffset 1), NumberType_Int8) == offsetCheck[1])
    {
        for (new 
0sizeof(patchBytes); i++)
        {
            if (
patchBytes[i] < 0) {
                break;
            }

            
StoreToAddress(pAddress Address:(iOffset i), patchBytes[i], NumberType_Int8);
            
PrintToServer("Set %x@%i"patchBytes[i], i);
        }
    }
    
    
CloseHandle(hGamedata);

Sorry, My English is bad
I hope someone to fix Windows Address
If I make a mistake please delete

Last edited by zomexf; 09-28-2020 at 16:23. Reason: Work correctly
zomexf is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-29-2020 , 15:58   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #2

PHP Code:
#pragma semicolon 1

#include <sourcemod>

public Plugin:myinfo =
{
    
name "L4D2 Tank Claw Fix",
    
author "Jahze(patch data) & Visor(SM) & Silvers (sig update)",
    
description "Removes the Tank claw's undocumented auto-aiming ability",
    
version "0.2",
    
url ""
}

public 
OnPluginStart()
{
    new 
Handle:hGamedata LoadGameConfigFile("l4d2_notankautoaim");
    new 
Address:pAddress;

    if (!
hGamedata)
        
SetFailState("Gamedata 'l4d2_notankautoaim.txt' missing or corrupt");

    
pAddress GameConfGetAddress(hGamedata"OnWindupFinished_Sig");
    if (!
pAddress)
        
SetFailState("Couldn't find the 'OnWindupFinished_Sig' address");
        
    new 
bool:bIsWin = (GameConfGetOffset(hGamedata"Platform") == 1);
    new 
iOffset GameConfGetOffset(hGamedata"ClawTargetScan");
    
    new 
offsetCheck[2];
    new 
patchBytes[3];
    if (
bIsWin)
    {
        
offsetCheck = {0x790x29};
        
patchBytes = {0xEB0x29, -1};
    }
    else
    {
        
offsetCheck = {0x0F0x84};
        
patchBytes = {0xE90x8B0x00};
    }
    
    if (
LoadFromAddress(pAddress Address:iOffsetNumberType_Int8) == offsetCheck[0]
    && 
LoadFromAddress(pAddress Address:(iOffset 1), NumberType_Int8) == offsetCheck[1])
    {
        for (new 
0sizeof(patchBytes); i++)
        {
            if (
patchBytes[i] < 0) {
                break;
            }

            
StoreToAddress(pAddress Address:(iOffset i), patchBytes[i], NumberType_Int8);
            
PrintToServer("Set %x@%i"patchBytes[i], i);
        }
    }
    
    
CloseHandle(hGamedata);



Code:
"Games"
{
	"left4dead2"
	{
		"Addresses"
		{
			"OnWindupFinished_Sig"
			{
				"linux"
				{
					"signature"	"CTankClaw::OnWindupFinished"
				}
				"windows"
				{
					"signature"	"CTankClaw::OnWindupFinished"			
				}
			}
		}
		"Signatures"
		{
			"CTankClaw::OnWindupFinished"
			{
				"library"	"server"
				"linux"		"@_ZN9CTankClaw16OnWindupFinishedEv"
				"windows"	"\x55\x8B\x2A\x83\x2A\x2A\x53\x56\x57\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x33\x2A\x3B\x2A\x0F\x84\x2A\x2A\x2A\x2A\xD9"
				/* 55 8B ? 83 ? ? 53 56 57 8B ? E8 ? ? ? ? 8B ? 33 ? 3B ? 0F 84 ? ? ? ? D9 */
				/* Search: "tank_survivor_pound" - VTable entry below.
			}
		}
		"Offsets"
		{
			"ClawTargetScan"
			{
				"linux"		"248"
				"windows"	"265"
			}
			"Platform"
			{
				"linux"		"0"
				"windows"	"1"
			}
		}
	}
}

Should hopefully work, untested.
__________________

Last edited by Silvers; 04-29-2020 at 15:58.
Silvers is offline
zomexf
Junior Member
Join Date: Jul 2019
Old 04-30-2020 , 07:02   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #3

Hello Silvers, I received the following logs unable to work
[SM] Plugin encountered error 25: Call was aborted
[SM] Native "SetFailState" reported: Couldn't find the 'OnWindupFinished_Sig' address
[SM] Displaying call stack trace for plugin "l4d2_notankautoaim.smx":
[SM] [0] Line 24, G:\scripting\l4d2_notankautoaim.sp::OnPluginS tart()
zomexf is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 04-30-2020 , 09:34   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #4

The whole offset checking and offsets need updating too, from looking at looks like they are forcing the eyeangle check for the tank.

Can just force jump on win i think there is no docs on what it's doing so can only guess from looking at the asm.
Code:
74 20                                         jz      short loc_1034CCCE
to
EB 20                                         jz      short loc_1034CCCE
Linux is different not quite sure whats happening there since offsets maybe outdated.


Here is sig for windows and updated offset for what i think should be correct the plugin byte checking and patching needs to be changed in opinion for windows.
Code:
"Games"
{
	"left4dead2"
	{
		"Addresses"
		{
			"OnWindupFinished_Sig"
			{
				"linux"
				{
					"signature"	"CTankClaw::OnWindupFinished"
				}
				"windows"
				{
					"signature"	"CTankClaw::OnWindupFinished"			
				}
			}
		}
		"Signatures"
		{
			"CTankClaw::OnWindupFinished"
			{
				"library"	"server"
				"linux"		"@_ZN9CTankClaw16OnWindupFinishedEv"
				"windows"	"\x83\xEC\x68\x53\x56\x57\x8B\xF1"
				/* 83 EC 68 53 56 57 8B F1 */
			}
		}
		"Offsets"
		{
			"ClawTargetScan"
			{
				"linux"		"248" // not sure what is happening here
				"windows"	"188" // 0x74 -> 0xEB Force jump to eyeangle check
			}
			"Platform"
			{
				"linux"		"0"
				"windows"	"1"
			}
		}
	}
}
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 04-30-2020 at 09:35.
Lux is offline
zomexf
Junior Member
Join Date: Jul 2019
Old 05-01-2020 , 14:17   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #5

[SM] Native "LoadFromAddress" reported: Invalid address 0xbc is pointing to reserved memory.
can help plugin to be changed in support for windows ? I don't know how to do.

Last edited by zomexf; 05-07-2020 at 14:59.
zomexf is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 09-25-2020 , 14:04   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #6

Code:
"Games"
{
	"left4dead2"
	{
		"Addresses"
		{
			"OnWindupFinished_Sig"
			{
				"linux"
				{
					"signature"	"CTankClaw::OnWindupFinished"
				}
				"windows"
				{
					"signature"	"CTankClaw::OnWindupFinished"			
				}
			}
		}
		"Signatures"
		{
			"CTankClaw::OnWindupFinished"
			{
				"library"	"server"
				"linux"		"@_ZN9CTankClaw16OnWindupFinishedEv"
				"windows"	"\x55\x8B\x2A\x83\x2A\x2A\x53\x56\x57\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x33\x2A\x3B\x2A\x0F\x84\x2A\x2A\x2A\x2A\xD9"
				/* 55 8B ? 83 ? ? 53 56 57 8B ? E8 ? ? ? ? 8B ? 33 ? 3B ? 0F 84 ? ? ? ? D9 */
			}
		}
		"Offsets"
		{
			"ClawTargetScan"
			{
				"linux"		"248" // not sure what is happening here
				"windows"	"265" // 0x74 -> 0xEB Force jump to eyeangle check
			}
			"Platform"
			{
				"linux"		"0"
				"windows"	"1"
			}
		}
	}
}

New signature and patch offset, untested but should be working.
__________________
Silvers is offline
XDglory
Member
Join Date: May 2012
Old 09-26-2020 , 00:30   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #7

Thank you Silver, would test if got time!
XDglory is offline
zomexf
Junior Member
Join Date: Jul 2019
Old 09-28-2020 , 16:33   Re: [L4D2]Help update old gamedata for windows
Reply With Quote #8

Thank you Silver.
New gamedata,work correctly.
__________________
Sorry, My English is bad
zomexf 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 07:26.


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