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

[L4D & L4D2] Left 4 DHooks Direct (1.146) [21-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
A1mDev
Junior Member
Join Date: Jun 2021
Old 06-18-2021 , 05:13   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #321

We need the offset of this table 11872, it should work like this (if it could be found using sourcemod and it was network properties):

Table: m_InvulnerableTimer (offset 11872) (type DT_CountdownTimer)
Member: m_duration (offset 4) (type float) (bits 0) (NoScale)
Member: m_timestamp (offset 8) (type float) (bits 0) (NoScale)

PHP Code:
bool __usercall CTerrorPlayer::IsInvulnerable@<al>(long double a1@<st0>, CTerrorPlayer *this)
{
  
bool result// al
  
float v3// ST0C_4
  
  //342 CTerrorPlayer::IsGhost(void)const //342*4 = 1368
  
result = (*(int (__cdecl **)(CTerrorPlayer *))(*(_DWORD *)this 1368))(this);
  if ( !
result )
  {
    
result 0;
    
    
//11880 = 11872 + CTIMER_TIMESTAMP_OFFSET //CTIMER_TIMESTAMP_OFFSET = 8
    
if ( *((float *)this 11880) > 0.0 )
    {
      
v3 CountdownTimer::Now((CTerrorPlayer *)((char *)this 11872)); //v3 = gpGlobals->curtime
      
result v3 < *((float *)this 11880);
    }
  }
  return 
result;

This is how the original code looks, i think, it is for reference:
PHP Code:
bool CTerrorPlayer::IsInvulnerable()
{
    return (!
IsGhost() && m_InvulnerableTimer.HasStarted() && !m_InvulnerableTimer.IsElapsed());

Your plugin already does offsets by m_duration or m_timestamp. If you add to this offset 11880 + 4, you will go to the wrong place. Example:
PHP Code:
#define CTIMER_DURATION_OFFSET    view_as<Address>(4)
#define CTIMER_TIMESTAMP_OFFSET view_as<Address>(8)

static stock CTimer_SetTimestampCountdownTimer:timer Float:timestamp )
{
    
StoreToAddressAddress:timer CTIMER_TIMESTAMP_OFFSET _:timestamp NumberType_Int32 );

This does nothing with class members (and hex rays are a little wrong), you can verify by the original code, you see this because it passes a reference to this class CountdownTimer, but not on its members:

PHP Code:
CountdownTimer::Now((CTerrorPlayer *)((char *)this 11872)); 
Original code:
PHP Code:
float CountdownTimer::Nowvoid ) const
{
    return 
gpGlobals->curtime;


Last edited by A1mDev; 06-18-2021 at 06:11. Reason: add text
A1mDev is offline
A1mDev
Junior Member
Join Date: Jun 2021
Old 06-18-2021 , 05:33   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #322

it is better to make notes so that it is easy to check and update, if it goes on like this with updates, my brain will be broken
A1mDev is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-18-2021 , 08:03   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #323

It looks like these are the correct offsets, not sure what happened when I wrote down the 2.2.1.3 ones for last update. Can you check this and verify please?

Code:
			"InvulnerabilityTimer"
			{
				"windows"	"11892" // 2.2.1.3
				"linux"		"11872" // 2.2.1.3
			}
__________________

Last edited by Silvers; 06-18-2021 at 12:23.
Silvers is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 06-18-2021 , 11:32   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #324

It looks like L4D2Direct_GetInvulnerabilityTimer is broken
PHP Code:

bool IsClientInGodFrame
int client )
{
    
CountdownTimer timer L4D2Direct_GetInvulnerabilityTimer(client);
    
PrintToChatAll("%N has %.1fs left god frame, now: %.1f"clientCTimer_GetTimestamp(timer),GetGameTime());
    return (
CTimer_GetTimestamptimer ) - GetGameTime() > 0.0);

always return false
PHP Code:

Rochelle has 0.0s left god frame
now135.4
Rochelle has 0.0s left god frame
now135.4
Rochelle has 0.0s left god frame
now135.7
Rochelle has 0.0s left god frame
now135.7
Rochelle has 0.0s left god frame
now135.9
Rochelle has 0.0s left god frame
now136.0
Rochelle has 0.0s left god frame
now136.4
Rochelle has 0.0s left god frame
now136.4
Rochelle has 0.0s left god frame
now136.6
Rochelle has 0.0s left god frame
now136.6
Rochelle has 0.0s left god frame
now136.9 
__________________
HarryPotter is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-18-2021 , 12:23   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #325

Please try this for Linux:

Code:
			// Can be found in the "CTerrorPlayer::IsInvulnerable" function
			"InvulnerabilityTimer"
			{
				"windows"	"11892" // 2.2.1.3
				"linux"		"11872" // 2.2.1.3
			}



Quote:
Originally Posted by NiTro1 View Post
Silvers dont forget the addons disabler please
I can't see anything wrong with the offsets or signature on Linux. Windows is still working. Hopefully someone else can report if this is working or not or fix the issue.
__________________

Last edited by Silvers; 06-18-2021 at 12:24.
Silvers is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 06-18-2021 , 12:52   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #326

Quote:
Originally Posted by Silvers View Post
Please try this for Linux:

Code:
			// Can be found in the "CTerrorPlayer::IsInvulnerable" function
			"InvulnerabilityTimer"
			{
				"windows"	"11892" // 2.2.1.3
				"linux"		"11872" // 2.2.1.3
			}
oh my bad, didn't see that post,
windows "11892" is working, linux untest
__________________
HarryPotter is offline
NiTro1
Member
Join Date: Sep 2015
Location: france
Old 06-18-2021 , 13:13   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #327

Quote:
Originally Posted by Silvers View Post
Please try this for Linux:

I can't see anything wrong with the offsets or signature on Linux. Windows is still working. Hopefully someone else can report if this is working or not or fix the issue.
i will try few more tests to make sure.
NiTro1 is offline
Forgetest
Member
Join Date: Aug 2020
Old 06-18-2021 , 13:22   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #328

Quote:
Originally Posted by Silvers View Post
I can't see anything wrong with the offsets or signature on Linux. Windows is still working. Hopefully someone else can report if this is working or not or fix the issue.
Works on Linux (CentOS) here.

Last edited by Forgetest; 06-18-2021 at 13:23.
Forgetest is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-18-2021 , 14:50   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #329

Thanks, will push with next update once I know for sure if Addons Eclipse is working or not.
__________________
Silvers is offline
NiTro1
Member
Join Date: Sep 2015
Location: france
Old 06-18-2021 , 17:55   Re: [L4D & L4D2] Left 4 DHooks Direct (1.40) [16-Jun-2021]
Reply With Quote #330

Quote:
Originally Posted by Silvers View Post
Thanks, will push with next update once I know for sure if Addons Eclipse is working or not.
yes its working fine Silvers with the last Left 4 DHooks version
NiTro1 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 04:51.


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