Fix Windows/macOS build errors - add Win32_UI feature and remove unused imports
This commit is contained in:
@@ -26,6 +26,7 @@ windows = { version = "0.58", features = [
|
||||
"Win32_System_Memory",
|
||||
"Win32_System_LibraryLoader",
|
||||
"Win32_Security",
|
||||
"Win32_UI_WindowsAndMessaging",
|
||||
] }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{MemoryRegion, ProcessInfo, Result};
|
||||
|
||||
#[cfg(windows)]
|
||||
use crate::memory::{read_pe_header_info, validate_pe_header, PEHeaderValidation};
|
||||
use crate::memory::{validate_pe_header, PEHeaderValidation};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct HollowingDetection {
|
||||
|
||||
@@ -73,10 +73,9 @@ pub struct HookDetectionResult {
|
||||
mod platform {
|
||||
use super::{HookDetectionResult, HookInfo, HookType};
|
||||
use crate::{GhostError, Result};
|
||||
use std::collections::HashMap;
|
||||
use windows::Win32::Foundation::CloseHandle;
|
||||
use windows::Win32::System::Diagnostics::Debug::ReadProcessMemory;
|
||||
use windows::Win32::System::LibraryLoader::{GetModuleHandleW, GetProcAddress, LoadLibraryW};
|
||||
use windows::Win32::System::LibraryLoader::{GetModuleHandleW, GetProcAddress};
|
||||
use windows::Win32::System::ProcessStatus::{
|
||||
EnumProcessModulesEx, GetModuleBaseNameW, GetModuleInformation, LIST_MODULES_ALL,
|
||||
MODULEINFO,
|
||||
@@ -111,7 +110,6 @@ mod platform {
|
||||
pub fn detect_hook_injection(target_pid: u32) -> Result<HookDetectionResult> {
|
||||
let mut hooks = Vec::new();
|
||||
let mut suspicious_count = 0;
|
||||
let mut global_hooks = 0;
|
||||
let mut inline_hooks = 0;
|
||||
|
||||
// Detect inline hooks in critical APIs
|
||||
|
||||
@@ -49,7 +49,7 @@ impl fmt::Display for ProcessInfo {
|
||||
mod platform {
|
||||
use super::ProcessInfo;
|
||||
use anyhow::{Context, Result};
|
||||
use windows::Win32::Foundation::{CloseHandle, HANDLE};
|
||||
use windows::Win32::Foundation::CloseHandle;
|
||||
use windows::Win32::System::Diagnostics::ToolHelp::{
|
||||
CreateToolhelp32Snapshot, Process32FirstW, Process32NextW, PROCESSENTRY32W,
|
||||
TH32CS_SNAPPROCESS,
|
||||
|
||||
Reference in New Issue
Block a user