Skip to content

Commit 0b33602

Browse files
committed
fix: hyper_x guardrail added
1 parent cbca23a commit 0b33602

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/vmaware.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12693,7 +12693,13 @@ struct VM {
1269312693
};
1269412694

1269512695
const bool hv_present = (check(VM::HYPERVISOR_BIT) || check(VM::HYPERVISOR_STR));
12696-
const bool has_hyper_x = (detected_brand(VM::HYPERVISOR_BIT) == brand_enum::HYPERV_ARTIFACT);
12696+
const bool has_hyper_x = []() {
12697+
if (check(VM::HYPERVISOR_BIT)) {
12698+
return false;
12699+
}
12700+
12701+
return memo::cache_table[VM::HYPERVISOR_BIT].brand_name == brand_enum::HYPERV_ARTIFACT;
12702+
}();
1269712703

1269812704
// rule 1: if VM::FIRMWARE is detected, so should VM::HYPERVISOR_BIT or VM::HYPERVISOR_STR
1269912705
const enum brand_enum firmware_brand = detected_brand(VM::FIRMWARE);

0 commit comments

Comments
 (0)