Fix clippy warnings - use iterator and saturating_add
This commit is contained in:
@@ -181,9 +181,9 @@ mod platform {
|
|||||||
// Check each critical API for hooks
|
// Check each critical API for hooks
|
||||||
for (module_name, func_name) in CRITICAL_APIS {
|
for (module_name, func_name) in CRITICAL_APIS {
|
||||||
// Find the module in target process
|
// Find the module in target process
|
||||||
for i in 0..module_count {
|
for module in modules.iter().take(module_count) {
|
||||||
let mut name_buffer = [0u16; 256];
|
let mut name_buffer = [0u16; 256];
|
||||||
if GetModuleBaseNameW(handle, modules[i], &mut name_buffer) == 0 {
|
if GetModuleBaseNameW(handle, *module, &mut name_buffer) == 0 {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -468,9 +468,7 @@ mod platform {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
address = (mbi.BaseAddress as usize)
|
address = (mbi.BaseAddress as usize).saturating_add(mbi.RegionSize);
|
||||||
.checked_add(mbi.RegionSize)
|
|
||||||
.unwrap_or(usize::MAX);
|
|
||||||
|
|
||||||
if address == usize::MAX {
|
if address == usize::MAX {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user