A simple, educational Windows kernel-level hypervisor designed for learning and experimentation. This project demonstrates basic hypervisor concepts while providing a foundation for further development.
- VMX Initialization: Basic VMX setup and management
- Multi-Processor Support: Handles all system processors
- VM-exit Handling: Comprehensive exit reason routing
- Assembly Integration: Low-level assembly handlers
- Memory Management: EPT structure setup and management
- CPUID Filtering: Intercepts and handles CPUID instructions
- MSR Handling: Manages Model Specific Register access
- EPT Violations: Handles Extended Page Table violations
- Register Preservation: Maintains guest state integrity
- Debug & Logging: Comprehensive debugging system with file output
- Performance Monitoring: Cycle counting and statistics
- Configuration Management: Registry-based configuration
- Health Checks: System validation and diagnostics
- Modular Design: Easy to extend and modify
- Clear Documentation: Step-by-step learning path
- Safety Features: Built-in protection mechanisms
- Debugging Tools: Extensive logging and validation
SimpleHyper/
├── core/ # Core hypervisor logic
│ ├── simplehyper.h # Main header and structures
│ ├── simplehyper.c # Main hypervisor logic
│ └── vmx_setup.c # VMX initialization
├── handlers/ # VM-exit handlers
│ ├── cpuid_handler.c # CPUID instruction handling
│ └── msr_handler.c # MSR read/write handling
├── memory/ # Memory management
│ └── ept_manager.c # EPT setup and management
├── asm/ # Assembly code
│ └── vmx_handler.asm # VM-exit handler assembly
├── utils/ # Utility systems
│ ├── debug.c # Debug and logging system
│ ├── performance.c # Performance monitoring
│ └── config.c # Configuration management
└── docs/ # Documentation
- Intel VMX (Virtual Machine Extensions) support
- Multi-processor virtualization
- Guest/host state management
- VMCS (Virtual Machine Control Structure) configuration
- Extended Page Tables for memory virtualization
- Identity mapping for physical memory
- Page table entry management
- Memory protection framework
- Cycle-level performance monitoring
- VM-exit statistics tracking
- CPU utilization calculation
- Memory region validation
- Multi-level debug logging (ERROR, WARN, INFO, DEBUG, TRACE)
- File-based logging support
- Processor state dumping
- Health check validation
- Registry-based configuration
- Feature enable/disable flags
- Runtime configuration validation
- Default safety settings
- Visual Studio 2019 or later
- Windows Driver Kit (WDK) 10.0.19041.1 or later
- Windows 10/11 x64 system with VMX support
# Load the driver (requires administrator privileges)
sc create SimpleHyper type= kernel binPath= "C:\path\to\SimpleHyper.sys"
sc start SimpleHyper
# Unload the driver
sc stop SimpleHyper
sc delete SimpleHyper
The hypervisor automatically:
- Initializes VMX on all processors
- Sets up EPT identity mapping
- Begins monitoring VM-exits
- Logs debug information
Configuration can be modified through registry:
HKEY_LOCAL_MACHINE\SOFTWARE\SimpleHyper
Debug information is output to:
- Kernel debugger (if attached)
- Log file:
C:\SimpleHyper.log
(if enabled)
Performance statistics are available through:
- Debug output during operation
- Health check functions
- Performance dump functions
- System Instability: This is experimental software that can cause blue screen errors
- Test Environment: Only use in virtual machines or dedicated test systems
- Administrator Required: Driver installation requires administrator privileges
- VMX Support: Requires Intel processor with VMX support enabled in BIOS
- Default configuration disables dangerous features
- Comprehensive error checking
- Graceful failure handling
- Memory validation
- Modular Design: Each feature in separate modules
- Clear APIs: Well-documented function interfaces
- Error Handling: Comprehensive error checking
- Debug Support: Extensive logging and validation
- Add new VM-exit handlers in
handlers/
- Extend EPT functionality in
memory/
- Add utility functions in
utils/
- Implement security features in new modules
- Build Errors: Ensure WDK is properly installed
- Load Failures: Check VMX support and administrator privileges
- Blue Screens: Use in test environment only
- Performance Issues: Monitor VM-exit rates and adjust configuration
- Enable debug logging: Set
DebugLevel
in configuration - Check log file:
C:\SimpleHyper.log
- Use kernel debugger for detailed analysis
- Monitor performance statistics
This project is provided for educational purposes only. Use at your own risk.
This software is experimental and may cause system instability. Use only in controlled test environments. The authors are not responsible for any damage or data loss.
This is an educational project. Contributions should focus on:
- Improving documentation
- Adding educational features
- Enhancing safety mechanisms
- Providing learning examples