mirror of
https://github.com/rmccrystal/kernel-rs
synced 2026-08-09 13:06:55 +00:00
Added a test for dumping modules
This commit is contained in:
@@ -95,6 +95,19 @@ fn test_read_memory() {
|
||||
dbg!(buf);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dump_module() {
|
||||
let handle = get_handle();
|
||||
let notepad = Process::notepad();
|
||||
let proc = handle.attach_pid(notepad.pid()).unwrap();
|
||||
|
||||
let main_mod = proc.get_main_module();
|
||||
|
||||
let mut buf = vec![0u8; main_mod.size as _];
|
||||
proc.try_read_bytes_into(main_mod.base, &mut buf).unwrap();
|
||||
assert_eq!(buf[0..2], [0x4Du8, 0x5A]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_write_memory() {
|
||||
let handle = get_handle();
|
||||
|
||||
Reference in New Issue
Block a user