diff --git a/src/process/process_info.rs b/src/process/process_info.rs index fb1ada5..79e3b77 100644 --- a/src/process/process_info.rs +++ b/src/process/process_info.rs @@ -129,6 +129,9 @@ impl ProcessInfo { let library = { let libmap = maps.iter().find(|m| { if let Some(path) = m.filename() { + #[cfg(target_os = "windows")] + return is_lib::(path) && m.is_read(); + #[cfg(not(target_os = "windows"))] return is_lib::(path) && m.is_exec(); } false @@ -265,7 +268,7 @@ where use proc_maps::win_maps::SymbolLoader; let handler = SymbolLoader::new(pid)?; - let _module = handler.load_module(filename)?; // need to keep this module in scope + let module = handler.load_module(filename)?; // need to keep this module in scope let mut ret = HashMap::new(); @@ -277,7 +280,7 @@ where // If we have a module base (ie from PDB), need to adjust by the offset // otherwise seems like we can take address directly let addr = if base == 0 { - addr + offset + addr - module.base } else { offset + addr - base };