From b61d63b6ef600e76ce296243486d4dde85a8e558 Mon Sep 17 00:00:00 2001 From: a2x <45197573+a2x@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:55:15 +1000 Subject: [PATCH] Added new patterns --- config.json | 31 +++++++++++++++++++++++++++++++ generated/offsets.cs | 6 ++++++ generated/offsets.hpp | 6 ++++++ generated/offsets.json | 5 +++++ generated/offsets.rs | 6 ++++++ src/config.rs | 1 + src/dumpers/offsets.rs | 31 +++++++++++++++++++++++-------- 7 files changed, 78 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index b19c2394..1e57f206 100644 --- a/config.json +++ b/config.json @@ -20,6 +20,16 @@ } ] }, + { + "name": "interfaceLinkList", + "module": "client.dll", + "pattern": "4C 8B 0D ? ? ? ? 4C 8B D2 4C 8B D9", + "operations": [ + { + "type": "ripRelative" + } + ] + }, { "name": "localPlayerController", "module": "client.dll", @@ -44,6 +54,27 @@ } ] }, + { + "name": "networkGameClient", + "module": "engine2.dll", + "pattern": "48 89 3D ? ? ? ? 48 8D 15", + "operations": [ + { + "type": "ripRelative" + } + ] + }, + { + "name": "networkGameClient_signOnState", + "module": "engine2.dll", + "pattern": "41 8B 94 24 ? ? ? ? 4C 8D 35", + "operations": [ + { + "type": "offset", + "position": 4 + } + ] + }, { "name": "viewAngles", "module": "client.dll", diff --git a/generated/offsets.cs b/generated/offsets.cs index aa1318fd..f8e5e627 100644 --- a/generated/offsets.cs +++ b/generated/offsets.cs @@ -1,8 +1,14 @@ public static class client_dll { public const nint entityList = 0x178C878; public const nint globalVars = 0x168FCC8; + public const nint interfaceLinkList = 0x1972A38; public const nint localPlayerController = 0x17DB0F8; public const nint localPlayerPawn = 0x1879BE8; public const nint viewAngles = 0x18D9590; public const nint viewMatrix = 0x187A6D0; +} + +public static class engine2_dll { + public const nint networkGameClient = 0x489AB0; + public const nint networkGameClient_signOnState = 0x240; } \ No newline at end of file diff --git a/generated/offsets.hpp b/generated/offsets.hpp index a934210c..b99d0bb8 100644 --- a/generated/offsets.hpp +++ b/generated/offsets.hpp @@ -5,8 +5,14 @@ namespace client_dll { constexpr std::ptrdiff_t entityList = 0x178C878; constexpr std::ptrdiff_t globalVars = 0x168FCC8; + constexpr std::ptrdiff_t interfaceLinkList = 0x1972A38; constexpr std::ptrdiff_t localPlayerController = 0x17DB0F8; constexpr std::ptrdiff_t localPlayerPawn = 0x1879BE8; constexpr std::ptrdiff_t viewAngles = 0x18D9590; constexpr std::ptrdiff_t viewMatrix = 0x187A6D0; +} + +namespace engine2_dll { + constexpr std::ptrdiff_t networkGameClient = 0x489AB0; + constexpr std::ptrdiff_t networkGameClient_signOnState = 0x240; } \ No newline at end of file diff --git a/generated/offsets.json b/generated/offsets.json index e844cec8..58e702af 100644 --- a/generated/offsets.json +++ b/generated/offsets.json @@ -2,9 +2,14 @@ "client_dll": { "entityList": 24692856, "globalVars": 23657672, + "interfaceLinkList": 26683960, "localPlayerController": 25014520, "localPlayerPawn": 25664488, "viewAngles": 26056080, "viewMatrix": 25667280 + }, + "engine2_dll": { + "networkGameClient": 4758192, + "networkGameClient_signOnState": 576 } } \ No newline at end of file diff --git a/generated/offsets.rs b/generated/offsets.rs index defd4902..09f4a834 100644 --- a/generated/offsets.rs +++ b/generated/offsets.rs @@ -3,8 +3,14 @@ pub mod client_dll { pub const entityList: usize = 0x178C878; pub const globalVars: usize = 0x168FCC8; + pub const interfaceLinkList: usize = 0x1972A38; pub const localPlayerController: usize = 0x17DB0F8; pub const localPlayerPawn: usize = 0x1879BE8; pub const viewAngles: usize = 0x18D9590; pub const viewMatrix: usize = 0x187A6D0; +} + +pub mod engine2_dll { + pub const networkGameClient: usize = 0x489AB0; + pub const networkGameClient_signOnState: usize = 0x240; } \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index 7a9c3901..6414d45c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,6 +6,7 @@ pub enum Operation { Add { value: usize }, Dereference { times: Option }, Jmp, + Offset { position: usize }, RipRelative, Subtract { value: usize }, } diff --git a/src/dumpers/offsets.rs b/src/dumpers/offsets.rs index 9069a90e..9c3241c3 100644 --- a/src/dumpers/offsets.rs +++ b/src/dumpers/offsets.rs @@ -21,6 +21,8 @@ pub fn dump_offsets(builders: &mut Vec, process: &Process) -> R let mut address = process.find_pattern(&signature.module, &signature.pattern)?; + let mut offset: Option = None; + for operation in signature.operations { match operation { Operation::Add { value } => { @@ -34,6 +36,9 @@ pub fn dump_offsets(builders: &mut Vec, process: &Process) -> R Operation::Jmp => { address = process.resolve_jmp(address)?; } + Operation::Offset { position } => { + offset = Some(process.read_memory::(address + position)?); + } Operation::RipRelative => { address = process.resolve_rip(address)?; } @@ -43,17 +48,27 @@ pub fn dump_offsets(builders: &mut Vec, process: &Process) -> R } } - log::info!( - " -> Found '{}' @ {:#X} (RVA: {:#X})", - signature.name, - address, - address - module.address() - ); + let sanitized_module_name = signature.module.replace(".", "_"); + + let (name, value) = if let Some(offset) = offset { + log::info!(" -> Found '{}' @ {:#X}", signature.name, offset); + + (signature.name, offset as usize) + } else { + log::info!( + " -> Found '{}' @ {:#X} (RVA: {:#X})", + signature.name, + address, + address - module.address() + ); + + (signature.name, address - module.address()) + }; entries - .entry(signature.module.replace(".", "_")) + .entry(sanitized_module_name) .or_default() - .push((signature.name, address - module.address())); + .push((name, value)); } for builder in builders.iter_mut() {