Added new patterns

This commit is contained in:
a2x 2023-10-09 15:46:03 +10:00
parent 86b6462e56
commit 96a378be0b
8 changed files with 92 additions and 37 deletions

View File

@ -116,6 +116,26 @@
} }
] ]
}, },
{
"name": "dwGlowManager",
"module": "client.dll",
"pattern": "48 8D 0D ? ? ? ? E9 2D EE FC 00",
"operations": [
{
"type": "ripRelative"
},
{
"type": "dereference"
},
{
"type": "add",
"value": 112
},
{
"type": "dereference"
}
]
},
{ {
"name": "dwInterfaceLinkList", "name": "dwInterfaceLinkList",
"module": "client.dll", "module": "client.dll",
@ -160,14 +180,31 @@
} }
] ]
}, },
{
"name": "dwNetworkGameClient_getLocalPlayer",
"module": "engine2.dll",
"pattern": "48 83 C0 ? 48 8D 04 40 8B 0C C1",
"operations": [
{
"type": "slice",
"start": 3,
"end": 4
},
{
"type": "add",
"value": 230
}
]
},
{ {
"name": "dwNetworkGameClient_maxClients", "name": "dwNetworkGameClient_maxClients",
"module": "engine2.dll", "module": "engine2.dll",
"pattern": "8B 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC CC 48 8D 81", "pattern": "8B 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC CC 48 8D 81",
"operations": [ "operations": [
{ {
"type": "offset", "type": "slice",
"offset": 2 "start": 2,
"end": 4
} }
] ]
}, },
@ -177,8 +214,9 @@
"pattern": "44 8B 81 ? ? ? ? 48 8D 0D", "pattern": "44 8B 81 ? ? ? ? 48 8D 0D",
"operations": [ "operations": [
{ {
"type": "offset", "type": "slice",
"offset": 3 "start": 3,
"end": 5
} }
] ]
}, },

View File

@ -1,5 +1,5 @@
// Created using https://github.com/a2x/cs2-dumper // Created using https://github.com/a2x/cs2-dumper
// 2023-10-07 01:42:59.790798200 UTC // 2023-10-09 05:41:44.460863500 UTC
public static class client_dll { public static class client_dll {
public const nint dwEntityList = 0x17888D8; public const nint dwEntityList = 0x17888D8;
@ -10,6 +10,7 @@ public static class client_dll {
public const nint dwForceLeft = 0x168FF50; public const nint dwForceLeft = 0x168FF50;
public const nint dwForceRight = 0x168FFE0; public const nint dwForceRight = 0x168FFE0;
public const nint dwGlobalVars = 0x168BCE8; public const nint dwGlobalVars = 0x168BCE8;
public const nint dwGlowManager = 0x17E3C00;
public const nint dwInterfaceLinkList = 0x196EC98; public const nint dwInterfaceLinkList = 0x196EC98;
public const nint dwLocalPlayerController = 0x17D7158; public const nint dwLocalPlayerController = 0x17D7158;
public const nint dwLocalPlayerPawn = 0x1875C48; public const nint dwLocalPlayerPawn = 0x1875C48;
@ -22,6 +23,7 @@ public static class client_dll {
public static class engine2_dll { public static class engine2_dll {
public const nint dwBuildNumber = 0x486514; public const nint dwBuildNumber = 0x486514;
public const nint dwNetworkGameClient = 0x485AB0; public const nint dwNetworkGameClient = 0x485AB0;
public const nint dwNetworkGameClient_getLocalPlayer = 0xF0;
public const nint dwNetworkGameClient_maxClients = 0x250; public const nint dwNetworkGameClient_maxClients = 0x250;
public const nint dwNetworkGameClient_signOnState = 0x240; public const nint dwNetworkGameClient_signOnState = 0x240;
public const nint dwWindowHeight = 0x5376AC; public const nint dwWindowHeight = 0x5376AC;

View File

@ -3,7 +3,7 @@
#include <cstddef> #include <cstddef>
// Created using https://github.com/a2x/cs2-dumper // Created using https://github.com/a2x/cs2-dumper
// 2023-10-07 01:42:59.789624800 UTC // 2023-10-09 05:41:44.460417200 UTC
namespace client_dll { namespace client_dll {
constexpr std::ptrdiff_t dwEntityList = 0x17888D8; constexpr std::ptrdiff_t dwEntityList = 0x17888D8;
@ -14,6 +14,7 @@ namespace client_dll {
constexpr std::ptrdiff_t dwForceLeft = 0x168FF50; constexpr std::ptrdiff_t dwForceLeft = 0x168FF50;
constexpr std::ptrdiff_t dwForceRight = 0x168FFE0; constexpr std::ptrdiff_t dwForceRight = 0x168FFE0;
constexpr std::ptrdiff_t dwGlobalVars = 0x168BCE8; constexpr std::ptrdiff_t dwGlobalVars = 0x168BCE8;
constexpr std::ptrdiff_t dwGlowManager = 0x17E3C00;
constexpr std::ptrdiff_t dwInterfaceLinkList = 0x196EC98; constexpr std::ptrdiff_t dwInterfaceLinkList = 0x196EC98;
constexpr std::ptrdiff_t dwLocalPlayerController = 0x17D7158; constexpr std::ptrdiff_t dwLocalPlayerController = 0x17D7158;
constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x1875C48; constexpr std::ptrdiff_t dwLocalPlayerPawn = 0x1875C48;
@ -26,6 +27,7 @@ namespace client_dll {
namespace engine2_dll { namespace engine2_dll {
constexpr std::ptrdiff_t dwBuildNumber = 0x486514; constexpr std::ptrdiff_t dwBuildNumber = 0x486514;
constexpr std::ptrdiff_t dwNetworkGameClient = 0x485AB0; constexpr std::ptrdiff_t dwNetworkGameClient = 0x485AB0;
constexpr std::ptrdiff_t dwNetworkGameClient_getLocalPlayer = 0xF0;
constexpr std::ptrdiff_t dwNetworkGameClient_maxClients = 0x250; constexpr std::ptrdiff_t dwNetworkGameClient_maxClients = 0x250;
constexpr std::ptrdiff_t dwNetworkGameClient_signOnState = 0x240; constexpr std::ptrdiff_t dwNetworkGameClient_signOnState = 0x240;
constexpr std::ptrdiff_t dwWindowHeight = 0x5376AC; constexpr std::ptrdiff_t dwWindowHeight = 0x5376AC;

View File

@ -8,6 +8,7 @@
"dwForceLeft": 23658320, "dwForceLeft": 23658320,
"dwForceRight": 23658464, "dwForceRight": 23658464,
"dwGlobalVars": 23641320, "dwGlobalVars": 23641320,
"dwGlowManager": 25050112,
"dwInterfaceLinkList": 26668184, "dwInterfaceLinkList": 26668184,
"dwLocalPlayerController": 24998232, "dwLocalPlayerController": 24998232,
"dwLocalPlayerPawn": 25648200, "dwLocalPlayerPawn": 25648200,
@ -19,6 +20,7 @@
"engine2_dll": { "engine2_dll": {
"dwBuildNumber": 4744468, "dwBuildNumber": 4744468,
"dwNetworkGameClient": 4741808, "dwNetworkGameClient": 4741808,
"dwNetworkGameClient_getLocalPlayer": 240,
"dwNetworkGameClient_maxClients": 592, "dwNetworkGameClient_maxClients": 592,
"dwNetworkGameClient_signOnState": 576, "dwNetworkGameClient_signOnState": 576,
"dwWindowHeight": 5469868, "dwWindowHeight": 5469868,

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case, non_upper_case_globals)] #![allow(non_snake_case, non_upper_case_globals)]
// Created using https://github.com/a2x/cs2-dumper // Created using https://github.com/a2x/cs2-dumper
// 2023-10-07 01:42:59.792129600 UTC // 2023-10-09 05:41:44.461556800 UTC
pub mod client_dll { pub mod client_dll {
pub const dwEntityList: usize = 0x17888D8; pub const dwEntityList: usize = 0x17888D8;
@ -12,6 +12,7 @@ pub mod client_dll {
pub const dwForceLeft: usize = 0x168FF50; pub const dwForceLeft: usize = 0x168FF50;
pub const dwForceRight: usize = 0x168FFE0; pub const dwForceRight: usize = 0x168FFE0;
pub const dwGlobalVars: usize = 0x168BCE8; pub const dwGlobalVars: usize = 0x168BCE8;
pub const dwGlowManager: usize = 0x17E3C00;
pub const dwInterfaceLinkList: usize = 0x196EC98; pub const dwInterfaceLinkList: usize = 0x196EC98;
pub const dwLocalPlayerController: usize = 0x17D7158; pub const dwLocalPlayerController: usize = 0x17D7158;
pub const dwLocalPlayerPawn: usize = 0x1875C48; pub const dwLocalPlayerPawn: usize = 0x1875C48;
@ -24,6 +25,7 @@ pub mod client_dll {
pub mod engine2_dll { pub mod engine2_dll {
pub const dwBuildNumber: usize = 0x486514; pub const dwBuildNumber: usize = 0x486514;
pub const dwNetworkGameClient: usize = 0x485AB0; pub const dwNetworkGameClient: usize = 0x485AB0;
pub const dwNetworkGameClient_getLocalPlayer: usize = 0xF0;
pub const dwNetworkGameClient_maxClients: usize = 0x250; pub const dwNetworkGameClient_maxClients: usize = 0x250;
pub const dwNetworkGameClient_signOnState: usize = 0x240; pub const dwNetworkGameClient_signOnState: usize = 0x240;
pub const dwWindowHeight: usize = 0x5376AC; pub const dwWindowHeight: usize = 0x5376AC;

View File

@ -7,19 +7,21 @@ pub enum Operation {
value: usize, value: usize,
}, },
Dereference { Dereference {
times: Option<u16>, times: Option<usize>,
size: Option<usize>,
}, },
Jmp { Jmp {
offset: Option<usize>, offset: Option<usize>,
length: Option<usize>, length: Option<usize>,
}, },
Offset {
offset: usize,
},
RipRelative { RipRelative {
offset: Option<usize>, offset: Option<usize>,
length: Option<usize>, length: Option<usize>,
}, },
Slice {
start: usize,
end: usize,
},
Subtract { Subtract {
value: usize, value: usize,
}, },

View File

@ -24,49 +24,56 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
let mut address = let mut address =
Address::from(process.find_pattern(&signature.module, &signature.pattern)?); Address::from(process.find_pattern(&signature.module, &signature.pattern)?);
let mut offset: Option<u32> = None;
for operation in signature.operations { for operation in signature.operations {
match operation { match operation {
Add { value } => { Add { value } => address += value,
address += value; Dereference { times, size } => {
} let times = times.unwrap_or(1);
Dereference { times } => { let size = size.unwrap_or(8);
for _ in 0..times.unwrap_or(1) {
address = process.read_memory::<usize>(address.0)?.into(); for _ in 0..times {
process.read_memory_raw(
address.0,
&mut address.0 as *mut _ as *mut _,
size,
)?;
} }
} }
Jmp { offset, length } => { Jmp { offset, length } => {
address = process.resolve_jmp(address.0, offset, length)?.into(); address = process.resolve_jmp(address.0, offset, length)?.into()
}
Offset {
offset: start_offset,
} => {
offset = Some(process.read_memory::<u32>(address.0 + start_offset)?);
} }
RipRelative { offset, length } => { RipRelative { offset, length } => {
address = process.resolve_rip(address.0, offset, length)?.into(); address = process.resolve_rip(address.0, offset, length)?.into()
} }
Subtract { value } => { Slice { start, end } => {
address -= value; let mut result: usize = 0;
process.read_memory_raw(
address.add(start).0,
&mut result as *mut _ as *mut _,
end - start,
)?;
address = result.into();
} }
Subtract { value } => address -= value,
} }
} }
let (name, value) = if let Some(offset) = offset { let (name, value) = if address.0 < module.address() {
log::debug!(" └─ {} @ {:#X}", signature.name, offset); log::debug!(" └─ {} @ {:#X}", signature.name, address.0);
(signature.name, offset as usize) (signature.name, address.0)
} else { } else {
log::debug!( log::debug!(
" └─ {} @ {:#X} ({} + {:#X})", " └─ {} @ {:#X} ({} + {:#X})",
signature.name, signature.name,
address, address,
signature.module, signature.module,
address - module.address() address.sub(module.address())
); );
(signature.name, address.0 - module.address()) (signature.name, address.sub(module.address()).0)
}; };
entries entries

View File

@ -6,12 +6,12 @@ use std::ops::{Add, AddAssign, Sub, SubAssign};
pub struct Address(pub usize); pub struct Address(pub usize);
impl Address { impl Address {
pub fn add(&self, offset: usize) -> Self { pub fn add(&self, value: usize) -> Self {
Self(self.0 + offset) Self(self.0 + value)
} }
pub fn sub(&self, offset: usize) -> Self { pub fn sub(&self, value: usize) -> Self {
Self(self.0 - offset) Self(self.0 - value)
} }
pub fn as_ptr<T>(&self) -> *const T { pub fn as_ptr<T>(&self) -> *const T {