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

CWeaponBox::PackWeapon signature


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-17-2015 , 14:40   CWeaponBox::PackWeapon signature
Reply With Quote #1

I'm trying to find CWeaponBox:: PackWeapon function signature but I can't figure out a way in which I can identify it into windows, because:
a) can't search by a given string
b) no function that use CWeaponBox:: PackWeapon has a string

If someone can find the signature and give it to me I would be glad, also to explain how he find it.
__________________

Last edited by HamletEagle; 01-17-2015 at 14:41.
HamletEagle is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-17-2015 , 14:55   Re: CWeaponBox::PackWeapon signature
Reply With Quote #2

0x83,0xEC,0x0C,0x53,0x57,0x8B,0x7C,0x24,0x1C, 0x33,0xDB,0x3B,0xFB - packPlayerItem
0x83,0xEC,0x08,0x53,0x55,0x56,0x57,0x8B,0x7C, 0x24,0x1C,0x8B,0xF1 - PackWeapon
0x51,0x53,0x8B,0x5C,0x24,0x0C,0x55,0x56,0x85, 0xDB - PackAmmo
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-17-2015 , 15:11   Re: CWeaponBox::PackWeapon signature
Reply With Quote #3

Thx.
How do you found it ? Can you explain please ?
__________________

Last edited by HamletEagle; 01-17-2015 at 15:15.
HamletEagle is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-18-2015 , 05:53   Re: CWeaponBox::PackWeapon signature
Reply With Quote #4

Lin:

PHP Code:
int __usercall packPlayerItem<eax>(int result<eax>, int a2<edx>, char a3<cl>)
{
  
int v3// ebx@1
  
int v4// esi@1
  
int v5// ebp@2
  
int v6// edi@3
  
int v7// edx@3
  
int v8// eax@3
  
long double v9// fst6@3
  
long double v10// fst7@3
  
long double v11// fst5@3
  
int v12// edx@3
  
int v13// eax@3
  
int v14// eax@6
  
char v15// [sp+1Fh] [bp-1Dh]@1

  
v3 result;
  
v4 a2;
  
v15 a3;
  if ( 
a2 )
  {
    
result GetCSModelName(*(_DWORD *)(a2 188));
    
v5 result;
    if ( 
result )
    {
      
v6 CBaseEntity::Create(
             (int)
"weaponbox",
             *(
_DWORD *)(v3 4) + 8,
             *(
_DWORD *)(v3 4) + 80,
             *(
_DWORD *)(*(_DWORD *)(v3 4) + 520));
      *(
_DWORD *)(*(_DWORD *)(v6 4) + 80) = 0;
      *(
_DWORD *)(*(_DWORD *)(v6 4) + 88) = 0;
      
v7 = *(_DWORD *)(v3 4);
      
v8 = *(_DWORD *)(v6 4);
      
v9 = *(float *)(v7 40) * 0.75;
      
v10 = *(float *)(v7 36) * 0.75;
      
v11 0.75 * *(float *)(v7 32);
      
v12 gpGlobals;
      *(
float *)(v8 32) = v11;
      *(
float *)(v8 36) = v10;
      *(
float *)(v8 40) = v9;
      *(
_DWORD *)(v6 16) = CWeaponBox::Kill;
      
v13 = *(_DWORD *)(v6 4);
      *(
_DWORD *)(v6 20) = 0;
      *(
float *)(v13 260) = *(float *)v12 300.0;
      
CWeaponBox::PackWeapon(v6v4);
      if ( 
v15 )
      {
        
v14 = (*(int (__cdecl **)(int))(*(_DWORD *)v4 296))(v4);
        
CWeaponBox::PackAmmo(
          
v6,
          *(
_DWORD *)&CBasePlayerItem::ItemInfoArray[44 * *(_DWORD *)(v4 188) + 8] - *(_DWORD *)(gpGlobals 152),
          *(
_DWORD *)(v3 v14 1524));
      }
      
result = ((int (__cdecl *)(_DWORDint))*(&g_engfuncs 2))(*(_DWORD *)(*(_DWORD *)(v6 4) + 520), v5);
    }
  }
  return 
result;

I found with the keyword - "weaponbox"

Win:

PHP Code:
void __cdecl sub_1009D770(int a1int a2char a3)
{
  
int v3// edi@1
  
int v4// esi@3
  
int v5// ecx@3
  
float v6// ST20_4@3
  
float v7// ST24_4@3
  
double v8// st7@3
  
float v9// ST28_4@3
  
char *v10// ebx@4
  
int v11// eax@4
  
int v12// [sp+1Ch] [bp+8h]@2

  
v3 a2;
  if ( 
a2 )
  {
    
v12 sub_1009D8A0(*(_DWORD *)(a2 172));
    if ( 
v12 )
    {
      
v4 sub_10063B20(
             (int)
"weaponbox",
             *(
_DWORD *)(a1 4) + 8,
             *(
_DWORD *)(a1 4) + 80,
             *(
_DWORD *)(*(_DWORD *)(a1 4) + 520));
      *(
_DWORD *)(*(_DWORD *)(v4 4) + 80) = 0;
      *(
_DWORD *)(*(_DWORD *)(v4 4) + 88) = 0;
      
v5 = *(_DWORD *)(v4 4) + 32;
      
v6 = *(float *)(*(_DWORD *)(a1 4) + 32) * 0.75;
      
v7 = *(float *)(*(_DWORD *)(a1 4) + 36) * 0.75;
      
v8 = *(float *)(*(_DWORD *)(a1 4) + 40) * 0.75;
      *(
_DWORD *)v5 LODWORD(v6);
      
v9 v8;
      *(
_DWORD *)(v5 4) = LODWORD(v7);
      *(
_DWORD *)(v5 8) = LODWORD(v9);
      *(
_DWORD *)(v4 16) = CWeaponBox::Kill;
      *(
float *)(*(_DWORD *)(v4 4) + 260) = *LODWORD(dword_10161E38) + 300.0;
      
sub_100D04F0((void *)v4v3);
      if ( 
a3 )
      {
        
v10 = (&dword_10175FD8)[44 * *(_DWORD *)(v3 172)];
        
v11 = (*(int (__thiscall **)(int))(*(_DWORD *)v3 296))(v3);
        
sub_100D0660(
          (
void *)v4,
          (int)&
v10[-*(_DWORD *)(LODWORD(dword_10161E38) + 152)],
          *(
_DWORD *)(a1 v11 1504));
      }
      
dword_10161BC8(*(_DWORD *)(*(_DWORD *)(v4 4) + 520), v12);
    }
  }

__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-18-2015 , 07:21   Re: CWeaponBox::PackWeapon signature
Reply With Quote #5

Ah, from packPlayerItem we can find PackWeapond and PackAmmo, nice.

One more thing:

In linux is like:
PHP Code:
signed int __cdecl CWeaponBox__PackWeapon(int a1int a2)
{
  
int v2// eax@2
  
signed int result// eax@6
  
int v4// eax@7
  
int v5// edx@7
  
int v6// ecx@7
  
int v7// ST08_4@7
  
int v8// ST0C_4@7
  
int v9// [sp-Ch] [bp-24h]@1

  
if ( CWeaponBox__HasWeapon(a1a2) )
    goto 
LABEL_13;
  
v2 = *(_DWORD *)(a2 180);
  if ( !
v2 )
    goto 
LABEL_14;
  if ( *(
_DWORD *)(v2 1512) == a2 )
    (*(
void (__cdecl **)(int_DWORD))(*(_DWORD *)(a2 148) + 276))(a20);
  if ( !(*(
int (__cdecl **)(_DWORDint))(*(_DWORD *)(*(_DWORD *)(a2 180) + 148) + 104))(*(_DWORD *)(a2 180), a2) )
  {
LABEL_13:
    
result 0;
  }
  else
  {
LABEL_14:
    
v4 * (*(int (__stdcall **)(intintintint))(*(_DWORD *)(a2 148) + 324))(a2v9v7v8);
    
v5 a1 152;
    
v6 = *(_DWORD *)(v4 a1 152);
    if ( 
v6 )
    {
      *(
_DWORD *)(a2 184) = v6;
      *(
_DWORD *)(v4 v5) = a2;
    }
    else
    {
      *(
_DWORD *)(v4 v5) = a2;
      *(
_DWORD *)(a2 184) = 0;
    }
    *(
_BYTE *)(*(_DWORD *)a2 419) |= 0x40u;
    *(
_DWORD *)(*(_DWORD *)a2 264) = 0;
    *(
_DWORD *)(*(_DWORD *)a2 268) = 0;
    *(
_DWORD *)(*(_DWORD *)a2 280) = 128;
    *(
_DWORD *)(*(_DWORD *)a2 180) = 0;
    *(
_DWORD *)(*(_DWORD *)a2 184) = 0;
    *(
_DWORD *)(*(_DWORD *)a2 408) = *(_DWORD *)(*(_DWORD *)a1 520);
    *(
_DWORD *)(a2 12) = 0;
    *(
_DWORD *)(a2 16) = 0;
    *(
_DWORD *)(a2 20) = 0;
    *(
_DWORD *)(a2 24) = 0;
    *(
_DWORD *)(a2 180) = 0;
    
result 1;
  }
  return 
result;

In windows:
PHP Code:
signed int __thiscall CWeaponBox__PackWeapon(void *thisint a2)
{
  
int v2// ebp@1
  
int v3// edi@1
  
void *v4// esi@1
  
int v5// eax@2
  
int v6// eax@7
  
int v8// eax@12
  
int v9// ecx@12
  
const char *v10// [sp+10h] [bp-8h]@2
  
void *v11// [sp+14h] [bp-4h]@1
  
int v12// [sp+1Ch] [bp+4h]@2

  
v3 a2;
  
v4 this;
  
v11 this;
  
v2 = *((_DWORD *)this + (*(int (__thiscall **)(int))(*(_DWORD *)a2 316))(a2) + 34);
  if ( 
v2 )
  {
    
v5 = *(_DWORD *)(LODWORD(dword_10160E18) + 152);
    
v12 = *(_DWORD *)(LODWORD(dword_10160E18) + 152);
    
v10 = (const char *)(v5 + **(_DWORD **)(v3 4));
    while ( 
strcmp((const char *)(v5 + **(_DWORD **)(v2 4)), v10) )
    {
      
v2 = *(_DWORD *)(v2 168);
      if ( !
v2 )
      {
        
v4 v11;
        goto 
LABEL_7;
      }
      
v5 v12;
    }
    return 
0;
  }
LABEL_7:
  
v6 = *(_DWORD *)(v3 164);
  if ( 
v6 )
  {
    if ( *(
_DWORD *)(v6 1492) == v3 )
      (*(
void (__thiscall **)(int_DWORD))(*(_DWORD *)v3 268))(v30);
    if ( !(*(
int (__stdcall **)(int))(**(_DWORD **)(v3 164) + 96))(v3) )
      return 
0;
  }
  
v8 = (*(int (__thiscall **)(int))(*(_DWORD *)v3 316))(v3);
  
v9 = *((_DWORD *)v4 v8 34);
  if ( 
v9 )
  {
    *(
_DWORD *)(v3 168) = v9;
    *((
_DWORD *)v4 v8 34) = v3;
  }
  else
  {
    *((
_DWORD *)v4 v8 34) = v3;
    *(
_DWORD *)(v3 168) = 0;
  }
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 416) |= 0x40000000u;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 264) = 0;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 268) = 0;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 280) = 128;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 180) = 0;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 184) = 0;
  *(
_DWORD *)(*(_DWORD *)(v3 4) + 408) = *(_DWORD *)(*((_DWORD *)v4 1) + 520);
  *(
_DWORD *)(v3 16) = 0;
  *(
_DWORD *)(v3 20) = 0;
  *(
_DWORD *)(v3 164) = 0;
  return 
1;

So, under win the check is gone:
PHP Code:
 if ( CWeaponBox__HasWeapon(a1a2) ) 
I think that this functions is integrated in PackWeapon under windows but I'm not sure( didn't tried to find HaSWeapon in other ways, just saw that the check is missing).
__________________
HamletEagle is offline
Old 01-18-2015, 08:35
Bos93
This message has been deleted by Bos93. Reason: wrong
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-18-2015 , 09:01   Re: CWeaponBox::PackWeapon signature
Reply With Quote #6

Quote:
I think that this functions is integrated in PackWeapon under windows
yeah

PHP Code:
  v2 = *((_DWORD *)this + (*(int (__thiscall **)(int))(*(_DWORD *)a2 316))(a2) + 34);
  if ( 
v2 )
  {
    
v5 = *(_DWORD *)(LODWORD(dword_10160E18) + 152);
    
v12 = *(_DWORD *)(LODWORD(dword_10160E18) + 152);
    
v10 = (const char *)(v5 + **(_DWORD **)(v3 4));
    while ( 
strcmp((const char *)(v5 + **(_DWORD **)(v2 4)), v10) )
    {
      
v2 = *(_DWORD *)(v2 168);
      if ( !
v2 )
      {
        
v4 v11;
        goto 
LABEL_7;
      }
      
v5 v12;
    }
    return 
0;
  } 
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 19:03.


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