kernelwernel / VMAware

VM detection library and tool
GNU General Public License v3.0
291 stars 28 forks source link
anticheat bochs cpp cpp-library detect detection hyperv hypervisor hypervisor-detection kvm library qemu vbox virtualbox vm vm-detect vm-detection vmm vmware wine

VMAware



VMAware (VM + Aware) is a cross-platform C++ library for virtual machine detection.

The library is:

[!NOTE] The library doesn't guarantee it'll be accurate. If you found a false positive or a false negative then please create an issue with information on what your VM is, what OS you're using, and other relevant details.


Example 🧪

#include "vmaware.hpp"
#include <iostream>

int main() {
    if (VM::detect()) {
        std::cout << "Virtual machine detected!" << std::endl;
        std::cout << "VM name: " << VM::brand() << std::endl;
    } else {
        std::cout << "Running in baremetal" << std::endl;
    }

    std::cout << "VM certainty: " << (int)VM::percentage() << "%" << std::endl;
}


Structure ⚙️



CLI tool 🔧

This project also provides a tiny, but handy CLI tool utilising the full potential of what the library can do. It'll give you all sorts of details about the environment it's running under.


Installation 📥

To install the library, download the vmaware.hpp file in the latest release section to your project. No CMake or shared object linkages are necessary, it's literally that simple.

However, if you want the full project (globally accessible headers with and the CLI tool), follow these commands:

git clone https://github.com/kernelwernel/VMAware 
cd VMAware

FOR LINUX:

sudo dnf/apt/yum update -y # change this to whatever your distro is
mkdir build
cd build
cmake ..
sudo make install

FOR WINDOWS:

cmake -S . -B build/ -G "Visual Studio 16 2019"

If you just want the binaries, head over to the latest release section


Documentation 📒

You can view the full docs here. Trust me, it's not too intimidating ;)


Q&A ❓


Issues and pull requests 📬

If you have any suggestions, ideas, or any sort of contribution, feel free to ask! I'll be more than happy to discuss in the issue section. If you want to personally ask something in private, my discord is kr.nl

And if you found this project useful, a star would be appreciated :)


Projects using VMAware

CrashLoggerSSE - SKSE/SKSEVR plugin that generates crash logs

If you know a project, or if you're working on a project that uses VMAware, let me know and I'll add it here.


Credits and contributors ✒️


Legal 📜

I am not responsible nor liable for any damage you cause through any malicious usage of this project.

License: GPL-3.0