fix: resolve #16 by fix cs2dumper importing

Resolved #16, fixes URLs and module imports for cs2dumper.
Warning: Untested.
This commit is contained in:
Janek
2024-04-03 17:59:53 +02:00
parent d31c3f8ee5
commit 212c88efaa
9 changed files with 6511 additions and 299 deletions

View File

@@ -18,7 +18,7 @@ pub struct DmaCtx {
impl DmaCtx {
fn check_version(&mut self) -> anyhow::Result<()> {
let game_build_number: u32 = self.process.read(self.engine_module.base + cs2dumper::offsets::engine2_dll::dwBuildNumber)?;
let offset_build_number = cs2dumper::offsets::game_info::buildNumber;
let offset_build_number = env!("CS2_BUILD_NUMBER").parse::<usize>()?;
if game_build_number as usize != offset_build_number {
return Err(anyhow::anyhow!(

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-04-02 16:10:48.961749300 UTC
#![allow(non_upper_case_globals, non_camel_case_types, unused)]
pub mod cs2_dumper {
pub mod schemas {
// Module: engine2.dll
// Classes count: 2
// Enums count: 4
pub mod engine2_dll {
// Alignment: 4
// Members count: 3
#[repr(u32)]
pub enum SpawnDebugOverrideState_t {
SPAWN_DEBUG_OVERRIDE_NONE = 0x0,
SPAWN_DEBUG_OVERRIDE_FORCE_ENABLED = 0x1,
SPAWN_DEBUG_OVERRIDE_FORCE_DISABLED = 0x2
}
// Alignment: 4
// Members count: 5
#[repr(u32)]
pub enum SpawnDebugRestrictionOverrideState_t {
SPAWN_DEBUG_RESTRICT_NONE = 0x0,
SPAWN_DEBUG_RESTRICT_IGNORE_MANAGER_DISTANCE_REQS = 0x1,
SPAWN_DEBUG_RESTRICT_IGNORE_TEMPLATE_DISTANCE_LOS_REQS = 0x2,
SPAWN_DEBUG_RESTRICT_IGNORE_TEMPLATE_COOLDOWN_LIMITS = 0x4,
SPAWN_DEBUG_RESTRICT_IGNORE_TARGET_COOLDOWN_LIMITS = 0x8
}
// Alignment: 4
// Members count: 3
#[repr(u32)]
pub enum EntityDormancyType_t {
ENTITY_NOT_DORMANT = 0x0,
ENTITY_DORMANT = 0x1,
ENTITY_SUSPENDED = 0x2
}
// Alignment: 4
// Members count: 4
#[repr(u32)]
pub enum EntityIOTargetType_t {
ENTITY_IO_TARGET_INVALID = 0xFFFFFFFFFFFFFFFF,
ENTITY_IO_TARGET_ENTITYNAME = 0x2,
ENTITY_IO_TARGET_EHANDLE = 0x6,
ENTITY_IO_TARGET_ENTITYNAME_OR_CLASSNAME = 0x7
}
// Parent: None
// Fields count: 11
//
// Metadata:
// NetworkVarNames: m_nameStringableIndex (int32)
pub mod CEntityIdentity {
pub const m_nameStringableIndex: usize = 0x14; // int32
pub const m_name: usize = 0x18; // CUtlSymbolLarge
pub const m_designerName: usize = 0x20; // CUtlSymbolLarge
pub const m_flags: usize = 0x30; // uint32
pub const m_worldGroupId: usize = 0x38; // WorldGroupId_t
pub const m_fDataObjectTypes: usize = 0x3C; // uint32
pub const m_PathIndex: usize = 0x40; // ChangeAccessorFieldPathIndex_t
pub const m_pPrev: usize = 0x58; // CEntityIdentity*
pub const m_pNext: usize = 0x60; // CEntityIdentity*
pub const m_pPrevByClass: usize = 0x68; // CEntityIdentity*
pub const m_pNextByClass: usize = 0x70; // CEntityIdentity*
}
// Parent: None
// Fields count: 4
//
// Metadata:
// NetworkVarNames: m_pEntity (CEntityIdentity*)
// NetworkVarNames: m_CScriptComponent (CScriptComponent::Storage_t)
pub mod CEntityInstance {
pub const m_iszPrivateVScripts: usize = 0x8; // CUtlSymbolLarge
pub const m_pEntity: usize = 0x10; // CEntityIdentity*
pub const m_CScriptComponent: usize = 0x28; // CScriptComponent*
pub const m_bVisibleinPVS: usize = 0x30; // bool
}
}
}
}

View File

@@ -1,4 +1,12 @@
#![allow(dead_code)]
pub mod client;
pub mod engine2;
pub mod offsets;
#![allow(overflowing_literals)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
mod client_mod;
mod engine2_mod;
mod offsets_mod;
pub use client_mod::cs2_dumper::schemas::client_dll as client;
pub use engine2_mod::cs2_dumper::schemas::engine2_dll as engine;
pub use offsets_mod::cs2_dumper::offsets as offsets;

View File

@@ -0,0 +1,48 @@
// Generated using https://github.com/a2x/cs2-dumper
// 2024-04-02 16:10:48.961749300 UTC
#![allow(non_upper_case_globals, non_camel_case_types, unused)]
pub mod cs2_dumper {
pub mod offsets {
// Module: client.dll
pub mod client_dll {
pub const dwCSGOInput: usize = 0x192B620;
pub const dwEntityList: usize = 0x18C2D58;
pub const dwGameEntitySystem: usize = 0x19E0790;
pub const dwGameEntitySystem_getHighestEntityIndex: usize = 0x1510;
pub const dwGameRules: usize = 0x191FCA0;
pub const dwGlobalVars: usize = 0x172ABA0;
pub const dwGlowManager: usize = 0x19200C0;
pub const dwLocalPlayerController: usize = 0x1912578;
pub const dwLocalPlayerPawn: usize = 0x17371A8;
pub const dwPlantedC4: usize = 0x1928AD8;
pub const dwPrediction: usize = 0x1737070;
pub const dwSensitivity: usize = 0x19209E8;
pub const dwSensitivity_sensitivity: usize = 0x40;
pub const dwViewAngles: usize = 0x19309B0;
pub const dwViewMatrix: usize = 0x19241A0;
pub const dwViewRender: usize = 0x1924A20;
}
// Module: engine2.dll
pub mod engine2_dll {
pub const dwBuildNumber: usize = 0x514574;
pub const dwNetworkGameClient: usize = 0x513AC8;
pub const dwNetworkGameClient_deltaTick: usize = 0x258;
pub const dwNetworkGameClient_getLocalPlayer: usize = 0xF0;
pub const dwNetworkGameClient_getMaxClients: usize = 0x250;
pub const dwNetworkGameClient_signOnState: usize = 0x240;
pub const dwWindowHeight: usize = 0x5CCCDC;
pub const dwWindowWidth: usize = 0x5CCCD8;
}
// Module: inputsystem.dll
pub mod inputsystem_dll {
pub const dwInputSystem: usize = 0x367A0;
}
// Module: matchmaking.dll
pub mod matchmaking_dll {
pub const dwGameTypes: usize = 0x1D21E0;
pub const dwGameTypes_mapName: usize = 0x1D2300;
}
}
}

View File

@@ -60,9 +60,8 @@ pub async fn run(path: PathBuf, port: u16, data_lock: Arc<RwLock<RadarData>>) ->
.with_state(AppState { data_lock });
let address = format!("0.0.0.0:{}", port);
axum::Server::bind(&address.parse()?)
.serve(app.into_make_service())
let listener = tokio::net::TcpListener::bind(address).await?;
axum::serve(listener, app.into_make_service())
.await?;
Ok(())