1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Built-in modifier handlers
//!
//! Provides ready-to-use handler implementations for common memory modification scenarios.
//!
//! # Available Handlers
//! - [`LockHandler`] - Memory locking with automatic value restoration
//! - [`BytesSwitchHandler`] - Bytecode switching (NOP patches, etc.)
//! - [`TrampolineHookHandler`] - Function hooking with trampoline support
//!
//! # Address Resolution
//! All handlers support two address resolution modes via `AddressSource`:
//!
//! ## Static Addresses (Traditional)
//! Use module-relative addresses or pointer chains:
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::LockHandler;
//! use win_auto_utils::memory_resolver::{AddressSource, MemoryAddress};
//! use std::time::Duration;
//!
//! let handler = LockHandler::new_lock_typed(
//! "health_lock".to_string(),
//! AddressSource::from_static(MemoryAddress::new_x86("game.exe+1000")?),
//! 100i32,
//! Duration::from_millis(100),
//! );
//! ```
//!
//! ## AOB Pattern Scanning (Dynamic)
//! Use byte patterns that resolve at runtime:
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::LockHandler;
//! use std::time::Duration;
//!
//! let handler = LockHandler::new_lock_aob_typed(
//! "health_lock".to_string(),
//! "48 89 5C ?? 48 89", // Pattern to scan for
//! 100i32,
//! Duration::from_millis(100),
//! )?;
//! ```
//!
//! # Quick Start
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::{LockHandler, BytesSwitchHandler, TrampolineHookHandler};
//! use win_auto_utils::memory_resolver::{AddressSource, MemoryAddress};
//! use std::time::Duration;
//!
//! // Method 1: Static address
//! let lock_handler = LockHandler::new_lock(
//! "health_lock".to_string(),
//! AddressSource::from_static(MemoryAddress::new_x86("game.exe+1000")?),
//! vec![0x64, 0x00, 0x00, 0x00],
//! Duration::from_millis(100),
//! );
//!
//! // Method 2: AOB pattern scanning
//! let nop_handler = BytesSwitchHandler::new_nop_switch_aob(
//! "disable_feature".to_string(),
//! "90 90 90 90 90 90", // NOP pattern
//! 6,
//! )?;
//!
//! // Method 3: Trampoline hook with AOB
//! let hook_handler = TrampolineHookHandler::new_x64_hook_aob(
//! "skill_hook".to_string(),
//! "48 89 5C 24", // Function prologue pattern
//! shellcode_bytes,
//! 6,
//! )?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
// Re-export handlers and configs
pub use ;
pub use ;
pub use ;