mirror of
https://github.com/a2x/cs2-dumper.git
synced 2026-04-18 02:09:58 +08:00
Refactor and move Linux code to separate branch
This commit is contained in:
21
src/source2/schema_system/mod.rs
Normal file
21
src/source2/schema_system/mod.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
pub use schema_base_class_info_data::*;
|
||||
pub use schema_class_field_data::*;
|
||||
pub use schema_class_info_data::*;
|
||||
pub use schema_enum_info_data::*;
|
||||
pub use schema_enumerator_info_data::*;
|
||||
pub use schema_metadata_entry_data::*;
|
||||
pub use schema_static_field_data::*;
|
||||
pub use schema_system::*;
|
||||
pub use schema_system_type_scope::*;
|
||||
pub use schema_type::*;
|
||||
|
||||
pub mod schema_base_class_info_data;
|
||||
pub mod schema_class_field_data;
|
||||
pub mod schema_class_info_data;
|
||||
pub mod schema_enum_info_data;
|
||||
pub mod schema_enumerator_info_data;
|
||||
pub mod schema_metadata_entry_data;
|
||||
pub mod schema_static_field_data;
|
||||
pub mod schema_system;
|
||||
pub mod schema_system_type_scope;
|
||||
pub mod schema_type;
|
||||
11
src/source2/schema_system/schema_base_class_info_data.rs
Normal file
11
src/source2/schema_system/schema_base_class_info_data.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::SchemaClassInfoData;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaBaseClassInfoData {
|
||||
pub offset: u32,
|
||||
pub prev: Pointer64<SchemaClassInfoData>,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaBaseClassInfoData {}
|
||||
14
src/source2/schema_system/schema_class_field_data.rs
Normal file
14
src/source2/schema_system/schema_class_field_data.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::{SchemaMetadataEntryData, SchemaType};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaClassFieldData {
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub type_: Pointer64<SchemaType>,
|
||||
pub offset: u32,
|
||||
pub metadata_count: u32,
|
||||
pub metadata: Pointer64<SchemaMetadataEntryData>,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaClassFieldData {}
|
||||
33
src/source2/schema_system/schema_class_info_data.rs
Normal file
33
src/source2/schema_system/schema_class_info_data.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::{
|
||||
SchemaBaseClassInfoData, SchemaClassFieldData, SchemaMetadataEntryData, SchemaStaticFieldData,
|
||||
SchemaSystemTypeScope, SchemaType,
|
||||
};
|
||||
|
||||
pub type SchemaClassBinding = SchemaClassInfoData;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaClassInfoData {
|
||||
pub base: Pointer64<SchemaClassInfoData>,
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub module_name: Pointer64<ReprCString>,
|
||||
pub size: u32,
|
||||
pub fields_count: u16,
|
||||
pub static_fields_count: u16,
|
||||
pub static_metadata_count: u16,
|
||||
pub alignment: u8,
|
||||
pub has_base_class: bool,
|
||||
pub total_class_size: u16,
|
||||
pub derived_class_size: u16,
|
||||
pub fields: Pointer64<SchemaClassFieldData>,
|
||||
pub static_fields: Pointer64<SchemaStaticFieldData>,
|
||||
pub base_classes: Pointer64<SchemaBaseClassInfoData>,
|
||||
pad_0040: [u8; 0x8],
|
||||
pub static_metadata: Pointer64<SchemaMetadataEntryData>,
|
||||
pub type_scope: Pointer64<SchemaSystemTypeScope>,
|
||||
pub type_: Pointer64<SchemaType>,
|
||||
pad_0060: [u8; 0x10],
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaClassInfoData {}
|
||||
22
src/source2/schema_system/schema_enum_info_data.rs
Normal file
22
src/source2/schema_system/schema_enum_info_data.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::{SchemaEnumeratorInfoData, SchemaMetadataEntryData, SchemaSystemTypeScope};
|
||||
|
||||
pub type SchemaEnumBinding = SchemaEnumInfoData;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaEnumInfoData {
|
||||
pub base: Pointer64<SchemaEnumInfoData>,
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub module_name: Pointer64<ReprCString>,
|
||||
pub alignment: u8,
|
||||
pad_0019: [u8; 0x3],
|
||||
pub size: u16,
|
||||
pub static_metadata_count: u16,
|
||||
pub enum_info: Pointer64<SchemaEnumeratorInfoData>,
|
||||
pub static_metadata: Pointer64<SchemaMetadataEntryData>,
|
||||
pub type_scope: Pointer64<SchemaSystemTypeScope>,
|
||||
pad_0038: [u8; 0xC],
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaEnumInfoData {}
|
||||
21
src/source2/schema_system/schema_enumerator_info_data.rs
Normal file
21
src/source2/schema_system/schema_enumerator_info_data.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::SchemaMetadataEntryData;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaEnumeratorInfoData {
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub u: SchemaEnumeratorInfoDataUnion,
|
||||
pub metadata_count: u32,
|
||||
pub metadata: Pointer64<SchemaMetadataEntryData>,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaEnumeratorInfoData {}
|
||||
|
||||
#[repr(C)]
|
||||
pub union SchemaEnumeratorInfoDataUnion {
|
||||
pub uchar: u8,
|
||||
pub ushort: u16,
|
||||
pub uint: u32,
|
||||
pub ulong: u64,
|
||||
}
|
||||
35
src/source2/schema_system/schema_metadata_entry_data.rs
Normal file
35
src/source2/schema_system/schema_metadata_entry_data.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use std::ffi::c_char;
|
||||
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaMetadataEntryData {
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub network_value: Pointer64<SchemaNetworkValue>,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaMetadataEntryData {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaNetworkValue {
|
||||
pub u: SchemaNetworkValueUnion,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaNetworkValue {}
|
||||
|
||||
#[repr(C)]
|
||||
pub union SchemaNetworkValueUnion {
|
||||
pub name_ptr: Pointer64<ReprCString>,
|
||||
pub int_value: i32,
|
||||
pub float_value: f32,
|
||||
pub ptr: Pointer64<()>,
|
||||
pub var_value: SchemaVarName,
|
||||
pub name_value: [c_char; 32],
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaVarName {
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub ty: Pointer64<ReprCString>,
|
||||
}
|
||||
13
src/source2/schema_system/schema_static_field_data.rs
Normal file
13
src/source2/schema_system/schema_static_field_data.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::SchemaType;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaStaticFieldData {
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub type_: Pointer64<SchemaType>,
|
||||
pub instance: Address,
|
||||
pad_0018: [u8; 0x10],
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaStaticFieldData {}
|
||||
15
src/source2/schema_system/schema_system.rs
Normal file
15
src/source2/schema_system/schema_system.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::SchemaSystemTypeScope;
|
||||
|
||||
use crate::source2::UtlVector;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaSystem {
|
||||
pad_0000: [u8; 0x190],
|
||||
pub type_scopes: UtlVector<Pointer64<SchemaSystemTypeScope>>,
|
||||
pad_01a0: [u8; 0x120],
|
||||
pub num_registrations: u32,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaSystem {}
|
||||
19
src/source2/schema_system/schema_system_type_scope.rs
Normal file
19
src/source2/schema_system/schema_system_type_scope.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use std::ffi::c_char;
|
||||
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::{SchemaClassBinding, SchemaEnumBinding};
|
||||
|
||||
use crate::source2::UtlTsHash;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaSystemTypeScope {
|
||||
pad_0000: [u8; 0x8],
|
||||
pub name: [c_char; 256],
|
||||
pad_0108: [u8; 0x4B0],
|
||||
pub class_bindings: UtlTsHash<Pointer64<SchemaClassBinding>>,
|
||||
pad_05f0: [u8; 0x2810],
|
||||
pub enum_bindings: UtlTsHash<Pointer64<SchemaEnumBinding>>,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaSystemTypeScope {}
|
||||
99
src/source2/schema_system/schema_type.rs
Normal file
99
src/source2/schema_system/schema_type.rs
Normal file
@@ -0,0 +1,99 @@
|
||||
use memflow::prelude::v1::*;
|
||||
|
||||
use super::{SchemaClassBinding, SchemaEnumBinding, SchemaSystemTypeScope};
|
||||
|
||||
#[derive(Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
#[repr(u8)]
|
||||
pub enum SchemaAtomicCategory {
|
||||
Basic = 0,
|
||||
T,
|
||||
CollectionOfT,
|
||||
TF,
|
||||
TT,
|
||||
TTF,
|
||||
I,
|
||||
None,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
#[repr(u8)]
|
||||
pub enum SchemaTypeCategory {
|
||||
BuiltIn = 0,
|
||||
Ptr,
|
||||
Bitfield,
|
||||
FixedArray,
|
||||
Atomic,
|
||||
DeclaredClass,
|
||||
DeclaredEnum,
|
||||
None,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaArray {
|
||||
pub array_size: u32,
|
||||
pad_0004: [u8; 0x4],
|
||||
pub element_type: Pointer64<SchemaType>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaAtomic {
|
||||
pub element_type: Pointer64<SchemaType>,
|
||||
pad_0008: [u8; 0x8],
|
||||
pub template_ty: Pointer64<SchemaType>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaAtomicI {
|
||||
pad_0000: [u8; 0x10],
|
||||
pub value: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaAtomicTF {
|
||||
pad_0000: [u8; 0x10],
|
||||
pub template_ty: Pointer64<SchemaType>,
|
||||
pub size: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaAtomicTT {
|
||||
pad_0000: [u8; 0x10],
|
||||
pub templates: [Pointer64<SchemaType>; 2],
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct SchemaAtomicTTF {
|
||||
pad_0000: [u8; 0x10],
|
||||
pub templates: [Pointer64<SchemaType>; 2],
|
||||
pub size: u32,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SchemaType {
|
||||
pad_0000: [u8; 0x8],
|
||||
pub name: Pointer64<ReprCString>,
|
||||
pub type_scope: Pointer64<SchemaSystemTypeScope>,
|
||||
pub type_category: SchemaTypeCategory,
|
||||
pub atomic_category: SchemaAtomicCategory,
|
||||
}
|
||||
|
||||
unsafe impl Pod for SchemaType {}
|
||||
|
||||
#[repr(C)]
|
||||
pub union SchemaTypeUnion {
|
||||
pub schema_type: Pointer64<SchemaType>,
|
||||
pub class_binding: Pointer64<SchemaClassBinding>,
|
||||
pub enum_binding: Pointer64<SchemaEnumBinding>,
|
||||
pub array: SchemaArray,
|
||||
pub atomic: SchemaAtomic,
|
||||
pub atomic_tt: SchemaAtomicTT,
|
||||
pub atomic_tf: SchemaAtomicTF,
|
||||
pub atomic_ttf: SchemaAtomicTTF,
|
||||
pub atomic_i: SchemaAtomicI,
|
||||
}
|
||||
Reference in New Issue
Block a user