From 5b7ec00b5d13ae5a2e57754d57b76c6376864bc9 Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Sun, 28 Jan 2024 13:13:43 -0500 Subject: [PATCH] Use pe MachineType pointer_size --- src/hollow_knight_memory.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hollow_knight_memory.rs b/src/hollow_knight_memory.rs index d04e8e15..e3bacb94 100644 --- a/src/hollow_knight_memory.rs +++ b/src/hollow_knight_memory.rs @@ -3134,11 +3134,7 @@ fn process_pointer_size(process: &Process) -> Option { let mono_addr = ["mono.dll", "mono-2.0-bdwgc.dll"].into_iter().find_map(|mono_name| { process.get_module_address(mono_name).ok() })?; - if pe::MachineType::read(process, mono_addr)? == pe::MachineType::X86_64 { - Some(PointerSize::Bit64) - } else { - Some(PointerSize::Bit32) - } + pe::MachineType::read(process, mono_addr)?.pointer_size() } else if bytes.starts_with(&[0x7F, 0x45, 0x4C, 0x46]) { // ELF None