mirror of
https://github.com/a2x/cs2-dumper.git
synced 2025-10-07 22:50:03 +08:00
Add python file builder
This commit is contained in:
33
src/sdk/interface.rs
Normal file
33
src/sdk/interface.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use std::ffi::c_char;
|
||||
use std::mem::offset_of;
|
||||
|
||||
use crate::error::Result;
|
||||
use crate::remote::Process;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct InterfaceReg {
|
||||
pub create_fn: *const (), // 0x0000
|
||||
pub name: *const c_char, // 0x0008
|
||||
pub next: *mut InterfaceReg, // 0x0010
|
||||
}
|
||||
|
||||
impl InterfaceReg {
|
||||
pub fn ptr(&self, process: &Process) -> Result<usize> {
|
||||
process
|
||||
.read_memory::<usize>(self as *const _ as usize + offset_of!(InterfaceReg, create_fn))
|
||||
}
|
||||
|
||||
pub fn name(&self, process: &Process) -> Result<String> {
|
||||
let name_ptr = process
|
||||
.read_memory::<usize>(self as *const _ as usize + offset_of!(InterfaceReg, name))?;
|
||||
|
||||
process.read_string(name_ptr)
|
||||
}
|
||||
|
||||
pub fn next(&self, process: &Process) -> Result<*mut InterfaceReg> {
|
||||
process.read_memory::<*mut InterfaceReg>(
|
||||
self as *const _ as usize + offset_of!(InterfaceReg, next),
|
||||
)
|
||||
}
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
pub use interface::InterfaceReg;
|
||||
pub use schema_class_field_data::SchemaClassFieldData;
|
||||
pub use schema_class_info::SchemaClassInfo;
|
||||
pub use schema_system::SchemaSystem;
|
||||
@@ -6,6 +7,7 @@ pub use schema_type::SchemaType;
|
||||
pub use schema_type_declared_class::SchemaTypeDeclaredClass;
|
||||
pub use utl_ts_hash::UtlTsHash;
|
||||
|
||||
pub mod interface;
|
||||
pub mod schema_class_field_data;
|
||||
pub mod schema_class_info;
|
||||
pub mod schema_system;
|
||||
|
Reference in New Issue
Block a user