Skip to content

Commit 11cc5a6

Browse files
committed
fix: added correct colour to type message in CLI and corrected naming for brand_enum::INVALID
1 parent 4f4e61a commit 11cc5a6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static void general(
10381038
type = "Sandbox";
10391039
}
10401040

1041-
if (type == VM::brands::NULL_BRAND) {
1041+
if (type == VM::brands::NULL_BRAND || type == VM::brands::HYPERV_ROOT) {
10421042
current_color = red;
10431043
} else {
10441044
current_color = green;

src/vmaware.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ struct VM {
664664
};
665665

666666
enum class brand_enum : u8 {
667-
UNKNOWN,
667+
INVALID,
668668
VBOX,
669669
VMWARE,
670670
VMWARE_EXPRESS,
@@ -4514,7 +4514,7 @@ struct VM {
45144514
// but we must also nullify the result if the score is above 0,
45154515
// which would most likely indicate a hardened VM instead and return "Unknown".
45164516
if (active_count == 1) {
4517-
enum brand_enum initial_brand = brand_enum::UNKNOWN;
4517+
enum brand_enum initial_brand = brand_enum::INVALID;
45184518

45194519
for (const auto brand : active_brands) {
45204520
if (brand.second == 0) {
@@ -4540,7 +4540,7 @@ struct VM {
45404540
if (active_count > 1) {
45414541
remove(brand_enum::HYPERV_ROOT);
45424542
remove(brand_enum::NULL_BRAND);
4543-
remove(brand_enum::UNKNOWN);
4543+
remove(brand_enum::INVALID);
45444544
}
45454545

45464546
// this bitset acts as an abstraction layer for the merging stage of this function.
@@ -4643,7 +4643,7 @@ struct VM {
46434643

46444644
static const char* brand_enum_to_string(const brand_enum brand) {
46454645
switch (brand) {
4646-
case brand_enum::UNKNOWN: return "Invalid";
4646+
case brand_enum::INVALID: return "Invalid";
46474647
case brand_enum::VBOX: return VM::brands::VBOX;
46484648
case brand_enum::VMWARE: return VM::brands::VMWARE;
46494649
case brand_enum::VMWARE_EXPRESS: return VM::brands::VMWARE_EXPRESS;
@@ -12558,7 +12558,7 @@ struct VM {
1255812558
case brand_enum::MINIVISOR: return "Hypervisor (type 1)";
1255912559
case brand_enum::HYPERV_ROOT: return "Host machine"; // This refers to the type 1 hypervisor where Windows normally runs under, we put "Unknown" to clarify you're not running under a VM if this is detected
1256012560
case brand_enum::NULL_BRAND: return "Unknown";
12561-
case brand_enum::UNKNOWN: return "Invalid";
12561+
case brand_enum::INVALID: return "Invalid";
1256212562
}
1256312563

1256412564
return "Invalid";

0 commit comments

Comments
 (0)