diff --git a/src/game_engine/unity/mono.rs b/src/game_engine/unity/mono.rs index 1f53b75..094c6a3 100644 --- a/src/game_engine/unity/mono.rs +++ b/src/game_engine/unity/mono.rs @@ -126,7 +126,7 @@ impl Module { let sig_function_array: Signature<0x100> = Signature::Simple(function_array); let mono_assembly_foreach_address = sig_function_array.scan_process_range(process, module_range)?; - let assemblies: Address = match is_64_bit { + let assemblies_pointer: Address = match is_64_bit { true => { const SIG_MONO_64_DYLIB: Signature<3> = Signature::new("48 8B 3D"); // RIP-relative addressing @@ -140,12 +140,21 @@ impl Module { } }; - Some(Self { - is_64_bit, - version, - offsets, - assemblies, - }) + let assemblies: Address = match is_64_bit { + true => process.read::(assemblies_pointer).ok()?.into(), + false => process.read::(assemblies_pointer).ok()?.into(), + }; + + if assemblies.is_null() { + None + } else { + Some(Self { + is_64_bit, + version, + offsets, + assemblies, + }) + } } fn assemblies<'a>(&'a self, process: &'a Process) -> impl Iterator + 'a {