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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! 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 Modes
//!
//! ## Static Addresses (LockHandler, BytesSwitchHandler)
//! Use module-relative addresses and pointer chains. Architecture is auto-detected.
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::LockHandler;
//! use std::time::Duration;
//!
//! // Simple module + offset
//! let lock = LockHandler::new_lock(
//! "health_lock",
//! "game.exe+1000",
//! 100i32,
//! Duration::from_millis(100),
//! )?;
//!
//! // Multi-level pointer chain
//! let lock2 = LockHandler::new_lock(
//! "ammo_lock",
//! "game.exe+5000->2FC->30",
//! 999i32,
//! Duration::from_millis(50),
//! )?;
//! # Ok::<_, Box<dyn std::error::Error>>(())
//! ```
//!
//! ## AOB Pattern Scanning (TrampolineHookHandler - Recommended!)
//! Use byte patterns that resolve at runtime. Most robust across game updates.
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::TrampolineHookHandler;
//!
//! let hook = TrampolineHookHandler::new_hook_aob(
//! "skill_hook",
//! "48 89 5C 24", // AOB pattern
//! vec![0x90, 0x90],
//! 5,
//! )?;
//! # Ok::<_, Box<dyn std::error::Error>>(())
//! ```
//!
//! # Quick Start
//! ```no_run
//! use win_auto_utils::memory_manager::builtin::{LockHandler, BytesSwitchHandler, TrampolineHookHandler};
//! use std::time::Duration;
//!
//! // Method 1: Static address lock
//! let lock_handler = LockHandler::new_lock(
//! "health_lock",
//! "game.exe+1000->2FC",
//! vec![0x64, 0x00, 0x00, 0x00],
//! Duration::from_millis(100),
//! )?;
//!
//! // Method 2: NOP patch with static address
//! let nop_handler = BytesSwitchHandler::new_nop_switch(
//! "disable_feature",
//! "game.exe+2000",
//! 6,
//! )?;
//!
//! // Method 3: Trampoline hook with AOB (recommended for hooks!)
//! let shellcode_bytes = vec![0x90, 0x90];
//! let hook_handler = TrampolineHookHandler::new_hook_aob(
//! "skill_hook",
//! "48 89 5C 24", // AOB pattern - works across updates!
//! shellcode_bytes,
//! 6,
//! )?;
//!
//! // Performance tip: All handlers cache resolved addresses automatically!
//! // First activate: resolves address (AOB scan or pattern parse)
//! // Subsequent activates: uses cached address (fast!)
//! // Cache is invalidated when PID changes
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
// Re-export handlers and configs
pub use AddressStrategy;
pub use ;
pub use ;
pub use ;