A high-performance, low-latency aimbot application written in Python 3.13, leveraging modern multiprocessing and multithreading for optimal performance. Features real-time screen capture, GPU-accelerated target detection, and adaptive resource management.
- Introduction
- Features
- Prerequisites
- Installation
- Usage
- Configuration
- Project-Structure
- Additional-Information
PewPy is a sophisticated aimbot application built with Python 3.13, designed for maximum performance through advanced concurrency patterns and GPU acceleration. The application uses DirectX screen capture, OpenCV-based target detection, and low-latency input control to provide precise aiming assistance.
- Initialization :
- Load configuration from YAML files
- Initialize DirectX screen capture
- Set up GPU-accelerated target detection
- Start safety monitoring and hotkey handlers
- Launch performance overlay
- Main Loop :
- Monitor safety state and hotkeys
- Capture screen frames at high FPS
- Process frames for target detection
- Calculate smooth mouse movements
- Update real-time performance statistics
- Apply adaptive resource optimization
- High-Performance Screen Capture: DirectX desktop duplication API for minimal latency
- GPU-Accelerated Detection: OpenCV with CUDA support for real-time target detection
- Adaptive Resource Management: Dynamic CPU/GPU utilization based on system load
- Real-time Overlay: Tkinter-based overlay with performance metrics and controls
- Safety First: Emergency stop hotkeys and comprehensive safety monitoring
- Configuration Hot-Reload: Live configuration updates without restart
- Python 3.13 Optimized: Leverages new multiprocessing and GIL improvements
Asahi Linux (Fedora)
- ...update
Windows
- Windows 10/11 (64-bit)
- Python 3.13=+
- NVIDIA GPU with CUDA support (optional, for GPU acceleration)
- DirectX 11 compatible graphics card
MacOS
- ...update
- clone the repo & cd in
- run setup script
python setup.py
- launch with
python src/main.py - Control with Hotkeys :
- F2 : Toggle on/off
- F10 : Emergency stop
- F12 : Graceful Exit
- Ctrl + Alt + O : Toggle overlay visibility
- Ctrl + Alt + P : Cycle performance modes
- Moniter Performance with overlay
- config/default.yaml: Main application settings
- config/performance.yaml: Performance and optimization settings
PewPy/
- config/
default.yamlperformance.yaml
- src/
- core/
__init__.pyframe_pipeline.pyperformance_moniter.pyresource_manager.pytask_dispatcher.py
- ui/
__init__.pyconfig_manager.pyhotkey_handler.pyoverlay.py
- utils/
__init__.pyprofiling.pyserialization.pyshared_memory.py
- workers/
__init__.pyinput_controller.pysafety_moniter.pyscreen_capturer.pytarget_detector.py
main.py
- core/
.gitignoreReadMe.mdrequirements.txt
This portion is for logging or storing notes relevent to the project and its scope.
Performance Optimizations
- Capture Pipeline
- ROI cropping during texture mapping (avoid full-screen conversion)
- Direct BGRA→HSV conversion (eliminate intermediate BGR step)
- DXGI desktop duplication with partial framebuffer updates
- Detection System
- Dynamic downscaling (adjust based on FPS: 0.5x → 0.8x)
- CUDA-accelerated contour detection (cv::cuda::findContours)
- Background subtraction for moving targets
- Temporal coherence (reuse previous frame's mask)
- Input Pipeline
- Replace Sleep() with high-precision timers (std::chrono)
- Mouse movement prediction (linear extrapolation)
- Configurable smoothing curves (easing functions)
Core Features
- Dynamic Targeting
- Kalman filtering for target trajectory prediction
- Multi-contour analysis (closest to crosshair, largest area)
- HSV range auto-calibration (F3 to sample target area)
- Adaptive ROI
- ROI centering around last detection
- Dynamic sizing based on target velocity
- Manual ROI adjustment via config
- Input Modes
- Raw input API support (for protected games)
- Absolute/relative mouse mode toggle
- Humanizer module (randomized movement curves) ?
Configuration & Usability
- Config System
- INI/JSON configuration (color ranges, ROI, hotkeys, smoothing)
- Runtime reloading (F5 to refresh config)
- CLI argument parsing
- Diagnostic UI
- DirectX overlay (ROI boundaries, target lock indicator)
- Performance metrics (FPS, processing time)
- Detection preview window (debug mode)
- Calibration Tools
- HSV range tester with sliders
- ROI visual positioning tool
- Mouse sensitivity profiler
Code Quality & Maintenance
- Platform Abstraction
- Interface classes for input/capture (enable Linux/Wine support)
- CMake options for CUDA/DirectX
- Error code standardization
- Build System
- Fix target names (cAimbot vs AimTrainer)
- OpenCV CUDA conditional compilation
- CI/CD pipeline (GitHub Actions)
- Testing
- Unit tests for coordinate transformations
- Capture simulation framework
- Performance benchmarking suite
Anti-Cheat Mitigations
- Obfuscation
- Randomize window titles/class names
- DirectX hook masking
- Mouse event spoofing (hardware IDs)
- Behavioral
- Variable activation delays
- "Human" jitter simulation
- Process hollowing techniques
Roadmap
Phase 1 (Stability): Resource leaks, thread safety, config system
Phase 2 (Performance): CUDA optimization, pipeline refactoring
Phase 3 (Features): Prediction algorithms, diagnostic UI
Phase 4 (Stealth): Anti-cheat evasions, driver-level input