添加项目文件。
This commit is contained in:
6
csgo2/native_sdk/cgameentitysystem.cpp
Normal file
6
csgo2/native_sdk/cgameentitysystem.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "cgameentitysystem.h"
|
||||
#include "../pch.h"
|
||||
|
||||
CGameEntitySystem* CGameEntitySystem::GetInstance(){
|
||||
return Offset::InterFaces::GameResourceServiceServer->GetGameEntitySystem();
|
||||
}
|
||||
63
csgo2/native_sdk/cgameentitysystem.h
Normal file
63
csgo2/native_sdk/cgameentitysystem.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
#include "entity/cbaseentity.h"
|
||||
|
||||
#define MAX_ENTITIES_IN_LIST 512
|
||||
#define MAX_ENTITY_LISTS 64
|
||||
#define MAX_TOTAL_ENTITIES MAX_ENTITIES_IN_LIST *MAX_ENTITY_LISTS
|
||||
|
||||
class CEntityIdentity
|
||||
{
|
||||
public:
|
||||
CBaseEntity *entity;
|
||||
void *dunno;
|
||||
int64_t unk0;
|
||||
int64_t unk1;
|
||||
const char *internalName;
|
||||
const char *entityName;
|
||||
void *unk2;
|
||||
void *unk3;
|
||||
void *unk4;
|
||||
void *unk5;
|
||||
CEntityIdentity *prevValid;
|
||||
CEntityIdentity *nextValid;
|
||||
void *unkptr;
|
||||
void *unkptr2;
|
||||
void *unkptr3;
|
||||
};
|
||||
|
||||
class CEntityIdentities
|
||||
{
|
||||
public:
|
||||
CEntityIdentity m_pIdentities[MAX_ENTITIES_IN_LIST];
|
||||
};
|
||||
|
||||
class EntityIdentityList
|
||||
{
|
||||
public:
|
||||
CEntityIdentities *m_pIdentityList;
|
||||
};
|
||||
|
||||
class CGameEntitySystem
|
||||
{
|
||||
public:
|
||||
virtual void n_0();
|
||||
void *unk;
|
||||
CEntityIdentities *m_pEntityList[MAX_ENTITY_LISTS];
|
||||
|
||||
CBaseEntity *GetBaseEntity(int index)
|
||||
{
|
||||
if (index <= -1 || index >= MAX_TOTAL_ENTITIES)
|
||||
return nullptr;
|
||||
|
||||
int listToUse = (index / MAX_ENTITIES_IN_LIST);
|
||||
if (!m_pEntityList[listToUse])
|
||||
return nullptr;
|
||||
|
||||
if (m_pEntityList[listToUse]->m_pIdentities[index % MAX_ENTITIES_IN_LIST].entity)
|
||||
return m_pEntityList[listToUse]->m_pIdentities[index % MAX_ENTITIES_IN_LIST].entity;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static CGameEntitySystem *GetInstance();
|
||||
};
|
||||
12
csgo2/native_sdk/cgameresourceserviceserver.h
Normal file
12
csgo2/native_sdk/cgameresourceserviceserver.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include "../pch.h"
|
||||
class CGameEntitySystem;
|
||||
|
||||
class CGameResourceService
|
||||
{
|
||||
public:
|
||||
CGameEntitySystem *GetGameEntitySystem()
|
||||
{
|
||||
return *reinterpret_cast<CGameEntitySystem **>((uintptr_t)(this) + 0x58);
|
||||
}
|
||||
};
|
||||
13
csgo2/native_sdk/cschemasystem.cpp
Normal file
13
csgo2/native_sdk/cschemasystem.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "cschemasystem.h"
|
||||
|
||||
auto CSchemaSystemTypeScope::FindDeclaredClass(const char* pClass) -> SchemaClassInfoData_t*
|
||||
{
|
||||
SchemaClassInfoData_t* rv = nullptr;
|
||||
CALL_VIRTUAL(void, 2, this, &rv, pClass);
|
||||
return rv;
|
||||
}
|
||||
|
||||
auto CSchemaSystem::FindTypeScopeForModule(const char* module) -> CSchemaSystemTypeScope*
|
||||
{
|
||||
return CALL_VIRTUAL(CSchemaSystemTypeScope*, 13, this, module, nullptr);
|
||||
}
|
||||
77
csgo2/native_sdk/cschemasystem.h
Normal file
77
csgo2/native_sdk/cschemasystem.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#pragma once
|
||||
#include "../pch.h"
|
||||
#include "../vmt.h"
|
||||
|
||||
struct SchemaClassFieldData_t
|
||||
{
|
||||
const char *m_name;
|
||||
char pad0[0x8];
|
||||
short m_offset;
|
||||
char pad1[0xE];
|
||||
};
|
||||
|
||||
class SchemaClassInfoData_t;
|
||||
|
||||
struct SchemaBaseClassInfoData_t
|
||||
{
|
||||
unsigned int m_offset;
|
||||
SchemaClassInfoData_t *m_class;
|
||||
};
|
||||
|
||||
class SchemaClassInfoData_t
|
||||
{
|
||||
public:
|
||||
auto GetName()
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
auto GetFieldsSize()
|
||||
{
|
||||
return m_align;
|
||||
}
|
||||
|
||||
auto GetFields()
|
||||
{
|
||||
return m_fields;
|
||||
}
|
||||
|
||||
auto GetParent()
|
||||
{
|
||||
return m_schema_parent->m_class;
|
||||
}
|
||||
|
||||
private:
|
||||
char pad_0x0000[0x8]; // 0x0000
|
||||
|
||||
const char *m_name; // 0x0008
|
||||
char *m_module; // 0x0010
|
||||
|
||||
int m_size; // 0x0018
|
||||
std::int16_t m_align; // 0x001C
|
||||
|
||||
std::int16_t m_static_size; // 0x001E
|
||||
std::int16_t m_metadata_size; // 0x0020
|
||||
std::int16_t m_i_unk1; // 0x0022
|
||||
std::int16_t m_i_unk2; // 0x0024
|
||||
std::int16_t m_i_unk3; // 0x0026
|
||||
|
||||
SchemaClassFieldData_t *m_fields; // 0x0028
|
||||
|
||||
char pad_0x0030[0x8]; // 0x0030
|
||||
SchemaBaseClassInfoData_t *m_schema_parent; // 0x0038
|
||||
|
||||
char pad_0x0038[0x10]; // 0x0038
|
||||
};
|
||||
|
||||
class CSchemaSystemTypeScope
|
||||
{
|
||||
public:
|
||||
auto FindDeclaredClass(const char* pClass) -> SchemaClassInfoData_t*;
|
||||
};
|
||||
|
||||
class CSchemaSystem
|
||||
{
|
||||
public:
|
||||
auto FindTypeScopeForModule(const char* module) ->CSchemaSystemTypeScope*;
|
||||
};
|
||||
37
csgo2/native_sdk/entity/cbaseentity.h
Normal file
37
csgo2/native_sdk/entity/cbaseentity.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../schema.h"
|
||||
#include "ccollisionproperty.h"
|
||||
#include "../handle/handle.h"
|
||||
#include "../cgameentitysystem.h"
|
||||
class CEntityIdentity;
|
||||
class CEntityInstance {
|
||||
public:
|
||||
DECLARE_CLASS(CEntityInstance);
|
||||
|
||||
auto Schema_DynamicBinding() {
|
||||
SchemaClassInfoData_t* rv = nullptr;
|
||||
CALL_VIRTUAL(void, 0, this, &rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
auto GetRefEHandle() {
|
||||
CHandle handle;
|
||||
CALL_VIRTUAL(void*, 2, this, &handle);
|
||||
return handle;
|
||||
}
|
||||
|
||||
SCHEMA_FIELD(CEntityIdentity*, m_pEntity);
|
||||
SCHEMA_FIELD(const char*, m_designerName);
|
||||
|
||||
};
|
||||
|
||||
class CBaseEntity : CEntityInstance
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CBaseEntity);
|
||||
|
||||
SCHEMA_FIELD(int, m_iHealth)
|
||||
//SCHEMA_FIELD(Vector, m_vecBaseVelocity)
|
||||
SCHEMA_FIELD(CCollisionProperty*, m_pCollision)
|
||||
};
|
||||
24
csgo2/native_sdk/entity/cbaseplayercontroller.h
Normal file
24
csgo2/native_sdk/entity/cbaseplayercontroller.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include "../../pch.h"
|
||||
#include "../handle/handle.h"
|
||||
#include "cbaseentity.h"
|
||||
class CBasePlayerController : public CBaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CBasePlayerController);
|
||||
|
||||
SCHEMA_FIELD(uint64_t, m_steamID)
|
||||
SCHEMA_FIELD(CHandle, m_hPawn)
|
||||
SCHEMA_FIELD(char, m_iszPlayerName)
|
||||
|
||||
};
|
||||
|
||||
class CCSPlayerController : public CBasePlayerController {
|
||||
public:
|
||||
DECLARE_CLASS(CCSPlayerController)
|
||||
|
||||
SCHEMA_FIELD(uint32_t, m_iPawnHealth)
|
||||
SCHEMA_FIELD(bool, m_bPawnIsAlive)
|
||||
SCHEMA_FIELD(const char*, m_szClanName)
|
||||
|
||||
};
|
||||
14
csgo2/native_sdk/entity/cbaseplayerpawn.h
Normal file
14
csgo2/native_sdk/entity/cbaseplayerpawn.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "cbaseentity.h"
|
||||
#include "services.h"
|
||||
|
||||
class CBasePlayerPawn : public CBaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CBasePlayerPawn);
|
||||
|
||||
SCHEMA_FIELD(CPlayer_MovementServices*, m_pMovementServices)
|
||||
SCHEMA_FIELD(uint8*, m_pWeaponServices)
|
||||
SCHEMA_FIELD(uint8**, m_pItemServices)
|
||||
};
|
||||
21
csgo2/native_sdk/entity/ccollisionproperty.h
Normal file
21
csgo2/native_sdk/entity/ccollisionproperty.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include "../../pch.h"
|
||||
#include "../../schema.h"
|
||||
|
||||
struct VPhysicsCollisionAttribute_t
|
||||
{
|
||||
DECLARE_CLASS(VPhysicsCollisionAttribute_t)
|
||||
|
||||
SCHEMA_FIELD(uint8_t, m_nCollisionGroup)
|
||||
};
|
||||
|
||||
class CCollisionProperty
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CCollisionProperty)
|
||||
|
||||
SCHEMA_FIELD(VPhysicsCollisionAttribute_t, m_collisionAttribute)
|
||||
//SCHEMA_FIELD(SolidType_t, m_nSolidType)
|
||||
SCHEMA_FIELD(uint8_t, m_usSolidFlags)
|
||||
SCHEMA_FIELD(uint8_t, m_CollisionGroup)
|
||||
};
|
||||
12
csgo2/native_sdk/entity/ccsplayercontroller.h
Normal file
12
csgo2/native_sdk/entity/ccsplayercontroller.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "cbaseplayercontroller.h"
|
||||
#include "services.h"
|
||||
|
||||
class CCSPlayerController : public CBasePlayerController
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CCSPlayerController);
|
||||
|
||||
SCHEMA_FIELD(CCSPlayerController_InGameMoneyServices*, m_pInGameMoneyServices)
|
||||
};
|
||||
9
csgo2/native_sdk/entity/ccsplayerpawn.h
Normal file
9
csgo2/native_sdk/entity/ccsplayerpawn.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "cbaseplayerpawn.h"
|
||||
|
||||
class CCSPlayerPawn : public CBasePlayerPawn
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CCSPlayerPawn);
|
||||
};
|
||||
18
csgo2/native_sdk/entity/services.h
Normal file
18
csgo2/native_sdk/entity/services.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include <platform.h>
|
||||
|
||||
#include "../schema.h"
|
||||
|
||||
class CPlayer_MovementServices
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CPlayer_MovementServices);
|
||||
};
|
||||
|
||||
class CCSPlayerController_InGameMoneyServices
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(CCSPlayerController_InGameMoneyServices);
|
||||
|
||||
SCHEMA_FIELD(int, m_iAccount)
|
||||
};
|
||||
11
csgo2/native_sdk/handle/handle.cpp
Normal file
11
csgo2/native_sdk/handle/handle.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "handle.h"
|
||||
#include "../cgameentitysystem.h"
|
||||
|
||||
CBaseEntity* CHandle::GetBaseEntity() const
|
||||
{
|
||||
CGameEntitySystem* pEntitySystem = CGameEntitySystem::GetInstance();
|
||||
if (!pEntitySystem)
|
||||
return nullptr;
|
||||
|
||||
return pEntitySystem->GetBaseEntity(GetEntryIndex());
|
||||
}
|
||||
26
csgo2/native_sdk/handle/handle.h
Normal file
26
csgo2/native_sdk/handle/handle.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#define INVALID_EHANDLE_INDEX 0xFFFFFFFF
|
||||
#define ENT_ENTRY_MASK 0x7FFF
|
||||
|
||||
class CBaseEntity;
|
||||
|
||||
class CHandle
|
||||
{
|
||||
CBaseEntity* GetBaseEntity() const;
|
||||
|
||||
public:
|
||||
bool operator==(CHandle rhs) const { return m_Index == rhs.m_Index; }
|
||||
|
||||
bool IsValid() const { return m_Index != INVALID_EHANDLE_INDEX; }
|
||||
|
||||
int GetEntryIndex() const { return m_Index & ENT_ENTRY_MASK; }
|
||||
|
||||
template <typename T = CBaseEntity>
|
||||
T* Get() const
|
||||
{
|
||||
return reinterpret_cast<T*>(GetBaseEntity());
|
||||
}
|
||||
|
||||
uint32_t m_Index;
|
||||
};
|
||||
Reference in New Issue
Block a user