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

Need Help Finding a Windows Signature


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zethax
Member
Join Date: Sep 2015
Location: In my couch
Old 01-07-2022 , 18:12   Need Help Finding a Windows Signature
Reply With Quote #1

I'm new to sigscanning, and I've been trying to find the Windows signature for the TF2 function CanUpgradeWithAttrib(). I've found the signatures for Linux and Mac, but the Windows signature is incredibly hard to get. There are seemingly no discernable patterns between the Linux and Windows versions, not to mention the function seems to have no strings for me to latch on to.

I'm aware of the whole "just use Linux" argument, but unfortunately I'm unable to get my TF2 server working on a Linux VM.

Was just wondering if anybody could give me some pointers, or some tips, on finding harder to get function signatures. Thanks!
__________________
I code, I guess.
Zethax is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 01-07-2022 , 19:08   Re: Need Help Finding a Windows Signature
Reply With Quote #2

Using IDA Free, a quick scan of the function indicates that it calls CTFFlameThrower::CanAirBlastPushPlayer. You'll also want to make a note on what the graph looks like.

CTFFlameThrower::CanAirBlastPushPlayer uses a unique string "airblast_pushback_disabled" on Linux. (You can use the X key to find references to it.) Switch to the Windows binary, open up the string subview (SHIFT + F12), then find that string. You'll find that it can be in one of two functions; one of them leads to a function with multiple airblast-related attribute classes (none of which were in the function you're looking for), so navigate to the other function. Find what functions reference this one. There's only one, and in graph view you can see that it's a large graph. That's probably the function you're looking for (not going to check for myself); makesig it and you're done.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 01-08-2022 at 00:27.
nosoop is offline
Zethax
Member
Join Date: Sep 2015
Location: In my couch
Old 01-07-2022 , 23:46   Re: Need Help Finding a Windows Signature
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
*snip*
Thank you SO much! I believe this is the one.

Now I've run into another problem though. I'm using a Dynamic Detour to hook onto CanUpgradeWithAttrib(), and all I'm doing right now is trying to print out the attribute and target slot in the chat. However, anytime I purchase an upgrade, my server crashes, stating I should check my detour setup.

This is my current detour setup:
Code:
	g_hDetourCanUpgradeWithAttrib = new DynamicDetour(Address_Null, CallConv_THISCALL, ReturnType_Bool, ThisPointer_Ignore);
	DHookSetFromConf(g_hDetourCanUpgradeWithAttrib, hGameConf, SDKConf_Signature, "CTFGameRules::CanUpgradeWithAttrib");
	DHookAddParam(g_hDetourCanUpgradeWithAttrib, HookParamType_CBaseEntity);
	DHookAddParam(g_hDetourCanUpgradeWithAttrib, HookParamType_Int);
	DHookAddParam(g_hDetourCanUpgradeWithAttrib, HookParamType_Int);
	DHookEnableDetour(g_hDetourCanUpgradeWithAttrib, false, Detour_CTFGameRules_CanUpgradeWithAttrib); //pre hook, because we want to get params and change their returns,
		//and possibly ignore the original function
...
MRESReturn Detour_CTFGameRules_CanUpgradeWithAttrib(Handle hReturn, Handle hParams)
{
	int iClient = DHookGetParam(hParams, 0);
	int iWeaponSlot = DHookGetParam(hParams, 1);
	int iAttribIndex = DHookGetParam(hParams, 2);

	PrintToChat(iClient, "Upgrade check! Slot: %i, Attribute Index: %i", iWeaponSlot, iAttribIndex);

	DHookSetReturn(hReturn, false);
	return MRES_Ignored;
}
I'm very sorry if the solution seems obvious, I've never used detours before.
__________________
I code, I guess.
Zethax is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 01-08-2022 , 01:02   Re: Need Help Finding a Windows Signature
Reply With Quote #4

You'll want to grab Accelerator and link to the crash report, if not analyze it yourself. That said, it does look like CTFGameRules::CanUpgradeWithAttrib takes 5 parameters; you'll want to make sure they are all present in your detour setup.

On a side note, DHookGetParam numbers start from 1 (0 indicates the param count). It could raise an exception on the SP side, but that shouldn't be causing crashes from what you've posted.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Zethax
Member
Join Date: Sep 2015
Location: In my couch
Old 01-08-2022 , 14:22   Re: Need Help Finding a Windows Signature
Reply With Quote #5

Quote:
Originally Posted by nosoop View Post
You'll want to grab Accelerator and link to the crash report, if not analyze it yourself. That said, it does look like CTFGameRules::CanUpgradeWithAttrib takes 5 parameters; you'll want to make sure they are all present in your detour setup.

*snip*
That was the issue, thanks so much for your help!
__________________
I code, I guess.
Zethax 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:45.


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