Skip to content

qwerty32123/Woy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Memory Process Scanner

A high-performance Rust application for scanning process memory using advanced techniques like Aho-Corasick algorithms and parallel processing.

🧠 Technical Overview



This scanner specializes in:
1. Efficient memory region querying with WinAPI
2. Multi-phase scanning algorithm optimization
3. Parallel processing with Rayon
4. Pattern matching with Aho-Corasick automata
5. Detailed performance profiling

Project architecture:

src/
├── main.rs         # Application entry point and orchestration
├── profiler.rs     # Performance measurement and reporting
├── process_reader.rs # WinAPI memory access utilities
└── scanning.rs     # Core scanning algorithms

🚦 How It Works

Scanning Workflow

graph TD
    A[Query Memory Regions] --> B[Find Type Objects]
    B --> C[Find Class Candidates]
    C --> D[Validate Candidates]
    D --> E[Find Highest Instance]
    E --> F[Report Results]
Loading

Key Operations:

  1. Memory Region Identification
    Queries all readable memory regions using WinAPI's VirtualQueryEx

  2. Type Object Detection
    Scans for Python type objects by identifying self-referential pointers

  3. Candidate Screening
    Fast parallel scanning using pointer comparison heuristics

  4. Class Validation
    String-based verification with batch I/O optimization

  5. Instance Detection
    Aho-Corasick pattern matching to locate highest memory instance

⚙️ Features

  • Blazing Fast Scanning
    Processes memory at GB/s speeds using 4MB chunks
  • Multi-threaded Processing
    Utilizes all CPU cores with Rayon parallel iterators
  • WinAPI Memory Access
    Direct process memory reading with ReadProcessMemory
  • Accurate Pattern Matching
    Aho-Corasick algorithm for efficient byte scanning
  • Detailed Profiling
    Nanosecond-ll timing and memory throughput reporting
  • Error Resilience
    Continues through inaccessible memory regions

📦 Usage

# Clone repository
git clone https://github.com/yourusername/memory-scanner.git
cd memory-scanner

# Build release version (optimized)
cargo build --release

# Run scanner
.\target\release\memory-scanner.exe

⚙️ Configuration

Edit constants in main.rs:

const _PID: u32 = 6876;         // Target Process ID
const CHUNK_SIZE: usize = 4 * 1024 * 1024;  // Memory chunk size
const MAX_STRING_LEN: usize = 256;  // Maximum string length

📊 Performance Metrics

--- Profiling Report ---
Total run time: 2.147s 
Total memory scanned: 6.37 GB
Throughput: 2.96 GB/s

Pass Timings:
- Regions Query............ 0.038s (1.8%)
- Type Object Scanning..... 0.847s (39.5%)
- Candidate Collection..... 0.932s (43.4%)
- Validation.............. 1.423s (66.3%)
- Instance Detection...... 0.791s (36.8%)

📝 Sample Output

Starting Memory Process Scanner
Using PID: 6876

Successfully opened process handle: 0x201

Querying memory regions...
-> Found 87 readable regions (2.11 GB)

Pass 1: Finding type objects...
-> Found 312 type objects in 0.847s

Pass 2: Finding class candidates...
-> Collected 1427 candidates in 0.932s

Validating candidates...
-> Confirmed 3 target classes in 1.423s

Pass 3: Finding highest instance...
-> Located highest instance at 0x7FFD4C8DB140

Scan completed in 2.147s

🔧 Dependencies

  • rayon - Parallel processing
  • aho-corasick - Optimized pattern matching
  • winapi - Windows system bindings

📜 License

MIT License - Free for educational and personal use

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages