Skip to content

Commit

Permalink
Use pe MachineType pointer_size
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Jan 28, 2024
1 parent 9499c4b commit 5b7ec00
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/hollow_knight_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3134,11 +3134,7 @@ fn process_pointer_size(process: &Process) -> Option<PointerSize> {
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
Expand Down

0 comments on commit 5b7ec00

Please sign in to comment.