Skip to content

Commit e9c50df

Browse files
author
Requiem
committed
feat: Added EDK II (TianoCore) EFI checks
1 parent ab84d93 commit e9c50df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vmaware.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9359,6 +9359,15 @@ struct VM {
93599359
else if (nameView == L"KEKDefault") (void)read_var_to_buf(std::wstring(nameView), varName->VendorGuid, kekDefaultBuf, kekDefaultLen);
93609360
else if (nameView == L"KEK") (void)read_var_to_buf(std::wstring(nameView), varName->VendorGuid, kekBuf, kekLen);
93619361

9362+
// https://github.com/tianocore/edk2/blob/af9cc80359e320690877e4add870aa13fe889fbe/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h
9363+
if (nameView == L"certdb" || nameView == L"certdbv") {
9364+
debug("NVRAM: EDK II (TianoCore) detected");
9365+
SIZE_T z = 0;
9366+
pNtFreeVirtualMemory(hCurrentProcess, &enumBase, &z, 0x8000);
9367+
cleanup();
9368+
return true; // we cant return a brand here since its used in VMWare, QEMU with OVMF, VirtualBox, etc
9369+
}
9370+
93629371
if (varName->NextEntryOffset == 0) break;
93639372
const SIZE_T ne = static_cast<SIZE_T>(varName->NextEntryOffset);
93649373
const size_t nextOffset = offset + ne;

0 commit comments

Comments
 (0)