Raised This Month: $13 Target: $400
 3% 

[REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m0b
New Member
Join Date: Jun 2020
Old 06-08-2020 , 13:56   [REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)
Reply With Quote #1

I saw it on the monster's servers.

I don't need a menu...etc, i only need the sticker function, with which i can stick by stickerID, eg. "!stickers stickerid1 stickerwear1 stickerid2 stickerwear2 stickerid3 stickerwear3 stickerid4 stickerwear4"

Payment will be made via PayPal/Skins

Thank you in advance, and I'll be waiting for you!

Last edited by m0b; 07-01-2020 at 20:00.
m0b is offline
m0b
New Member
Join Date: Jun 2020
Old 06-25-2020 , 19:49   Re: [REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)
Reply With Quote #2

up , maybe it will help you

Pretty much you have to reconstruct C_EconItemView::GenerateStickerMaterials.

PHP Code:
Code:
class 
C_EconItemView
{
public:
    
void GenerateStickerMaterials()
    {
        if ( !
GetItemSchema() )
            return;
        
        
int iSupportedStickerSlots 0;
        
        
CCStrike15ItemDefinitionpItemDefinition GetItemDefinition();
        if ( 
pItemDefinition )
            
iSupportedStickerSlots pItemDefinition->GetNumSupportedStickerSlots();
        
        
m_vStickerMaterialReferences.RemoveAll();
        
        if ( !
pItemDefinition || iSupportedStickerSlots )
            return;
        
        
CUnknownpUnknown reinterpret_cast<CUnknown*>( this 0xC );
        for ( 
int i 0iSupportedStickerSlots; ++)
        {
            
int iStickerID pUnknown->iGetStickerIDBySloti0);
            if ( !
iStickerID )
                continue;
            
            
float fWearProgress pUnknown->fGetStickerInfoiInfoTypes::WearProgress0.f );
            
float fPatternScale pUnknown->fGetStickerInfoiInfoTypes::PatternScale1.f );
            
float fPatternRotation pUnknown->fGetStickerInfoiInfoTypes::PatternRotation0.f );
            
            const 
charpszStickerSlotMaterial pItemDefinition->GetStickerSlotMaterialBySlotIndex);
            if ( !
pszStickerSlotMaterial || !pszStickerSlotMaterial[0] )
                continue;
            
            
char szWeaponDecal[32];
            
V_FileBaseszWeaponDecalpszStickerSlotMaterial32 );
            
            
CStickerKitpSK reinterpret_cast<CCStrike15ItemSystem*>( GetItemSchema() + )->GetStickerKitDefinitioniStickerID );
            if ( !
pSK )
                continue;
            
            if ( !
pSK->sticker_material.m_iLength )
                continue;
            
            if ( !
pSK->sticker_material.m_pszString || !pSK->sticker_material.m_pszString[0] )
                continue;
            
            
char szPath[MAX_PATH];
            if ( 
pSK->bCustomStickerMaterial // Doesn't seem to be set to true for any of the stickers currently in-game. Used for the people that want to get their stickers in the Workshop?
                
V_snprintfszPathsizeof szPath"%s"pSK->sticker_material.m_pszString );
            else
                
V_snprintfszPathsizeof szPath"materials/models/weapons/customization/stickers/%s.vmt"pSK->sticker_material.m_pszString );
            
            
char szHash[32];
            
V_snprintfszHashsizeof szHash"%f_%f_%f"fPatternRotationfPatternScalefWearProgress );
            
unsigned uHash HashStringCaselessszHash );
            
            
char szMaterialName1st[128]; V_snprintfszMaterialName1stsizeof szMaterialName1st"sticker_%s_%s_%i_1st"szWeaponDecalpSK->sticker_material.m_pszStringuHash );
            
char szMaterialName3rd[128]; V_snprintfszMaterialName3rdsizeof szMaterialName3rd"sticker_%s_%s_%i_3rd"szWeaponDecalpSK->sticker_material.m_pszStringuHash );
            
            
CMaterialpFirstPersonMaterial materials->FindProceduralMaterialszMaterialName1st"Other textures");
            
CMaterialpThirdPersonMaterial materials->FindProceduralMaterialszMaterialName3rd"Other textures");
            
            if ( 
pFirstPersonMaterial->IsErrorMaterial() || pThirdPersonMaterial->IsErrorMaterial() )
            {
                
KeyValueskv = new KeyValues"vmt" );
                if ( 
kv->LoadFromFileg_pFullFileSystem /* + 4*/szPath"GAME") )
                {
                    
kv->SetFloat"$wearprogress"fWearProgress );
                    
kv->SetFloat"$patternrotation"fPatternRotation );
                    
kv->SetFloat"$patternscale"fPatternScale );
                    
                    if ( 
pFirstPersonMaterial->IsErrorMaterial() )
                    {
                        
KeyValueskv2 = new KeyValues"vmt" );
                        if ( 
kv2->LoadFromFileg_pFullFileSystem /* + 4*/pszStickerSlotMaterial"GAME") )
                        {
                            if ( !
cl_righthand->GetInt() )
                                
kv2->SetInt"$mirrorhorizontal");
                            
                            
kv2->MergeFromkvKeyValues::MERGE_KV_UPDATE );
                            
                            
char szPath[MAX_PATH];
                            
V_snprintfszPathsizeof szPath"materials/models/weapons/customization/stickers/default/sticker_proxies_%i.vmt");
                            
                            
KeyValueskv3 = new KeyValues"vmt" );
                            if ( 
kv3->LoadFromFile g_pFullFileSystem /* + 4*/szPath"GAME")
                                
kv2->MergeFromkv3KeyValues::MERGE_KV_UPDATE );
                            
                            
pFirstPersonMaterial materials->CreateMaterialszMaterialName1stkv2 );
                            
pFirstPersonMaterial->Refresh();
                            
                            
delete kv3;
                        }
                        
                        
delete kv2;
                    }
                    
                    if ( 
pThirdPersonMaterial->IsErrorMaterial() )
                    {
                        
KeyValueskv2 = new KeyValues"WeaponDecal" );
                        
                        
kv2->MergeFromkvKeyValues::MERGE_KV_UPDATE );
                        
kv2->SetInt"$thirdperson");
                        
                        
pThirdPersonMaterial materials->CreateMaterialszMaterialName3rdkv2 );
                        
pThirdPersonMaterial->Refresh();
                        
                        
//delete kv2; - I spent ~1 fucking day trying to figure out what was causing the fucking crash just to see all I have to do is comment 1 line. Why do I have to do this? I don't know and I don't want to fucking know. fuck fucking fuck. I hope you understand I'm mad. fuck.
                    
}
                }
                
                
delete kv;
            }
            
            
stickerMaterialReference_tstickerMaterialReference = &m_vStickerMaterialReferences[m_vStickerMaterialReferences.AddToTail()];
            
stickerMaterialReference->FirstPerson.InitpFirstPersonMaterial );
            
stickerMaterialReference->ThirdPerson.InitpThirdPersonMaterial );
            
stickerMaterialReference->iPosition i;
        }
    }
    
    
CCStrike15ItemDefinitionGetItemDefinition();
    
private:
    
struct stickerMaterialReference_t
    
{
        
CMaterialReference FirstPerson;
        
CMaterialReference ThirdPerson;
        
unsigned int iPosition;
    };
 
    
CUtlVector<stickerMaterialReference_tm_vStickerMaterialReferences;
};
 
class 
CMaterial
{
public:
    
virtual void IncrementReferenceCount();
    
virtual void DecrementReferenceCount();
    
virtual void Refresh();
    
virtual bool IsErrorMaterial();
};
 
class 
CMaterialReference// You can find this in the SDK.
 
class CMaterialSystem
{
public:
    
virtual CMaterialCreateMaterial( const charpMaterialNameKeyValuespVMTKeyValues );
    
virtual CMaterialFindProceduralMaterial( const charpMaterialName, const charpTextureGroupNameKeyValuespVMTKeyValues )
};
 
enum InfoTypes
{
    
WearProgress 1,
    
PatternScale,
    
PatternRotation
};
class 
CUnknown
{
public:
    
virtual int iGetStickerIDBySlotint iSlotint iUnknownint iDefaultReturn );
    
virtual float fGetStickerInfoint iSlotInfoTypes Typefloat fDefaultReturn );
};
 
class 
CCStrike15ItemDefinition
{
public:
    
virtual int GetNumSupportedStickerSlots();
    
virtual const charGetStickerSlotMaterialBySlotIndex();
};
 
class 
CCustomString // CUtlString
{
public:
    
charm_pszString;
    
int m_iUnknown0m_iUnknown1;
    
// ^ = CUtlMemory<unsigned char> m_Memory;
    
    
int m_iLength// int m_nActualLength
};
 
class 
CStickerKit // I came up with this some months ago, still seems to be up-to-date...
{
public:
    
int id;
 
    
int item_rarity;
 
    
CCustomString name;
    
CCustomString description_string;
    
CCustomString item_name;
    
CCustomString sticker_material;
    
CCustomString image_inventory;
 
    
int tournament_event_id;
    
int tournament_team_id
    
int tournament_player_id;
    
bool bCustomStickerMaterial;
 
    
float rotate_end;
    
float rotate_start;
 
    
float scale_min;
    
float scale_max;
 
    
float wear_min;
    
float wear_max;
 
    
CCustomString image_inventory2;
    
CCustomString image_inventory_large;
 
    
DWORD N00000B91// I don't really remember what's this, maybe a pointer?
 
private:
    
DWORD pad0[3];
};
 
class 
CCStrike15ItemSystem
{
public:
    
CStickerKitGetStickerKitDefinitionint iStickerID );
};
 
 
CCStrike15ItemSystemGetItemSchema();
void V_FileBasecharout, const charinint maxlen ); // In the SDK it's void V_FileBase( const char *in, char *out,int maxlen ); but in the game it seems to be different... I don't actually call this function so I'm not sure if it works so if you don't want to call the one in the game just paste it from the SDK
unsigned FASTCALL HashStringCaseless( const charpszKey ); 
You can call this function whenever and wherever you want. But you'll have to change m_iItemIDHigh just like you do with skins. The first time you call it there's no need for a ForceFullUpdate but for the next ones you can just switch to another weapon and back to the first one or call ForceFullUpdate. Since I'm calling ForceFullUpdate whenever any sticker changes, I'm calling GenerateStickerMaterials inside FrameStageNotify.

Now, I didn't want this to be that easy to paste, you'll have to do some reversing for yourself. There are plenty of strings in the function. You'll have to find virtual function's indexes, m_vStickerMaterialReferences's offset and other's function addresses and look through the SDK for other classes.

Here's a minimalistic CUtlVector class:
PHP Code:
Code:
inline int UtlMemory_CalcNewAllocationCountint nAllocationCountint nGrowSizeint nNewSizeint nBytesItem )
{
    if ( 
nGrowSize )
        
nAllocationCount = ( ( + ( ( nNewSize ) / nGrowSize ) ) * nGrowSize );
    else
    {
        if ( !
nAllocationCount )
            
nAllocationCount = ( 31 nBytesItem ) / nBytesItem;
 
        while ( 
nAllocationCount nNewSize )
            
nAllocationCount *= 2;
    }
 
    return 
nAllocationCount;
}
 
template< class T, class int >
class 
CUtlMemory
{
public:
    
Toperator[]( I i )
    {
        return 
m_pMemory[i];
    }
 
    
TBase()
    {
        return 
m_pMemory;
    }
 
    
int NumAllocated() const
    {
        return 
m_nAllocationCount;
    }
 
    
void Growint num )
    {
        if ( 
IsExternallyAllocated() )
            return;
 
        
int nAllocationRequested m_nAllocationCount num;
        
int nNewAllocationCount UtlMemory_CalcNewAllocationCountm_nAllocationCountm_nGrowSizenAllocationRequestedsizeof) );
 
        if ( (int) (
InNewAllocationCount nAllocationRequested )
        {
            if ( (int) (
InNewAllocationCount == && (int) (I) ( nNewAllocationCount ) >= nAllocationRequested )
                --
nNewAllocationCount;
            else
            {
                if ( (int) (
InAllocationRequested != nAllocationRequested )
                    return;
 
                while ( (int) (
InNewAllocationCount nAllocationRequested )
                    
nNewAllocationCount = ( nNewAllocationCount nAllocationRequested ) / 2;
            }
        }
 
        
m_nAllocationCount nNewAllocationCount;
 
        if ( 
m_pMemory )
            
m_pMemory = (T*) g_pMemAlloc->Reallocm_pMemorym_nAllocationCount sizeof) );
        else
            
m_pMemory = (T*) g_pMemAlloc->Allocm_nAllocationCount sizeof) );
    }
 
    
bool IsExternallyAllocated() const
    {
        return 
m_nGrowSize 0;
    }
 
protected:
    
Tm_pMemory;
    
int m_nAllocationCount;
    
int m_nGrowSize;
};
 
template <class T>
inline TConstructTpMemory )
{
    return ::new( 
pMemory T;
}
 
template <class T>
inline void DestructTpMemory )
{
    
pMemory->~T();
}
 
template< class T, class CUtlMemory<T> >
class 
CUtlVector
{
    
typedef A CAllocator;
public:
    
Toperator[]( int i )
    {
        return 
m_Memory[i];
    }
 
    
TElementint i )
    {
        return 
m_Memory[i];
    }
 
    
TBase()
    {
        return 
m_Memory.Base();
    }
 
    
int Count() const
    {
        return 
m_Size;
    }
 
    
void RemoveAll()
    {
        for ( 
int i m_Size; -->= 0; )
            
Destruct( &Element) );
 
        
m_Size 0;
    }
 
    
int AddToTail()
    {
        return 
InsertBeforem_Size );
    }
 
    
int InsertBeforeint elem )
    {
        
GrowVector();
        
ShiftElementsRightelem );
        
Construct( &Elementelem ) );
 
        return 
elem;
    }
 
protected:
    
void GrowVectorint num )
    {
        if ( 
m_Size num m_Memory.NumAllocated() )
            
m_Memory.Growm_Size num m_Memory.NumAllocated() );
 
        
m_Size += num;
        
ResetDbgInfo();
    }
 
    
void ShiftElementsRightint elemint num )
    {
        
int numToMove m_Size elem num;
        if ( ( 
numToMove ) && ( num ) )
            
memmove( &Elementelem num ), &Elementelem ), numToMove sizeof) );
    }
 
    
CAllocator m_Memory;
    
int m_Size;
 
    
Tm_pElements;
 
    
inline void ResetDbgInfo()
    {
        
m_pElements Base();
    }
}; 
And my KeyValues class:
PHP Code:
Code:
class 
KeyValues
{
public:
    
KeyValues( const charsetName )
    {
        
reinterpret_cast<void__thiscall* )( PVOID, const char* )>( g_Offsets.dwKeyValuesConstructor )( thissetName );
    }
 
    
bool LoadFromFileDWORD filesystem, const charresourceName, const charpathID NULLDWORD pfnEvaluateSymbolProc NULL )
    {
        return 
reinterpret_cast<bool__thiscall* )( PVOIDDWORD, const char*, const char*, DWORD )>( g_Offsets.dwKeyValuesLoadFromFile )( thisfilesystem filesystem NULLresourceNamepathIDpfnEvaluateSymbolProc );
    }
 
    
KeyValuesFindKey( const charkeyNamebool bCreate false )
    {
        return 
reinterpret_cast<KeyValues*( __thiscall* )( PVOID, const char*, bool )>( g_Offsets.dwKeyValuesFindKey )( thiskeyNamebCreate );
    }
 
    
void SetInt( const charkeyNameint value )
    {
        
KeyValuesdat FindKeykeyNametrue );
 
        if ( 
dat )
        {
            
dat->m_iValue value;
            
dat->m_iDataType TYPE_INT;
        }
    }
 
    
void SetFloat( const charkeyNamefloat value )
    {
        
KeyValuesdat FindKeykeyNametrue );
 
        if ( 
dat )
        {
            
dat->m_flValue value;
            
dat->m_iDataType TYPE_FLOAT;
        }
    }
 
    
PVOID operator new( size_t iAllocSize )
    {
        return 
getvfunc<PVOID__thiscall* )( PVOIDsize_t )>( KeyValuesSystem(), )( KeyValuesSystem(), iAllocSize );
    }
 
    
void operator deletePVOID pMem )
    {
        
getvfunc<void__thiscall* )( PVOIDPVOID )>( KeyValuesSystem(), )( KeyValuesSystem(), pMem );
    }
 
    
enum types_t
    
{
        
TYPE_NONE 0,
        
TYPE_STRING,
        
TYPE_INT,
        
TYPE_FLOAT,
        
TYPE_PTR,
        
TYPE_WSTRING,
        
TYPE_COLOR,
        
TYPE_UINT64,
        
TYPE_COMPILED_INT_BYTE,
        
TYPE_COMPILED_INT_0,
        
TYPE_COMPILED_INT_1,
        
TYPE_NUMTYPES,
    };
    
//types_t GetDataType( const char *keyName = NULL );
 
    
enum MergeKeyValuesOp_t
    
{
        
MERGE_KV_ALL,
        
MERGE_KV_UPDATE,
        
MERGE_KV_DELETE,
        
MERGE_KV_BORROW
    
};
    
void MergeFromKeyValueskvMergeMergeKeyValuesOp_t eOp MERGE_KV_ALL )
    {
        
reinterpret_cast<void__thiscall* )( PVOIDKeyValues*, MergeKeyValuesOp_t )>( g_Offsets.dwKeyValuesMergeFrom )( thiskvMergeeOp );
    }
 
private:
    static 
PVOID KeyValuesSystem()
    {
        return 
reinterpret_cast<PVOID__cdecl* )( )>( g_Offsets.dwKeyValuesKeyValuesSystem )( );
    }
 
    
DWORD m_iKeyName 24;
    
DWORD m_iKeyNameCaseSensitive1 8;
 
    
charm_sValue;
    
wchar_tm_wsValue;
 
    
union
    
{
        
int m_iValue;
        
float m_flValue;
        
PVOID m_pValue;
        
BYTE m_Color[4];
    };
 
    
char m_iDataType;
    
char m_bHasEscapeSequences;
    
WORD m_iKeyNameCaseSensitive2;
 
    
KeyValuesm_pPeer;
    
KeyValuesm_pSub;
    
KeyValuesm_pChain;
 
    
DWORD pad0// cba to figure out if it's at the bottom of the class or somewhere else. it works, i don't care.
}; 
Grabbing a C_EconItemView:
PHP Code:
Code:
C_EconItemViewC_BaseCombatWeapon::GetEconItemView()
{
    
PVOID pSomething this g_Offsets.dwGetEconItemViewSomething// currently 0x2D60
    
return getvfunc<C_EconItemView*( __thiscall* )( PVOID )>( pSomething)( pSomething ) + 64;

I found that 0x2D60 by reversing C_BaseCombatWeapon::ApplyThirdPersonStickers( search for sticker_a ) but you can find it by looking at most calls to C_EconItemView::GetItemDefinition.

Now, once you have all of this set up you can play around with my GenerateStickerMaterials function.
You can make it take a iStickerID argument. Maybe also some fWearProgress, fPatternScale and fPatternRotation arguments ( I didn't play with those much, you should try to. Setting fWearProgress < 0.f and > 1.f seems to make the sticker brighter and darker. fPatternScale does what it's name says, it scales the pattern. fPatternRotation uses degrees and not radians )

Example:
PHP Code:
Code:
struct StickerInfo
{
    
int iStickerID;
    
float fWearProgress;
    
float fPatternScale;
    
float fPatternRotation
}
 
void GenerateStickerMaterials( const std::vector<StickerInfo>& vStickers )
{
    
int iSupportedStickerSlots vStickers.size();
    
    
m_vStickerMaterialReferences.RemoveAll();
    
    
CUnknownpUnknown reinterpret_cast<CUnknown*>( this 0xC );
    for ( 
int i 0iSupportedStickerSlots; ++)
    {
        
StickerInfo si vStickers[i];
        
        
int iStickerID si.iStickerID;
        
float fWearProgress si.fWearProgress;
        
float fPatternScale si.fPatternScale
        float fPatternRotation 
si.fPatternRotation;
        
        const 
charpszStickerSlotMaterial pItemDefinition->GetStickerSlotMaterialBySlotIndex);
        if ( !
pszStickerSlotMaterial || !pszStickerSlotMaterial[0] )
            continue;
        
        
char szWeaponDecal[32];
        
V_FileBaseszWeaponDecalpszStickerSlotMaterial32 );
        
        
CStickerKitpSK reinterpret_cast<CCStrike15ItemSystem*>( GetItemSchema() + )->GetStickerKitDefinitioniStickerID );
        if ( !
pSK )
            continue;
        
        if ( !
pSK->sticker_material.m_iLength )
            continue;
        
        if ( !
pSK->sticker_material.m_pszString || !pSK->sticker_material.m_pszString[0] )
            continue;
        
        
char szPath[MAX_PATH];
        if ( 
pSK->bCustomStickerMaterial // Doesn't seem to be set to true for any of the stickers currently in-game. Used for the people that want to get their stickers in the Workshop?
            
V_snprintfszPathsizeof szPath"%s"pSK->sticker_material.m_pszString );
        else
            
V_snprintfszPathsizeof szPath"materials/models/weapons/customization/stickers/%s.vmt"pSK->sticker_material.m_pszString );
        
        
char szHash[32];
        
V_snprintfszHashsizeof szHash"%f_%f_%f"fPatternRotationfPatternScalefWearProgress );
        
unsigned uHash HashStringCaselessszHash );
        
        
char szMaterialName1st[128]; V_snprintfszMaterialName1stsizeof szMaterialName1st"sticker_%s_%s_%i_1st"szWeaponDecalpSK->sticker_material.m_pszStringuHash );
        
char szMaterialName3rd[128]; V_snprintfszMaterialName3rdsizeof szMaterialName3rd"sticker_%s_%s_%i_3rd"szWeaponDecalpSK->sticker_material.m_pszStringuHash );
        
        
CMaterialpFirstPersonMaterial materials->FindProceduralMaterialszMaterialName1st"Other textures");
        
CMaterialpThirdPersonMaterial materials->FindProceduralMaterialszMaterialName3rd"Other textures");
        
        if ( 
pFirstPersonMaterial->IsErrorMaterial() || pThirdPersonMaterial->IsErrorMaterial() )
        {
            
KeyValueskv = new KeyValues"vmt" );
            if ( 
kv->LoadFromFileg_pFullFileSystem /* + 4*/szPath"GAME") )
            {
                
kv->SetFloat"$wearprogress"fWearProgress );
                
kv->SetFloat"$patternrotation"fPatternRotation );
                
kv->SetFloat"$patternscale"fPatternScale );
                
                if ( 
pFirstPersonMaterial->IsErrorMaterial() )
                {
                    
KeyValueskv2 = new KeyValues"vmt" );
                    if ( 
kv2->LoadFromFileg_pFullFileSystem /* + 4*/pszStickerSlotMaterial"GAME") )
                    {
                        if ( !
cl_righthand->GetInt() )
                            
kv2->SetInt"$mirrorhorizontal");
                        
                        
kv2->MergeFromkvKeyValues::MERGE_KV_UPDATE );
                        
                        
char szPath[MAX_PATH];
                        
V_snprintfszPathsizeof szPath"materials/models/weapons/customization/stickers/default/sticker_proxies_%i.vmt");
                        
                        
KeyValueskv3 = new KeyValues"vmt" );
                        if ( 
kv3->LoadFromFile g_pFullFileSystem /* + 4*/szPath"GAME")
                            
kv2->MergeFromkv3KeyValues::MERGE_KV_UPDATE );
                        
                        
pFirstPersonMaterial materials->CreateMaterialszMaterialName1stkv2 );
                        
pFirstPersonMaterial->Refresh();
                        
                        
delete kv3;
                    }
                    
                    
delete kv2;
                }
                
                if ( 
pThirdPersonMaterial->IsErrorMaterial() )
                {
                    
KeyValueskv2 = new KeyValues"WeaponDecal" );
                    
                    
kv2->MergeFromkvKeyValues::MERGE_KV_UPDATE );
                    
kv2->SetInt"$thirdperson");
                    
                    
pThirdPersonMaterial materials->CreateMaterialszMaterialName3rdkv2 );
                    
pThirdPersonMaterial->Refresh();
                    
                    
//delete kv2; - I spent ~1 fucking day trying to figure out what was causing the fucking crash just to see all I have to do is comment 1 line. Why do I have to do this? I don't know and I don't want to fucking know. fuck fucking fuck. I hope you understand I'm mad. fuck.
                
}
            }
            
            
delete kv;
        }
        
        
stickerMaterialReference_tstickerMaterialReference = &m_vStickerMaterialReferences[m_vStickerMaterialReferences.AddToTail()];
        
stickerMaterialReference->FirstPerson.InitpFirstPersonMaterial );
        
stickerMaterialReference->ThirdPerson.InitpThirdPersonMaterial );
        
stickerMaterialReference->iPosition i;
    }

Here are some dumps wich might help you:
Sticker Materials & IDs:
-> [ 3DMAX (Foil) | Katowice 2014 ] | emskatowice2014/3dmax_foil | [83]
-> [ 3DMAX (Foil) | Katowice 2015 ] | eslkatowice2015/3dmax_foil | [288]
-> [ 3DMAX (Gold) | DreamHack 2014 ] | dhw2014/3dmax_gold | [237]
-> [ 3DMAX (Gold) | Katowice 2015 ] | eslkatowice2015/3dmax_gold | [289]
-> [ 3DMAX (Holo) | Katowice 2014 ] | emskatowice2014/3dmax_holo | [49]
-> [ 3DMAX (Holo) | Katowice 2015 ] | eslkatowice2015/3dmax_holo | [287]
-> [ 3DMAX | DreamHack 2014 ] | dhw2014/3dmax | [232]
-> [ 3DMAX | Katowice 2014 ] | emskatowice2014/3dmax | [48]
-> [ 3DMAX | Katowice 2015 ] | eslkatowice2015/3dmax | [286]
-> [ Aces High ] | standard/aces_high | [14]
-> [ Aces High (Holo) ] | standard/aces_high_holo | [15]
-> [ adreN (Foil) | Cluj-Napoca 2015 ] | cluj2015/sig_adren_foil | [837]
-> [ adreN (Gold) | Cluj-Napoca 2015 ] | cluj2015/sig_adren_gold | [838]
......

What you can use instead of that szWeaponDecal and pszStickerSlotMaterial:

[ weapon_tec9 ]
-> pist_tec9_decal_a | materials/models/weapons/customization/pist_tec9/pist_tec9_decal_a.vmt
-> pist_tec9_decal_b | materials/models/weapons/customization/pist_tec9/pist_tec9_decal_b.vmt
-> pist_tec9_decal_c | materials/models/weapons/customization/pist_tec9/pist_tec9_decal_c.vmt
-> pist_tec9_decal_d | materials/models/weapons/customization/pist_tec9/pist_tec9_decal_d.vmt
[ weapon_ak47 ]
-> rif_ak47_decal_a | materials/models/weapons/customization/rif_ak47/rif_ak47_decal_a.vmt
-> rif_ak47_decal_b | materials/models/weapons/customization/rif_ak47/rif_ak47_decal_b.vmt
-> rif_ak47_decal_c | materials/models/weapons/customization/rif_ak47/rif_ak47_decal_c.vmt
-> rif_ak47_decal_d | materials/models/weapons/customization/rif_ak47/rif_ak47_decal_d.vmt
[ weapon_m4a1 ]
-> rif_m4a1_decal_a | materials/models/weapons/customization/rif_m4a1/rif_m4a1_decal_a.vmt
-> rif_m4a1_decal_b | materials/models/weapons/customization/rif_m4a1/rif_m4a1_decal_b.vmt
-> rif_m4a1_decal_c | materials/models/weapons/customization/rif_m4a1/rif_m4a1_decal_c.vmt
-> rif_m4a1_decal_d | materials/models/weapons/customization/rif_m4a1/rif_m4a1_decal_d.vmt
[ weapon_sawedoff ]
-> shot_sawedoff_decal_a | materials/models/weapons/customization/shot_sawedoff/shot_sawedoff_decal_a.vmt
-> shot_sawedoff_decal_b | materials/models/weapons/customization/shot_sawedoff/shot_sawedoff_decal_b.vmt
.....
m0b is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 06-25-2020 , 19:55   Re: [REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)
Reply With Quote #3

There are private versions by several people, maybe one day someone will release public. Wheres the code from, the leak?
__________________
Silvers is offline
m0b
New Member
Join Date: Jun 2020
Old 06-25-2020 , 21:31   Re: [REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)
Reply With Quote #4

Quote:
Originally Posted by Silvers View Post
There are private versions by several people, maybe one day someone will release public. Wheres the code from, the leak?
this code from FuckFace32 ,
he posted it on unknowncheats
m0b is offline
m0b
New Member
Join Date: Jun 2020
Old 07-01-2020 , 19:10   Re: [REQ][CSGO][PAID] Plugin Weapon Stickers (!stickers)
Reply With Quote #5

ok guys, i found a possible way to solve the problem

need a hooks for the method GetStickerAttributeBySlotIndexFloat (
to set sticker wear) and GetStickerAttributeBySlotIndexInt (to set stickerID).

how is it easiest to do ? need to write an extension?


PHP Code:
 
enum EStickerAttributeType
{
    
StickerID,
    
WearProgress,
    
PatternScale,
    
PatternRotation
}; 
E.g.1
PHP Code:
float Hooks::GetStickerAttributeBySlotIndexFloat(voidthisptrvoid*, int slotEStickerAttributeType attributefloat unknown)
{
    switch(
attribute)
    {
        case 
EStickerAttributeType::Wear:
            return 
FLT_MIN;
        case 
EStickerAttributeType::Scale:
            return 
1.f;
        case 
EStickerAttributeType::Rotation:
            return 
0.f;
        default:
            break;
    }
    return 
stickerVMT->GetOriginalMethod<GetStickerAttributeBySlotIndexFloatFn>(4)(thisptrnullptrslotattributeunknown);
}
 
unsigned int Hooks::GetStickerAttributeBySlotIndexInt(voidthisptrvoid*, int slotEStickerAttributeType attributeunsigned unknown) {
 
    switch(
attribute)
    {
        case 
EStickerAttributeType::Index:
            return 
83;  // set 3DMAX (Foil) Katowice 2014 for all slots, or use switch (slot) {case 0: ...}             
        
default:
            break;
    }
 
    return 
stickerVMT->GetOriginalMethod<GetStickerAttributeBySlotIndexIntFn>(5)(thisptrnullptrslotattributeunknown);
}

void ApplyStickerHooks(C_BaseAttributableItemitem)
{
    if(!
s_iwoff)
        
s_iwoff NetVarManager::Get().GetOffset(FnvHash("CEconEntity->m_Item")) + 0x18;
 
    
void**& iw_vt = *reinterpret_cast<void***>(uintptr_t(item) + s_iwoff);
 
    static 
void** iw_hook_vt nullptr;
 
    if(!
iw_hook_vt)
    {
        
size_t len 0;
 
        while(
iw_vt[len])
            ++
len;
 
        
iw_hook_vt = new void*[len];
        
memcpy(iw_hook_vtiw_vtlen sizeof(void*));
        
o_float_fn iw_hook_vt[5];
        
iw_hook_vt[5] = &hooked_float_fn;
        
o_uint_fn iw_hook_vt[6];
        
iw_hook_vt[6] = &hooked_uint_fn;
    }
 
    
iw_vt iw_hook_vt;

E.g. 2
PHP Code:
static uint16_t s_econ_item_interface_wrapper_offset 0;

static 
voidoGetStickerAttributeBySlotIndexFloat;

static 
float __fastcall GetStickerAttributeBySlotIndexFloat(voidthisptrvoid*, int slotEStickerAttributeType attributefloat fl)
{
    switch (
attribute)
    {
    case 
EStickerAttributeType::Wear:
        return 
FLT_MIN;
    case 
EStickerAttributeType::Scale:
        return 
1.f;
    case 
EStickerAttributeType::Rotation:
        return 
0.f;
    }

    return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexFloat)*>(oGetStickerAttributeBySlotIndexFloat)(thisptrnullptrslotattributefl);
}

static 
voidoGetStickerAttributeBySlotIndexInt;

static 
unsigned int __fastcall GetStickerAttributeBySlotIndexInt(voidthisptrvoid*, int slotEStickerAttributeType attributeunsigned fl)
{
    
auto item reinterpret_cast<CBaseAttributableItem*>(uintptr_t(thisptr) - s_econ_item_interface_wrapper_offset);

    if (!
item)
    {
        return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexInt)*>(oGetStickerAttributeBySlotIndexInt)(thisptrnullptrslotattributefl);
    }

    
int weaponId item->GetItemDefinitionIndex();

    if (
weaponId == 0)
    {
        return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexInt)*>(oGetStickerAttributeBySlotIndexInt)(thisptrnullptrslotattributefl);
    }

    switch (
attribute)
    {
        case 
EStickerAttributeType::Index:
        {
            
SkinInfo skinfo Skinchanger2::singleton()->GetSkinInfoForWeapon(weaponId);
            switch (
slot)
            {
            case 
0:
                if (
skinfo.stickerId1 != -1)
                    return 
skinfo.stickerId1;
                break;
            case 
1:
                if (
skinfo.stickerId2 != -1)
                    return 
skinfo.stickerId2;
                break;
            case 
2:
                if (
skinfo.stickerId3 != -1)
                    return 
skinfo.stickerId3;
                break;
            case 
3:
                if (
skinfo.stickerId4 != -1)
                    return 
skinfo.stickerId4;
                break;
            }
            break;
        }
    }

    return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexInt)*>(oGetStickerAttributeBySlotIndexInt)(thisptrnullptrslotattributefl);
}

void ApplyStickerHooks(CBaseAttributableItemitem)
{
    if (!
s_econ_item_interface_wrapper_offset)
        
s_econ_item_interface_wrapper_offset NetVarManager->GetOffset(XorStr("DT_EconEntity"), XorStr("m_Item")) + 0xC;

    if (!
item)
        return;

    
void**& vmt = *reinterpret_cast<void***>(uintptr_t(item) + s_econ_item_interface_wrapper_offset);

    static 
void** hooked_vmt nullptr;

    if (!
hooked_vmt)
    {
        
size_t size 0;

        while (
MiscFunctions::IsCodePtr(vmt[size]))
            ++
size;

        
hooked_vmt = new void*[size];
        
memcpy(hooked_vmtvmtsize sizeof(void*));

        
oGetStickerAttributeBySlotIndexFloat hooked_vmt[4];

        
hooked_vmt[4] = reinterpret_cast<void*>(&GetStickerAttributeBySlotIndexFloat);

        
oGetStickerAttributeBySlotIndexInt hooked_vmt[5];

        
hooked_vmt[5] = reinterpret_cast<void*>(&GetStickerAttributeBySlotIndexInt);
    }

    
vmt hooked_vmt;

e.g.3
PHP Code:

enum 
class EStickerAttributeType
{
    
Index,
    
Wear,
    
Scale,
    
Rotation
};

static 
uint16_t s_econ_item_interface_wrapper_offset 0;

namespace 
StickerHooks
{
    static 
voidoGetStickerAttributeBySlotIndexFloat;

    static 
float __fastcall GetStickerAttributeBySlotIndexFloat(voidthisptrvoid*, int slotEStickerAttributeType attributefloat unknown)
    {
        
auto pItem reinterpret_cast<C_BaseAttributableItem*>(uintptr_t(thisptr) - s_econ_item_interface_wrapper_offset);

        
auto nWeaponIndex pItem->m_iItemDefinitionIndex();

        if (
Skinchanger::Get().WeaponCfg.find(nWeaponIndex) != Skinchanger::Get().WeaponCfg.end())
        {
            switch (
attribute)
            {
                case 
EStickerAttributeType::Wear:
                    return 
Skinchanger::Get().WeaponCfg[nWeaponIndex].stickers[slot].flWear;
                case 
EStickerAttributeType::Scale:
                    return 
Skinchanger::Get().WeaponCfg[nWeaponIndex].stickers[slot].flScale;
                case 
EStickerAttributeType::Rotation:
                    return 
Skinchanger::Get().WeaponCfg[nWeaponIndex].stickers[slot].flRotation;
                default:
                    break;
            }
        }

        return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexFloat)*>(oGetStickerAttributeBySlotIndexFloat)(thisptrnullptrslotattributeunknown);
    }

    static 
voidoGetStickerAttributeBySlotIndexInt;

    static 
unsigned int __fastcall GetStickerAttributeBySlotIndexInt(voidthisptrvoid*, int slotEStickerAttributeType attributeunsigned unknown)
    {
        
auto pItem reinterpret_cast<C_BaseAttributableItem*>(uintptr_t(thisptr) - s_econ_item_interface_wrapper_offset);

        if (
attribute == EStickerAttributeType::Index)
        {
            
auto nWeaponIndex pItem->m_iItemDefinitionIndex();

            if(
Skinchanger::Get().WeaponCfg.find(nWeaponIndex) != Skinchanger::Get().WeaponCfg.end())
                return 
Skinchanger::Get().WeaponCfg[nWeaponIndex].stickers[slot].nIndex;
        }

        return 
reinterpret_cast<decltype(GetStickerAttributeBySlotIndexInt)*>(oGetStickerAttributeBySlotIndexInt)(thisptrnullptrslotattributeunknown);
    }
}

void Skinchanger::ApplyStickerHooks(C_BaseAttributableItemitem)
{
    if (!
s_econ_item_interface_wrapper_offset)
        
s_econ_item_interface_wrapper_offset NetvarSys::Get().GetOffset("DT_EconEntity""m_Item") + 0xC;

    
void**& vmt = *reinterpret_cast<void***>(uintptr_t(item) + s_econ_item_interface_wrapper_offset);

    static 
void** hooked_vmt nullptr;

    if (!
hooked_vmt)
    {
        
size_t size 0;

        while (
Utilities::IsCodePtr(vmt[size]))
            ++
size;

        
hooked_vmt = new void*[size];
        
memcpy(hooked_vmtvmtsize sizeof(void*));

        
StickerHooks::oGetStickerAttributeBySlotIndexFloat hooked_vmt[4];
        
hooked_vmt[4] = reinterpret_cast<void*>(&StickerHooks::GetStickerAttributeBySlotIndexFloat);

        
StickerHooks::oGetStickerAttributeBySlotIndexInt hooked_vmt[5];
        
hooked_vmt[5] = reinterpret_cast<void*>(&StickerHooks::GetStickerAttributeBySlotIndexInt);
    }

    
vmt hooked_vmt;


Last edited by m0b; 07-02-2020 at 21:49.
m0b 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 19:08.


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