fix: 修复一个todo问题
This commit is contained in:
@@ -60,8 +60,9 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_find_export_function(){
|
||||
let find_function_str = ProcName::Named("test_def_add".to_string());
|
||||
fn test_find_export_function() {
|
||||
// let find_function_str = ProcName::Named("test_def_add".to_string());
|
||||
let find_function_str = ProcName::Ordinal(2);
|
||||
// 1. 还是先映射
|
||||
use pe_parse::pe::ReadOnlyPE;
|
||||
let file = std::fs::OpenOptions::new()
|
||||
@@ -70,6 +71,14 @@ mod test {
|
||||
.unwrap();
|
||||
let mmap = unsafe { Mmap::map(&file).unwrap() };
|
||||
let result_rva = mmap.get_export_function_rva(find_function_str).unwrap();
|
||||
println!("Find Function RVA: {:#x}", result_rva);
|
||||
match result_rva {
|
||||
None => {
|
||||
println!("Can't find the function");
|
||||
return;
|
||||
}
|
||||
Some(rva) => {
|
||||
println!("Find Function RVA: {:#x}", rva);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user