βββ βββββββ ββββ ββββββ βββ βββ ββββββ βββββββ ββββββββ βββββββ
βββ ββββββββ ββββββββββββββββ βββββββββββββββββββββββββββ ββββββββ
βββ βββββββββββββββββββββββββ ββ βββββββββββββββββββββββββ βββ
ββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββ
βββββββ βββ βββ ββββββ ββββββββββββββββ ββββββ βββββββββββ ββββββββ
βββββ βββ ββββββ βββ ββββββββ βββ ββββββ βββββββββββ βββββββ
VMAware-C is a pure C port of the VMAware C++ library for virtual machine detection on Windows.
β οΈ Note: This is an AI-generated port created by GitHub Copilot (Claude). It is inspired by and based on the original VMAware project by kernelwernel.
- Pure C11 - No C++ dependencies, compatible with any C compiler
- Windows-focused - Optimized for Windows VM detection
- 40+ Detection Techniques - CPUID, registry, drivers, timing, and more
- 70+ VM Brands - VMware, VirtualBox, Hyper-V, QEMU, KVM, and many others
- Lightweight - ~5,500 lines of code, no external dependencies
- Memoized - Results are cached for performance
- MIT Licensed - Free for any use
#include "vmaware.h"
#include <stdio.h>
int main(void) {
if (vm_detect(VM_DEFAULT)) {
printf("Virtual machine detected!\n");
} else {
printf("Running on baremetal\n");
}
printf("VM name: %s\n", vm_brand(VM_DEFAULT));
printf("VM type: %s\n", vm_type(VM_DEFAULT));
printf("VM certainty: %d%%\n", vm_percentage(VM_DEFAULT));
return 0;
}Virtual machine detected!
VM name: VirtualBox
VM type: Hypervisor (type 2)
VM certainty: 100%
Simply copy the src/ folder to your project and include vmaware.h:
#include "vmaware.h"git clone https://github.com/your-repo/vmaware-c.git
cd vmaware-c
mkdir build && cd build
cmake ..
cmake --build .cl /I src src\*.c /Fe:vmaware_cli.exegcc -Wall -Wextra -std=c11 -I src src/*.c -o vmaware_cli.exe| Function | Description | Return |
|---|---|---|
vm_detect(flags) |
Check if running in a VM | bool |
vm_brand(flags) |
Get detected VM brand name | const char* |
vm_type(flags) |
Get VM type description | const char* |
vm_percentage(flags) |
Get detection certainty (0-100) | uint8_t |
vm_detected_count() |
Count of triggered techniques | uint8_t |
vm_conclusion(flags) |
Human-readable conclusion | const char* |
| Flag | Description |
|---|---|
VM_DEFAULT |
Run all default techniques |
VM_ALL |
Run ALL techniques (including risky ones) |
VM_HIGH_THRESHOLD |
Require higher certainty for detection |
// Check a specific technique
if (vm_check_technique(VM_HYPERVISOR_BIT)) {
printf("Hypervisor bit is set!\n");
}| ID | Technique | Description | Points |
|---|---|---|---|
VM_VMID |
CPUID Vendor ID | Check for VM vendor strings | 100 |
VM_CPU_BRAND |
CPU Brand String | VM indicators in brand | 95 |
VM_HYPERVISOR_BIT |
Hypervisor Bit | CPUID ECX.31 flag | 100 |
VM_HYPERVISOR_STR |
Hypervisor String | Hypervisor brand length | 100 |
VM_BOCHS_CPU |
Bochs Detection | Bochs emulator oversights | 100 |
VM_TIMER |
RDTSC Timing | Execution timing analysis | 100 |
VM_THREAD_MISMATCH |
Thread Count | CPU thread verification | 50 |
VM_CPUID_SIGNATURE |
CPUID Signature | Known VM signatures | 95 |
VM_KGT_SIGNATURE |
Intel KGT | Intel KGT hypervisor | 80 |
| ID | Technique | Description | Points |
|---|---|---|---|
VM_DLL |
DLL Check | VM-related DLLs | 45 |
VM_WINE |
Wine Detection | Wine compatibility layer | 85 |
VM_MUTEX |
Mutex Objects | VM mutex names | 85 |
VM_VIRTUAL_REGISTRY |
Registry Keys | VM registry entries | 65 |
VM_DRIVERS |
Driver Check | VM driver files | 65 |
VM_DISK_SERIAL |
Disk Serial | VM disk identifiers | 60 |
VM_DISPLAY |
Display Adapter | VM graphics adapters | 35 |
VM_VMWARE_BACKDOOR |
VMware Backdoor | VMware I/O port | 100 |
VM_TRAP |
Trap Flag | Debugger detection | 100 |
| ... | ... | See full list | ... |
VMAware-C can detect 70+ virtualization technologies:
- VMware (Workstation, Fusion, ESXi)
- VirtualBox
- Microsoft Hyper-V
- QEMU/KVM
- Xen
- Parallels
- Bochs
- bhyve
- Amazon AWS (Nitro, EC2)
- Microsoft Azure
- Google Cloud (GCE)
- Oracle Cloud
- Alibaba Cloud
- Cuckoo Sandbox
- Sandboxie
- Windows Sandbox
- Any.Run
- Joe Sandbox
- Hybrid Analysis
- Wine
- QEMU (user-mode)
- DOSBox
- Docker
- Podman
- WSL/WSL2
- LXC
vmaware_c/
βββ src/
β βββ vmaware.h # Main public header (API + enums)
β βββ vmaware.c # Public API implementation
β βββ vmaware_core.h # Detection engine header
β βββ vmaware_core.c # Detection engine + x86 techniques
β βββ vmaware_win.h # Windows techniques header
β βββ vmaware_win.c # Windows-specific techniques
β βββ vmaware_cpu.h # CPU operations header
β βββ vmaware_cpu.c # CPUID, brand databases
β βββ vmaware_memo.h # Memoization header
β βββ vmaware_memo.c # Caching implementation
β βββ vmaware_util.h # Utilities header
β βββ vmaware_util.c # Helper functions
β βββ cli.c # CLI application
βββ test/
β βββ test_main.c # Test suite
βββ docs/
β βββ documentation.md # Full documentation
βββ CMakeLists.txt # CMake build file
βββ LICENSE # MIT License
βββ README.md # This file
The CLI tool provides a comprehensive VM analysis:
# Build
gcc -Wall -Wextra -O2 -std=c11 -I src src/*.c -o vmaware.exe
# Run
./vmaware.exe ===== VMAware C Port =====
[CONCLUSION]: Running on baremetal (not a VM)
[DETECTED VMs]:
None
[DETECTION DETAILS]:
VM certainty: 0%
Techniques triggered: 0
[TECHNIQUES]:
VM_HYPERVISOR_BIT .... not detected
VM_CPUID_SIGNATURE ... not detected
VM_CPU_BRAND ......... not detected
...
// Create custom flagset
vm_flagset flags;
vm_flagset_clear_all(&flags);
// Enable specific techniques
vm_flagset_set(&flags, VM_HYPERVISOR_BIT);
vm_flagset_set(&flags, VM_CPUID_SIGNATURE);
vm_flagset_set(&flags, VM_VMWARE_BACKDOOR);
// Run detection
if (vm_detect_with_flags(&flags)) {
printf("VM detected with custom checks\n");
}// Use defaults but exclude risky techniques
vm_flagset flags;
vm_flagset_set_all(&flags);
vm_flagset_clear(&flags, VM_VMWARE_BACKDOOR); // Skip backdoor check
bool is_vm = vm_detect_with_flags(&flags);// Clear memoization cache for fresh detection
vm_reset();| Feature | VMAware (C++) | VMAware-C |
|---|---|---|
| Language | C++11+ | C11 |
| Platforms | Windows, Linux, macOS | Windows only |
| Techniques | ~90 | ~40 |
| Header-only | Yes | No (multi-file) |
| Dependencies | None | None |
| VM Brands | 70+ | 70+ |
Generated by: GitHub Copilot (Claude AI) - March 2026
This is an AI-assisted port of the original VMAware library. While functional, it may not include all features or optimizations of the original C++ version.
VMAware - https://github.com/kernelwernel/VMAware
- kernelwernel - Creator and maintainer
- Requiem (NotRequiem) - Co-developer
- All original contributors listed in the VMAware repository
This project is licensed under the MIT License - see the LICENSE file.
This software is provided for educational and legitimate security research purposes only. The authors are not responsible for any misuse or damage caused by this software.
Do not use this library for malicious purposes.
Contributions are welcome! Please feel free to:
- Report bugs or issues
- Suggest new detection techniques
- Improve documentation
- Submit pull requests
- Original VMAware (C++)
- VMAware Documentation
- Al-Khaser - Anti-malware research tool
- pafish - Paranoid Fish
If you find this project useful, please consider starring the original VMAware project!