Skip to content

Commit

Permalink
fix linux reading PE mono root
Browse files Browse the repository at this point in the history
  • Loading branch information
Manwe-777 committed Apr 25, 2024
1 parent fc28a5e commit bbc9c03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mono_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ impl MonoReader {
found = true
}
_ => {
eprintln!("Error: mono_get_root_domain not found");
// This is not the library we are looking for
// eprintln!("Error: mono_get_root_domain not found");
}
}
}
Expand Down Expand Up @@ -228,7 +229,7 @@ impl MonoReader {
let val = unsafe {
match member.read() {
Ok(val) => Some(val),
Err(_e) => None
Err(_e) => None,
}
};

Expand Down
4 changes: 4 additions & 0 deletions src/pe_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ impl<'a> PEReader<'a> {
}
}

if root_domain_function_address == 0 {
return Err(Error::default());
}

Ok(root_domain_function_address)
}
}

0 comments on commit bbc9c03

Please sign in to comment.