process: make searching for a module case-insensitive
This commit is contained in:
+2
-4
@@ -64,13 +64,11 @@ impl Process {
|
||||
Ok(process)
|
||||
}
|
||||
|
||||
/// get a `Module` of a `Process` by name
|
||||
///
|
||||
/// note: the casing matters (don't search for `shell32.dll` if you want `SHELL32.dll`)
|
||||
/// get a `Module` of a `Process` by name (case-insensitive)
|
||||
pub fn module(&self, name: &str) -> Result<Module, Error> {
|
||||
let Some(snapshot) = snapshot::ModuleSnapshot::get_modules(self.id)?
|
||||
.into_iter()
|
||||
.find(|snapshot| snapshot.name == name)
|
||||
.find(|snapshot| name.eq_ignore_ascii_case(&snapshot.name))
|
||||
else {
|
||||
return Err(Error::CreateProcessError(format!(
|
||||
"failed to find a module with identifier `{name}`",
|
||||
|
||||
Reference in New Issue
Block a user