Fetch `networkGameClient_maxClients` offset

This commit is contained in:
a2x 2023-10-01 00:52:09 +10:00
parent 5963b4fef0
commit 18e90bcf8c
7 changed files with 24 additions and 7 deletions

View File

@ -65,13 +65,24 @@
]
},
{
"name": "networkGameClient_signOnState",
"name": "networkGameClient_maxClients",
"module": "engine2.dll",
"pattern": "41 8B 94 24 ? ? ? ? 4C 8D 35",
"pattern": "8B 81 ? ? ? ? C3 CC CC CC CC CC CC CC CC CC 48 8D 81",
"operations": [
{
"type": "offset",
"position": 4
"position": 2
}
]
},
{
"name": "networkGameClient_signOnState",
"module": "engine2.dll",
"pattern": "44 8B 81 ? ? ? ? 48 8D 0D",
"operations": [
{
"type": "offset",
"position": 3
}
]
},

View File

@ -10,5 +10,6 @@ public static class client_dll {
public static class engine2_dll {
public const nint networkGameClient = 0x48AAB0;
public const nint networkGameClient_maxClients = 0x250;
public const nint networkGameClient_signOnState = 0x240;
}

View File

@ -14,5 +14,6 @@ namespace client_dll {
namespace engine2_dll {
constexpr std::ptrdiff_t networkGameClient = 0x48AAB0;
constexpr std::ptrdiff_t networkGameClient_maxClients = 0x250;
constexpr std::ptrdiff_t networkGameClient_signOnState = 0x240;
}

View File

@ -10,6 +10,7 @@
},
"engine2_dll": {
"networkGameClient": 4762288,
"networkGameClient_maxClients": 592,
"networkGameClient_signOnState": 576
}
}

View File

@ -12,5 +12,6 @@ pub mod client_dll {
pub mod engine2_dll {
pub const networkGameClient: usize = 0x48AAB0;
pub const networkGameClient_maxClients: usize = 0x250;
pub const networkGameClient_signOnState: usize = 0x240;
}

View File

@ -30,9 +30,10 @@ pub fn dump_interfaces(builders: &mut Vec<FileBuilderEnum>, process: &Process) -
let interface_version_name = process.read_string(interface_version_name_ptr, 64)?;
log::info!(
" -> Found '{}' @ {:#X} (RVA: {:#X})",
" -> Found '{}' @ {:#X} ({} + {:#X})",
interface_version_name,
interface_ptr,
module_name,
interface_ptr - module.address()
);

View File

@ -21,7 +21,7 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
let mut address = process.find_pattern(&signature.module, &signature.pattern)?;
let mut offset: Option<u32> = None;
let mut offset: Option<u16> = None;
for operation in signature.operations {
match operation {
@ -37,7 +37,7 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
address = process.resolve_jmp(address)?;
}
Operation::Offset { position } => {
offset = Some(process.read_memory::<u32>(address + position)?);
offset = Some(process.read_memory::<u16>(address + position)?);
}
Operation::RipRelative => {
address = process.resolve_rip(address)?;
@ -56,9 +56,10 @@ pub fn dump_offsets(builders: &mut Vec<FileBuilderEnum>, process: &Process) -> R
(signature.name, offset as usize)
} else {
log::info!(
" -> Found '{}' @ {:#X} (RVA: {:#X})",
" -> Found '{}' @ {:#X} ({} + {:#X})",
signature.name,
address,
signature.module,
address - module.address()
);