Skip to content

Commit f50d95a

Browse files
authored
Merge pull request #607 from NotRequiem/dev
NVRAM boot manager check fix
2 parents d810d74 + fded49d commit f50d95a

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/vmaware.hpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10172,31 +10172,6 @@ struct VM {
1017210172
else if (var_name_view == L"KEKDefault") (void)read_variable_to_buffer(std::wstring(var_name_view), current_var->VendorGuid, kek_default_buf, kek_default_len);
1017310173
else if (var_name_view == L"KEK") (void)read_variable_to_buffer(std::wstring(var_name_view), current_var->VendorGuid, kek_buf, kek_len);
1017410174

10175-
if (var_name_view == L"Boot0000") { // should be Windows Boot Manager
10176-
BYTE* boot_buf = nullptr; SIZE_T boot_len = 0;
10177-
if (read_variable_to_buffer(var_name_view, current_var->VendorGuid, boot_buf, boot_len)) {
10178-
bool anomaly = (boot_len < 6);
10179-
if (!anomaly) {
10180-
unsigned short fpl_len = 0;
10181-
memcpy(&fpl_len, boot_buf + 4, sizeof(fpl_len));
10182-
// we could also check if loadOptionsLength is 136
10183-
if (fpl_len != 116) anomaly = true;
10184-
}
10185-
10186-
if (boot_buf) {
10187-
PVOID b_ptr = boot_buf; SIZE_T z_sz = 0;
10188-
nt_free_memory(current_process_handle, &b_ptr, &z_sz, 0x8000);
10189-
}
10190-
10191-
if (anomaly) {
10192-
debug("NVRAM: Environment was loaded using a virtual boot loader"); // "virtual" here -> non genuine
10193-
detection_result = true;
10194-
should_break_loop = true;
10195-
break;
10196-
}
10197-
}
10198-
}
10199-
1020010175
if (current_var->NextEntryOffset == 0) break;
1020110176
const SIZE_T next_entry_off = static_cast<SIZE_T>(current_var->NextEntryOffset);
1020210177
const size_t next_var_offset = current_offset + next_entry_off;

0 commit comments

Comments
 (0)