Skip to content

Commit

Permalink
hyperv_fucker prototype 6
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelwernel committed Aug 9, 2024
1 parent ea26466 commit 880a6dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vmaware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1619,8 +1619,11 @@ struct VM {
return result;
};

u32 eax, unused = 0;
cpu::cpuid(eax, unused, unused, unused, cpu::leaf::hypervisor);
char out[sizeof(int32_t) * 4 + 1] = { 0 }; // e*x size + number of e*x registers + null terminator
cpu::cpuid((int*)out, cpu::leaf::hypervisor);

const u32 eax = static_cast<u32>(out[0]);

core_debug("HYPERV_FUCKER: eax = ", eax);

if (eax == 12) {
Expand Down Expand Up @@ -2249,7 +2252,7 @@ struct VM {
char out[sizeof(int32_t) * 4 + 1] = { 0 }; // e*x size + number of e*x registers + null terminator
cpu::cpuid((int*)out, cpu::leaf::hypervisor);

debug("HYPERV_STR: eax: ", static_cast<u32>(out[0]),
debug("HYPERVISOR_STR: eax: ", static_cast<u32>(out[0]),
"\nebx: ", static_cast<u32>(out[1]),
"\necx: ", static_cast<u32>(out[2]),
"\nedx: ", static_cast<u32>(out[3])
Expand Down

0 comments on commit 880a6dd

Please sign in to comment.