added changer

This commit is contained in:
_or_75
2026-05-08 13:05:49 +03:00
parent d9c88173c1
commit 00f3843992
20 changed files with 1785 additions and 353 deletions
@@ -22,6 +22,7 @@
#include <CS2/Hook/Hook_UpdateInPVS.hpp>
#include <CS2/Hook/Hook_AntiTamper.hpp>
#include <CS2/Hook/Hook_IsLoadoutAllowed.hpp>
#include <CS2/Hook/Hook_EquipItemInLoadout.hpp>
static CHook_Loader g_CHook_Loader{};
@@ -74,7 +75,8 @@ auto CHook_Loader::InstallSecondHook() -> bool
// he is no longer needed
//{ { XorStr( "Hook::UpdateInPVS" ) , XorStr( "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 8B F2 48 8B 89 ? ? ? ? 48 8B 01 FF 50 ? 33 FF 48 85 C0 74 ? 48 8B 80 ? ? ? ? EB ? 48 8B C7 39 B8 ? ? ? ? 0F 8F ? ? ? ? 0F B6 48 ? 80 F9" ) , CLIENT_DLL } , &Hook_UpdateInPVS , reinterpret_cast<LPVOID*>( &UpdateInPVS_o ) },
{ { XorStr( "Hook::AntiTamper" ) , XorStr( "40 53 41 57 48 83 EC ? 48 89 74 24 ? 48 8B F1" ) , CLIENT_DLL } , &Hook_AntiTamper , reinterpret_cast<LPVOID*>( &AntiTamper_o ) },
{ {XorStr("Hook::IsLoadoutAllowed") , XorStr("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B E9 48 8B 0D ? ? ? ? ? ? ? FF 50") , CLIENT_DLL } ,&Hook_IsLoadoutAllowed , reinterpret_cast<LPVOID*>(&IsLoadoutAllowed_o) , true , true }
{ {XorStr("Hook::IsLoadoutAllowed") , XorStr("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B E9 48 8B 0D ? ? ? ? ? ? ? FF 50") , CLIENT_DLL } ,&Hook_IsLoadoutAllowed , reinterpret_cast<LPVOID*>(&IsLoadoutAllowed_o) , true , true } ,
{ { XorStr( "Hook::EquipItemInLoadout" ) , XorStr( "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 89 54 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC ? 0F B7 FA" ) , CLIENT_DLL } ,& Hook_EquipItemInLoadout , reinterpret_cast<LPVOID*>( &EquipItemInLoadout_o ) },
};
return InstallHooks();
@@ -0,0 +1,10 @@
#include "Hook_EquipItemInLoadout.hpp"
#include <AndromedaClient/Features/CInventoryChanger/CInventoryChanger.hpp>
auto Hook_EquipItemInLoadout( CCSInventoryManager* pManager , int iTeam , int iSlot , uint64_t iItemID ) -> void
{
GetInventoryChanger()->OnEquipItemInLoadout( iTeam , iSlot , iItemID );
EquipItemInLoadout_o( pManager , iTeam , iSlot , iItemID );
}
@@ -0,0 +1,8 @@
#pragma once
#include <CS2/SDK/Cstrike15/CCSInventoryManager.hpp>
using EquipItemInLoadout_t = void( __fastcall* )( CCSInventoryManager* , int , int , uint64_t );
inline EquipItemInLoadout_t EquipItemInLoadout_o = nullptr;
auto Hook_EquipItemInLoadout( CCSInventoryManager* pManager , int iTeam , int iSlot , uint64_t iItemID ) -> void;
@@ -1,6 +1,7 @@
#include "Hook_SOCacheSubscribed.hpp"
#include <CS2/SDK/Cstrike15/CCSPlayerInventory.hpp>
#include <AndromedaClient/Features/CInventoryChanger/CInventoryItemsManager.hpp>
auto Hook_SOCacheSubscribed( CCSPlayerInventory* pCSPlayerInventory , GCSDK::SOID_t owner , int64_t unk ) -> void*
{
@@ -8,7 +9,7 @@ auto Hook_SOCacheSubscribed( CCSPlayerInventory* pCSPlayerInventory , GCSDK::SOI
if ( pCSPlayerInventory->GetOwner().m_type == owner.m_type && pCSPlayerInventory->GetOwner().m_id == owner.m_id )
{
GetInventoryItemsManager()->OnAddAllItems();
}
return pResult;
@@ -70,6 +70,7 @@ auto CFunctionList::OnInit() -> bool
&CCSGO_HudWeaponSelection_ClearHudWeaponIcon,
&C_BaseEntity_GetHitBoxSet,
&C_BaseEntity_UpdateBodyGroupChoice,
&C_EconItemView_set_attribute_value_by_name,
};
auto Searched = true;
@@ -142,6 +142,7 @@ public:
CBasePattern CCSGO_HudWeaponSelection_ClearHudWeaponIcon = { VmpStr( "CCSGO_HudWeaponSelection::ClearHudWeaponIcon" ) , VmpStr( "E8 ? ? ? ? 8B F8 C6 84 24" ) , CLIENT_DLL , 0 , SEARCH_TYPE_CALL };
CBasePattern C_BaseEntity_GetHitBoxSet = { VmpStr( "C_BaseEntity::GetHitBoxSet" ) , VmpStr( "48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 8B DA 48 8B F9 E8 ? ? ? ? 48 8B F0" ) , CLIENT_DLL , 0 , SEARCH_TYPE_NONE };
CBasePattern C_BaseEntity_UpdateBodyGroupChoice = { VmpStr( "C_BaseEntity::UpdateBodyGroupChoice" ) , VmpStr( "E8 ? ? ? ? 4C 8B AC 24 ? ? ? ? 48 8B BC 24" ) , CLIENT_DLL , 0 , SEARCH_TYPE_CALL };
CBasePattern C_EconItemView_set_attribute_value_by_name = { VmpStr( "C_EconItemView::set_attribute_value_by_name" ) , VmpStr( "E8 ? ? ? ? 66 41 0F 6E D4" ) , CLIENT_DLL , 0 , SEARCH_TYPE_CALL };
};
@@ -21,6 +21,11 @@ public:
char pad3[0x8]; // no idea
char pad4[0x4]; // no idea
int nRarity;
uint8_t m_use_legacy_model()
{
return *reinterpret_cast<uint8_t*>( (std::uintptr_t)this + 0xAE );
}
};
class CMusicKit
@@ -119,6 +119,7 @@ DECLARATE_CS2_FUNCTION_SDK_FASTCALL( void , CTraceFilter_Constructor , ( CTraceF
DECLARATE_CS2_FUNCTION_SDK_FASTCALL( void , CCSGO_HudWeaponSelection_ClearHudWeaponIcon , ( CCSGO_HudWeaponSelection* pCCSGO_HudWeaponSelection , int unk1 , int64_t unk2 ) , ( CCSGO_HudWeaponSelection* , int , int64_t ) , ( pCCSGO_HudWeaponSelection , unk1 , unk2 ) );
DECLARATE_CS2_FUNCTION_SDK_FASTCALL( CHitBoxSet* , C_BaseEntity_GetHitBoxSet , ( C_BaseEntity* pC_BaseEntity , uint32_t Index = 0 ) , ( C_BaseEntity* , uint32_t ) , ( pC_BaseEntity , Index ) );
DECLARATE_CS2_FUNCTION_SDK_FASTCALL( void , C_BaseEntity_UpdateBodyGroupChoice , ( C_BaseEntity* pC_BaseEntity ) , ( C_BaseEntity* ) , ( pC_BaseEntity ) );
DECLARATE_CS2_FUNCTION_SDK_FASTCALL( void , C_EconItemView_set_attribute_value_by_name , ( C_EconItemView* pC_EconItemView , const char* szAttributeName , float flValue ) , ( C_EconItemView* , const char* , float ) , ( pC_EconItemView , szAttributeName , flValue ) );
// Helpers:
@@ -183,8 +183,7 @@ auto C_BaseEntity::ComputeHitboxSurroundingBox( Vector3& mins , Vector3& maxs )
auto C_BaseEntity::SetBodyGroup() -> void
{
C_BaseEntity_SetBodyGroup( this , m_iTeamNum() == TEAM_TT ? 0 : 1 , 1 );
C_BaseEntity_UpdateBodyGroupChoice( this );
return C_BaseEntity_SetBodyGroup( this , m_iTeamNum() == TEAM_TT ? 0 : 1 , 1 );
}
auto C_BaseEntity::GetBoneIdByName( const char* szName ) -> int
@@ -287,6 +286,11 @@ auto C_EconItemView::GetBasePlayerWeaponVData() -> CCSWeaponBaseVData*
return C_EconItemView_GetBasePlayerWeaponVData( this );
}
auto C_EconItemView::GetCustomPaintKitIndex() -> int
{
return C_EconItemView_GetCustomPaintKitIndex( this );
}
auto C_BaseModelEntity::SetModel( const char* szModel ) -> void
{
return C_BaseModelEntity_SetModel( this , szModel );
@@ -113,13 +113,6 @@ public:
return pBinding;
}
public:
auto PostDataUpdate() -> void
{
VirtualFn( void )( CEntityInstance* , int UpdateType );
return vget< Fn >( this , SDK::VMT_Index::CEntityInstance::PostDataUpdate )( this , 1 );
}
public:
SCHEMA_OFFSET( "CEntityInstance" , "m_pEntity" , pEntityIdentity , CEntityIdentity* );
};
@@ -148,6 +141,13 @@ public:
auto SetMeshGroupMask( uint64_t meshGroupMask ) -> void;
auto GetBonePosition( int32 BoneIndex , Vector3& BonePos ) -> bool;
public:
auto PostDataUpdate() -> void
{
VirtualFn( void )( CGameSceneNode* , int64_t UpdateType , int64_t unk1 );
return vget< Fn >( this , SDK::VMT_Index::CGameSceneNode::PostDataUpdate )( this , 0 , 0 );
}
public:
auto GetSkeletonInstance() -> CSkeletonInstance*
{
@@ -190,6 +190,7 @@ public:
auto GetSOCData() -> CEconItem*;
auto GetStaticData() -> CEconItemDefinition*;
auto GetBasePlayerWeaponVData() -> CCSWeaponBaseVData*;
auto GetCustomPaintKitIndex() -> int;
public:
SCHEMA_OFFSET( "C_EconItemView" , "m_bRestoreCustomMaterialAfterPrecache" , m_bRestoreCustomMaterialAfterPrecache , bool );
@@ -506,6 +507,9 @@ public:
PSCHEMA_OFFSET( "C_EconEntity" , "m_AttributeManager" , m_AttributeManager , C_AttributeContainer );
SCHEMA_OFFSET( "C_EconEntity" , "m_OriginalOwnerXuidLow" , m_OriginalOwnerXuidLow , uint32 );
SCHEMA_OFFSET( "C_EconEntity" , "m_OriginalOwnerXuidHigh" , m_OriginalOwnerXuidHigh , uint32 );
SCHEMA_OFFSET( "C_EconEntity" , "m_nFallbackPaintKit" , m_nFallbackPaintKit , int32 );
SCHEMA_OFFSET( "C_EconEntity" , "m_nFallbackSeed" , m_nFallbackSeed , int32 );
SCHEMA_OFFSET( "C_EconEntity" , "m_flFallbackWear" , m_flFallbackWear , float32 );
inline auto GetOriginalOwnerXuid() -> uint64_t
{
@@ -11,7 +11,7 @@ static constexpr auto g_CompositeMaterialOffset = 0x608;
// 48 8D 58 ? 49 89 4B
static constexpr auto g_CEconItemSchema_GetSortedItemDefinitionMap = 0x128;
static constexpr auto g_CEconItemSchema_GetPaintKits = 0x2E8;
static constexpr auto g_CEconItemSchema_GetPaintKits = 0x2F0;
// E8 ? ? ? ? 48 85 C0 74 ? 48 8B 40 ? 4C 8B C7
/*
@@ -11,8 +11,8 @@ namespace SDK::VMT_Index
{
GetScreenSize = 60 ,
};
enum CEntityInstance : uint32_t
enum CGameSceneNode : uint32_t
{
PostDataUpdate = 10 ,
PostDataUpdate = 22 ,
};
}