Skip to content

Commit 188ae11

Browse files
author
Requiem
committed
2 parents d50d0c0 + c1e9f23 commit 188ae11

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

assets/demo.png

86.3 KB
Loading

src/cli.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ static const char* color(const u8 score) {
467467
nsjail
468468
DBVM
469469
UTM
470+
Compaq FX!32
471+
Insignia RealPC
472+
Connectix Virtual PC
470473
)";
471474
std::exit(0);
472475
}
@@ -647,6 +650,9 @@ static const char* get_vm_description(const std::string& vm_brand) {
647650
{ brands::NSJAIL, "nsjail is a process isolation tool for Linux. It utilizes Linux namespace subsystem, resource limits, and the seccomp-bpf syscall filters of the Linux kernel. It can be used for isolating networking services, CTF challenges, and containing invasive syscall-level OS fuzzers." },
648651
{ brands::DBVM, "DBVM is a ultra-lightweight virtual machine host that makes Windows run in a virtual machine so that Cheat Engine can operate at a higher level than the OS using a device driver. Instead of virtualizing devices it generally passes on interrupts unaltered meaning it has a very small impact on performance." },
649652
{ brands::UTM, "UTM for macOS is a free, open-source virtualization and emulation app that brings full-featured virtual machines to both Intel and Apple Silicon Macs. It employs Apple's Hypervisor virtualization framework to run ARM64 operating systems on Apple Silicon at near native speeds. On other architectures, it employs software emulation through QEMU." },
653+
{ brands::COMPAQ, "Compaq FX!32 is an emulator that is designed to run Win32 programs for the DEC instruction set architecture. Released in 1996, it was developed by developed by Digital Equipment Corporation (DEC) to support their Alpha microprocessors. It analyzed the way programs worked and, after the program ran, used binary translation to produce dynamic-link library (DLL) files of native Alpha code that the application could execute the next time it ran." },
654+
{ brands::INSIGNIA, "RealPC was an emulator for the Macintosh line of PCs. It emulated a Pentium-based PC to run Windows NT, Windows 95, and Windows 98 programs. It was discontinued in 2003." },
655+
{ brands::CONNECTIX, "Connectix VirtualPC was the predecessor to Microsoft's VirtualPC. Originally developed as a Macintosh application for System 7.5 and released by Connectix in June 1997, it supported various OS's such as Linux and old versions of Windows. It was bought by Microsoft in February 2003." },
650656
{ brands::NULL_BRAND, "Indicates no detectable virtualization brand. This result may occur on bare-metal systems, unsupported/obscure hypervisors, or when anti-detection techniques (e.g., VM escaping) are employed by the guest environment." }
651657
};
652658

@@ -1002,10 +1008,6 @@ static void general(
10021008

10031009
std::printf("\n");
10041010

1005-
#ifdef __VMAWARE_DEBUG__
1006-
std::cout << "[DEBUG] theoretical maximum points: " << VM::total_points << "\n";
1007-
#endif
1008-
10091011
// struct containing the whole overview of the VM data
10101012
VM::vmaware vm(VM::MULTIPLE, high_threshold, all, dynamic);
10111013

src/vmaware.hpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ namespace brands {
518518
static constexpr const char* NSJAIL = "nsjail";
519519
static constexpr const char* DBVM = "DBVM";
520520
static constexpr const char* UTM = "UTM";
521+
static constexpr const char* COMPAQ = "Compaq FX!32";
522+
static constexpr const char* INSIGNIA = "Insignia RealPC";
523+
static constexpr const char* CONNECTIX = "Connectix Virtual PC";
521524
}
522525

523526
#if (VMA_CPP >= 17)
@@ -659,7 +662,6 @@ struct VM {
659662
static constexpr u8 settings_count = MULTIPLE - HIGH_THRESHOLD + 1; // get number of settings technique flags
660663
static constexpr u8 INVALID = 255; // explicit invalid technique macro
661664
static constexpr u16 base_technique_count = HIGH_THRESHOLD; // original technique count, constant on purpose (can also be used as a base count value if custom techniques are added)
662-
static constexpr u16 maximum_points = 5510; // theoretical total points if all VM detections returned true (which is practically impossible)
663665
static constexpr u16 threshold_score = 150; // standard threshold score
664666
static constexpr u16 high_threshold_score = 300; // new threshold score from 150 to 300 if VM::HIGH_THRESHOLD flag is enabled
665667
static constexpr bool SHORTCUT = true; // macro for whether VM::core::run_all() should take a shortcut by skipping the rest of the techniques if the threshold score is already met
@@ -684,6 +686,7 @@ struct VM {
684686
// this is specifically meant for VM::detected_count() to
685687
// get the total number of techniques that detected a VM
686688
static u8 detected_count_num;
689+
static u16 technique_count; // get total number of techniques
687690

688691
static std::vector<enum_flags> disabled_techniques;
689692

@@ -1086,7 +1089,10 @@ struct VM {
10861089
{"IntelTDX ", brands::INTEL_TDX},
10871090
{"LKVMLKVMLKVM", brands::LKVM},
10881091
{"Neko Project", brands::NEKO_PROJECT},
1089-
{"NoirVisor ZT", brands::NOIRVISOR}
1092+
{"NoirVisor ZT", brands::NOIRVISOR},
1093+
{"Compaq FX!32", brands::COMPAQ},
1094+
{"Insignia 586", brands::INSIGNIA},
1095+
{"ConnectixCPU", brands::CONNECTIX}
10901096
};
10911097

10921098
const auto it = brand_map.find(brand_str);
@@ -4308,6 +4314,11 @@ struct VM {
43084314
#else
43094315
const std::string& brand = cpu::get_brand();
43104316

4317+
// easy shortcut for QEMU
4318+
if (brand.rfind("QEMU Virtual CPU version", 0) == 0) {
4319+
return core::add(brands::QEMU);
4320+
}
4321+
43114322
struct cstrview {
43124323
const char* data;
43134324
std::size_t size;
@@ -12170,10 +12181,6 @@ struct VM {
1217012181
// flags above, and get a total score
1217112182
const u16 points = core::run_all(flags, SHORTCUT);
1217212183

12173-
#if (VMA_CPP >= 23)
12174-
[[assume(points < maximum_points)]];
12175-
#endif
12176-
1217712184
u16 threshold = threshold_score;
1217812185

1217912186
// if high threshold is set, the bar
@@ -12212,10 +12219,6 @@ struct VM {
1221212219
// flags above, and get a total score
1221312220
const u16 points = core::run_all(flags, SHORTCUT);
1221412221

12215-
#if (VMA_CPP >= 23)
12216-
[[assume(points < maximum_points)]];
12217-
#endif
12218-
1221912222
u8 percent = 0;
1222012223
u16 threshold = threshold_score;
1222112224

@@ -12574,6 +12577,9 @@ struct VM {
1257412577
{ brands::BOCHS, "Emulator" },
1257512578
{ brands::BLUESTACKS, "Emulator" },
1257612579
{ brands::NEKO_PROJECT, "Emulator" },
12580+
{ brands::COMPAQ, "Emulator" },
12581+
{ brands::INSIGNIA, "Emulator" },
12582+
{ brands::CONNECTIX, "Emulator" },
1257712583
{ brands::QEMU, "Emulator/Hypervisor (type 2)" },
1257812584
{ brands::JAILHOUSE, "Partitioning Hypervisor" },
1257912585
{ brands::UNISYS, "Partitioning Hypervisor" },
@@ -12833,12 +12839,6 @@ struct VM {
1283312839

1283412840
};
1283512841
#pragma pack(pop)
12836-
12837-
12838-
static u16 technique_count; // get total number of techniques
12839-
#ifdef __VMAWARE_DEBUG__
12840-
static u16 total_points;
12841-
#endif
1284212842
};
1284312843

1284412844
// ============= EXTERNAL DEFINITIONS =============
@@ -12926,6 +12926,9 @@ std::array<VM::core::brand_entry, VM::core::MAX_BRANDS> VM::core::brand_scoreboa
1292612926
insert(brands::NSJAIL);
1292712927
insert(brands::DBVM);
1292812928
insert(brands::UTM);
12929+
insert(brands::COMPAQ);
12930+
insert(brands::INSIGNIA);
12931+
insert(brands::CONNECTIX);
1292912932
insert(brands::NULL_BRAND);
1293012933

1293112934
return arr;
@@ -12962,10 +12965,6 @@ std::size_t VM::memo::leaf_cache::next_index = 0;
1296212965
const char* VM::core::last_detected_brand = nullptr;
1296312966
VM::u8 VM::core::last_detected_score = 0;
1296412967

12965-
#ifdef __VMAWARE_DEBUG__
12966-
VM::u16 VM::total_points = 0;
12967-
#endif
12968-
1296912968
// these are basically the base values for the core::arg_handler function.
1297012969
// It's like a bucket that will collect all the bits enabled. If for example
1297112970
// VM::detect(VM::HIGH_THRESHOLD) is passed, the HIGH_THRESHOLD bit will be

0 commit comments

Comments
 (0)