Skip to content

Commit

Permalink
Update module.rs
Browse files Browse the repository at this point in the history
Repaired acquiring handle's modules.
  • Loading branch information
luadebug authored Aug 15, 2024
1 parent 9ae1e03 commit ba3eee4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bindings/rust/libmem/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ impl From<lm_module_t> for Module {
base: raw_module.base,
end: raw_module.end,
size: raw_module.size,
path: unsafe { CStr::from_ptr(path_ptr).to_str().unwrap().to_owned() },
name: unsafe { CStr::from_ptr(name_ptr).to_str().unwrap().to_owned() },
path: unsafe {
let bytes = CStr::from_ptr(path_ptr).to_bytes();
String::from_utf8_lossy(bytes).to_string().to_owned()
},
name: unsafe {
let bytes = CStr::from_ptr(name_ptr).to_bytes();
String::from_utf8_lossy(bytes).to_string().to_owned()
},
}
}
}
Expand Down

0 comments on commit ba3eee4

Please sign in to comment.