diff --git a/ghost-core/src/error.rs b/ghost-core/src/error.rs new file mode 100644 index 0000000..a1dba72 --- /dev/null +++ b/ghost-core/src/error.rs @@ -0,0 +1,27 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum GhostError { + #[error("Process access denied (PID: {pid})")] + AccessDenied { pid: u32 }, + + #[error("Process not found (PID: {pid})")] + ProcessNotFound { pid: u32 }, + + #[error("Memory enumeration failed: {reason}")] + MemoryEnumeration { reason: String }, + + #[error("Thread enumeration failed: {reason}")] + ThreadEnumeration { reason: String }, + + #[error("Insufficient privileges for operation")] + InsufficientPrivileges, + + #[error("Windows API error: {message}")] + WindowsApi { message: String }, + + #[error("Detection engine error: {message}")] + Detection { message: String }, +} + +pub type Result = std::result::Result; \ No newline at end of file diff --git a/ghost-core/src/lib.rs b/ghost-core/src/lib.rs index dea59bc..8708c60 100644 --- a/ghost-core/src/lib.rs +++ b/ghost-core/src/lib.rs @@ -1,9 +1,11 @@ pub mod detection; +pub mod error; pub mod memory; pub mod process; pub mod thread; pub use detection::{DetectionEngine, DetectionResult, ThreatLevel}; +pub use error::{GhostError, Result}; pub use memory::{MemoryProtection, MemoryRegion}; pub use process::ProcessInfo; pub use thread::ThreadInfo;