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

Solved [L4D2] cs_ragdoll usage?


Post New Thread Reply   
 
Thread Tools Display Modes
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-07-2019 , 05:07   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #11

Quote:
Originally Posted by Dragokas View Post
Lux made many plugins related to ragdolls. See, if any could be useful for you.
Thanks for the suggestions, but I didn't find anything that could help.
Lux's ragdoll plugins either use prop_ragdoll, cs_ragdoll entities that didn't have pose + velocity defined, or usage of the m_isFallingFromLedge netprop on survivors which prevents the death model from spawning.

Last edited by Shadowysn; 06-07-2019 at 05:32.
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-07-2019 , 06:35   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #12

Code:
			"CSurvivorDeathModel::Create"
			{
				"library"		"server"
				"linux"			"@_ZN19CSurvivorDeathModel6CreateEP13CTerrorPlayer"
				"windows"		"\x55\x8B\xEC\x57\x8B\x7D\x08\x85\xFF\x75\x2A\x33\xC0\x5F\x5D\xC3\x8B\x87\x38\x01\x00\x00"
								/* 55 8B EC 57 8B 7D 08 85 FF 75 ? 33 C0 5F 5D C3 8B 87 38 01 00 00 */
				
			}
Should work just pass the client pointer(index) to this function and should create a deathmodel, i'v not tested this just something i detoured.

And force ragdolls or whatever you doing enjoy
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-07-2019 , 07:51   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #13

Quote:
Originally Posted by Lux View Post
Code:
			"CSurvivorDeathModel::Create"
			{
				"library"		"server"
				"linux"			"@_ZN19CSurvivorDeathModel6CreateEP13CTerrorPlayer"
				"windows"		"\x55\x8B\xEC\x57\x8B\x7D\x08\x85\xFF\x75\x2A\x33\xC0\x5F\x5D\xC3\x8B\x87\x38\x01\x00\x00"
								/* 55 8B EC 57 8B 7D 08 85 FF 75 ? 33 C0 5F 5D C3 8B 87 38 01 00 00 */
				
			}
Should work just pass the client pointer(index) to this function and should create a deathmodel, i'v not tested this just something i detoured.

And force ragdolls or whatever you doing enjoy
Interesting. I'd much more prefer a function that creates client ragdolls, but I guess it'll serve as well...

...but unfortunately, I have no experience with signatures because the tutorials I find are generally confusing.
Damn it.
Shadowysn is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-07-2019 , 07:59   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #14

Look at plugins for examples, use alliedmods API and wiki, best way to learn imo.
__________________
Silvers is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-07-2019 , 08:07   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #15

Quote:
Originally Posted by Shadowysn View Post
Interesting. I'd much more prefer a function that creates client ragdolls, but I guess it'll serve as well...

...but unfortunately, I have no experience with signatures because the tutorials I find are generally confusing.
Damn it.
PHP Code:
#define GAMEDATA    "CSurvivorDeathModel_Create"


static Handle hCreateDeathModel null;

public 
void OnPluginStart()
{
    
Handle hGamedata LoadGameConfigFile(GAMEDATA);
    if(
hGamedata == null
        
SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);
    
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(hGamedataSDKConf_Signature"CSurvivorDeathModel::Create");
    
hCreateDeathModel EndPrepSDKCall();
    
delete hGamedata;
    
    if(
hCreateDeathModel == null)
        
SetFailState("Unable to prep \"CSurvivorDeathModel::Create\"");
    
}

//example how to call
//SDKCall(hCreateDeathModel, client); 
I think this is what you need, if it don't work for ya idk not really played with it.

Quote:
Originally Posted by Shadowysn View Post
I'd much more prefer a function that creates client ragdolls
Unless you know how pass the proper infomation to CCSPlayer::CreateRagdollEntity(CCSPlayer *this, const CTakeDamageInfo *a2) probs need to use dhooks to get that pointer from function before to get CTakeDamageInfo ptr.

Here is sig for that.

Code:
			"CCSPlayer::CreateRagdollEntity"
			{
				"library"		"server"
				"linux"			"@_ZN9CCSPlayer19CreateRagdollEntityERK15CTakeDamageInfo"
				"windows"		"\x55\x8B\xEC\x51\x53\x56\x57\x8B\xF9\x8B\x87\xC0\x28\x00\x00"
								/* 55 8B EC 51 53 56 57 8B F9 8B 87 C0 28 00 00 */
				
			}
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 06-07-2019 at 08:19.
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-07-2019 , 08:35   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #16

Quote:
Originally Posted by Lux View Post
PHP Code:
#define GAMEDATA    "CSurvivorDeathModel_Create"


static Handle hCreateDeathModel null;

public 
void OnPluginStart()
{
    
Handle hGamedata LoadGameConfigFile(GAMEDATA);
    if(
hGamedata == null
        
SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);
    
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(hGamedataSDKConf_Signature"CSurvivorDeathModel::Create");
    
hCreateDeathModel EndPrepSDKCall();
    
delete hGamedata;
    
    if(
hCreateDeathModel == null)
        
SetFailState("Unable to prep \"CSurvivorDeathModel::Create\"");
    
}

//example how to call
//SDKCall(hCreateDeathModel, client); 
I think this is what you need, if it don't work for ya idk not really played with it.


Unless you know how pass the proper infomation to CCSPlayer::CreateRagdollEntity(CCSPlayer *this, const CTakeDamageInfo *a2) probs need to use dhooks to get that pointer from function before to get CTakeDamageInfo ptr.

Here is sig for that.

Code:
			"CCSPlayer::CreateRagdollEntity"
			{
				"library"		"server"
				"linux"			"@_ZN9CCSPlayer19CreateRagdollEntityERK15CTakeDamageInfo"
				"windows"		"\x55\x8B\xEC\x51\x53\x56\x57\x8B\xF9\x8B\x87\xC0\x28\x00\x00"
								/* 55 8B EC 51 53 56 57 8B F9 8B 87 C0 28 00 00 */
				
			}
Not to be a hassle but how are you getting the signature information? I used the vtable dumper but all I got was the name of the signature, nothing else.

Saw CTerrorPlayer::CreateRagdollEntity(CTakeDamag eInfo const&) and wanted to use that because there wasn't any CCSPlayer::CreateRagdollEntity signature to be found on CTerrorPlayer.

Also, I downloaded and opened up ollydbg.exe and opened server.dll in the left 4 dead 2 folder, before closing it due to confusion. Should I be worried about leaving any residue that might trigger a VAC ban the next time I go out of insecure mode?

Last edited by Shadowysn; 06-07-2019 at 08:36.
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-07-2019 , 08:51   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #17

Using hexrays IDA to get function signitures.

CTerrorPlayer::CreateRagdollEntity(CTakeDamag eInfo const&) calls both of those signatures i gave you, depending on the type of death and team it will create ragdoll or deathmodel.

Here is the function is pseudo code(windows binary)

PHP Code:
int __thiscall CTerrorPlayer::CreateRagdollEntity(Concurrency::details::UMSSchedulerProxy *thisint a2)
{
  
Concurrency::details::UMSSchedulerProxy *v2// esi
  
int v3// eax
  
int result// eax
  
bool v5// zf
  
void (__thiscall *v6)(Concurrency::details::UMSSchedulerProxy *, const char *); // edx
  
_DWORD *v7// ecx

  
v2 this;
  
v3 CBaseEntity::GetTeamNumber(this);
  
result IsASurvivorTeam(v3);
  if ( (
_BYTE)result && !*((_BYTE *)v2 14886) )
    return 
CSurvivorDeathModel::Create(v2);
  if ( !*((
_BYTE *)v2 13225) )
  {
    if ( 
CBaseEntity::GetTeamNumber(v2) == 3
      
&& (*(int (__thiscall **)(Concurrency::details::UMSSchedulerProxy *))(*(_DWORD *)v2 1340))(v2) == )
    {
      
v5 Concurrency::details::UMSSchedulerProxy::GetTransferListEvent(v2) == (void *)2;
      
v6 = *(void (__thiscall **)(Concurrency::details::UMSSchedulerProxy *, const char *))(*(_DWORD *)v2 104);
      if ( 
v5 )
        
v6(v2"models/infected/limbs/exploded_boomette.mdl");
      else
        
v6(v2"models/infected/limbs/exploded_boomer.mdl");
      if ( *((
_DWORD *)v2 269) )
      {
        if ( *((
_BYTE *)v2 100) )
        {
          *((
_BYTE *)v2 104) |= 1u;
        }
        else
        {
          
v7 = (_DWORD *)*((_DWORD *)v2 10);
          if ( 
v7 )
          {
            *
v7 |= 0x101u;
            *(
_WORD *)(GetChangeAccessor(v7) + 2) = 0;
          }
        }
        *((
_DWORD *)v2 269) = 0;
      }
      *((
_DWORD *)v2 2602) = 0;
      *((
_DWORD *)v2 2603) = 0;
      *((
_DWORD *)v2 2604) = 0;
    }
    
result CCSPlayer::CreateRagdollEntity((int)v2a2a2);
  }
  return 
result;

__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-07-2019 , 10:39   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #18

Quote:
Originally Posted by Lux View Post
Using hexrays IDA to get function signitures.

CTerrorPlayer::CreateRagdollEntity(CTakeDamag eInfo const&) calls both of those signatures i gave you, depending on the type of death and team it will create ragdoll or deathmodel.

Here is the function is pseudo code(windows binary)

PHP Code:
int __thiscall CTerrorPlayer::CreateRagdollEntity(Concurrency::details::UMSSchedulerProxy *thisint a2)
{
  
Concurrency::details::UMSSchedulerProxy *v2// esi
  
int v3// eax
  
int result// eax
  
bool v5// zf
  
void (__thiscall *v6)(Concurrency::details::UMSSchedulerProxy *, const char *); // edx
  
_DWORD *v7// ecx

  
v2 this;
  
v3 CBaseEntity::GetTeamNumber(this);
  
result IsASurvivorTeam(v3);
  if ( (
_BYTE)result && !*((_BYTE *)v2 14886) )
    return 
CSurvivorDeathModel::Create(v2);
  if ( !*((
_BYTE *)v2 13225) )
  {
    if ( 
CBaseEntity::GetTeamNumber(v2) == 3
      
&& (*(int (__thiscall **)(Concurrency::details::UMSSchedulerProxy *))(*(_DWORD *)v2 1340))(v2) == )
    {
      
v5 Concurrency::details::UMSSchedulerProxy::GetTransferListEvent(v2) == (void *)2;
      
v6 = *(void (__thiscall **)(Concurrency::details::UMSSchedulerProxy *, const char *))(*(_DWORD *)v2 104);
      if ( 
v5 )
        
v6(v2"models/infected/limbs/exploded_boomette.mdl");
      else
        
v6(v2"models/infected/limbs/exploded_boomer.mdl");
      if ( *((
_DWORD *)v2 269) )
      {
        if ( *((
_BYTE *)v2 100) )
        {
          *((
_BYTE *)v2 104) |= 1u;
        }
        else
        {
          
v7 = (_DWORD *)*((_DWORD *)v2 10);
          if ( 
v7 )
          {
            *
v7 |= 0x101u;
            *(
_WORD *)(GetChangeAccessor(v7) + 2) = 0;
          }
        }
        *((
_DWORD *)v2 269) = 0;
      }
      *((
_DWORD *)v2 2602) = 0;
      *((
_DWORD *)v2 2603) = 0;
      *((
_DWORD *)v2 2604) = 0;
    }
    
result CCSPlayer::CreateRagdollEntity((int)v2a2a2);
  }
  return 
result;

Ah, thanks for notifying me of that.

So, about CTakeDamageInfo, is there any way to create one? Or if not possible, how to get CTakeDamageInfo from the hurt dhook?
Shadowysn is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 06-08-2019 , 01:49   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #19

Quote:
Originally Posted by Shadowysn View Post
Ah, thanks for notifying me of that.

So, about CTakeDamageInfo, is there any way to create one? Or if not possible, how to get CTakeDamageInfo from the hurt dhook?
¯\_(ツ)_/¯ dunno how to create one and get it.

Only way that will maybe work is what i said getting it from the function before(CTerrorPlayer::CreateRagdollEntity) and feeding it to the function you want.

This is something i don't know enough about.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 06-09-2019 , 09:27   Re: [L4D2] cs_ragdoll usage?
Reply With Quote #20

Quote:
Originally Posted by Lux View Post
¯\_(ツ)_/¯ dunno how to create one and get it.

Only way that will maybe work is what i said getting it from the function before(CTerrorPlayer::CreateRagdollEntity) and feeding it to the function you want.

This is something i don't know enough about.
Darn, looks like not everything goes the easy way.
I'm just going to assume not including a CTakeDamageInfo will cause an error so I'll try and search around the forums for dhooks and how to get stuff like CTakeDamageInfo from pointers.
Shadowysn 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 20:04.


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