Refactor code writer and fix minor things

Also added the ability to specify which files should be generated based on their file type.

E.g. `cs2-dumper.exe -f hpp,json`
This commit is contained in:
a2x
2024-04-10 00:53:17 +10:00
parent 541f4acf1d
commit 8b1ecb7afb
19 changed files with 559 additions and 669 deletions

View File

@@ -1,6 +1,5 @@
use memflow::prelude::v1::*;
/// Represents a keyboard button.
#[derive(Pod)]
#[repr(C)]
pub struct KeyButton {

View File

@@ -1,6 +1,5 @@
use memflow::prelude::v1::*;
/// Represents a node in the linked list of exposed interfaces.
#[derive(Pod)]
#[repr(C)]
pub struct InterfaceReg {

View File

@@ -2,7 +2,6 @@ use memflow::prelude::v1::*;
use crate::error::{Error, Result};
/// Represents a growable memory class that doubles in size by default.
#[repr(C)]
pub struct UtlMemory<T> {
pub mem: Pointer64<[T]>, // 0x0000

View File

@@ -23,7 +23,6 @@ pub struct FreeList {
pub next: Pointer64<FreeList>, // 0x0000
}
/// Represents an optimized pool memory allocator.
#[repr(C)]
pub struct UtlMemoryPoolBase {
pub block_size: i32, // 0x0000

View File

@@ -31,7 +31,6 @@ pub struct HashFixedDataInternal<D, K> {
unsafe impl<D: 'static, K: 'static> Pod for HashFixedDataInternal<D, K> {}
/// Represents a thread-safe hash table.
#[repr(C)]
pub struct UtlTsHash<D, const C: usize = 256, K = u64> {
pub entry_mem: UtlMemoryPoolBase, // 0x0000
@@ -63,7 +62,7 @@ where
self.entry_mem.peak_alloc
}
/// Returns all elements in the hash table.
// TODO:
pub fn elements(&self, process: &mut IntoProcessInstanceArcBox<'_>) -> Result<Vec<D>> {
let blocks_alloc = self.blocks_alloc() as usize;
let peak_alloc = self.peak_count() as usize;

View File

@@ -2,7 +2,6 @@ use memflow::prelude::v1::*;
use crate::error::{Error, Result};
/// Represents a growable array class that doubles in size by default.
#[repr(C)]
pub struct UtlVector<T> {
pub size: i32, // 0x0000