Skip to content

Commit a544916

Browse files
authored
Merge pull request #606 from kernelwernel/dev
Finishing touches for 2.6.0 release
2 parents 7c5cf99 + 26ac24a commit a544916

File tree

4 files changed

+10
-32
lines changed

4 files changed

+10
-32
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ The general rules are:
2424
- Keep indentations at a minimum
2525
- Don't create huge one-liners, try to break down statements line by line
2626
- Write as few lines as possible for what you're trying to achieve
27-
- Document your code and intentions very clearly, but don't overdo them for very obvious code.
28-
- Avoid `std::function`, `std::shared_ptr`, `std::bind`, `std::list`, or very obscure C++ features.
27+
- Document your code and intentions very clearly, but don't overdo them for very obvious code
28+
- Avoid `std::function`, `std::shared_ptr`, `std::bind`, `std::list`, or very obscure C++ features
2929
- Indent size should be 4 spaces
30+
- Use "We" instead of the first person when commenting
3031

3132
There are other formatting rules, which will be covered with a demonstration:
3233

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ And if you found this project useful, a star would be appreciated :)
303303
- [luukjp](https://github.com/luukjp)
304304
- [Randark](https://github.com/Randark-JMT)
305305
- [Scrut1ny](https://github.com/Scrut1ny)
306+
- [Lorenzo Rizzotti (Dreaming-Codes)](https://github.com/Dreaming-Codes)
306307

307308
<br>
308309

src/cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include "vmaware.hpp"
4949

5050
constexpr const char* ver = "2.6.0";
51-
constexpr const char* date = "January 2025";
51+
constexpr const char* date = "January 2026";
5252

5353
std::string bold = "\033[1m";
5454
std::string underline = "\033[4m";

src/vmaware.hpp

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ██║ ██║██╔████╔██║███████║██║ █╗ ██║███████║██████╔╝█████╗
55
* ╚██╗ ██╔╝██║╚██╔╝██║██╔══██║██║███╗██║██╔══██║██╔══██╗██╔══╝
66
* ╚████╔╝ ██║ ╚═╝ ██║██║ ██║╚███╔███╔╝██║ ██║██║ ██║███████╗
7-
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ Experimental post-2.5.0 (January 2026)
7+
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ 2.6.0 (January 2026)
88
*
99
* C++ VM detection library
1010
*
@@ -23,6 +23,7 @@
2323
* - Teselka (https://github.com/Teselka)
2424
* - Kyun-J (https://github.com/Kyun-J)
2525
* - luukjp (https://github.com/luukjp)
26+
* - Lorenzo Rizzotti (https://github.com/Dreaming-Codes)
2627
* - Repository: https://github.com/kernelwernel/VMAware
2728
* - Docs: https://github.com/kernelwernel/VMAware/docs/documentation.md
2829
* - Full credits: https://github.com/kernelwernel/VMAware#credits-and-contributors-%EF%B8%8F
@@ -6166,9 +6167,9 @@ struct VM {
61666167
/**
61676168
* @brief Check for default Azure hostname format (Azure uses Hyper-V as their base VM brand)
61686169
* @category Windows, Linux
6169-
* @implements VM::HYPERV_HOSTNAME
6170+
* @implements VM::AZURE
61706171
*/
6171-
[[nodiscard]] static bool hyperv_hostname() {
6172+
[[nodiscard]] static bool azure() {
61726173
std::string hostname;
61736174

61746175
#if (WINDOWS)
@@ -10171,31 +10172,6 @@ struct VM {
1017110172
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);
1017210173
else if (var_name_view == L"KEK") (void)read_variable_to_buffer(std::wstring(var_name_view), current_var->VendorGuid, kek_buf, kek_len);
1017310174

10174-
if (var_name_view == L"Boot0000") { // should be Windows Boot Manager
10175-
BYTE* boot_buf = nullptr; SIZE_T boot_len = 0;
10176-
if (read_variable_to_buffer(var_name_view, current_var->VendorGuid, boot_buf, boot_len)) {
10177-
bool anomaly = (boot_len < 6);
10178-
if (!anomaly) {
10179-
unsigned short fpl_len = 0;
10180-
memcpy(&fpl_len, boot_buf + 4, sizeof(fpl_len));
10181-
// we could also check if loadOptionsLength is 136
10182-
if (fpl_len != 116) anomaly = true;
10183-
}
10184-
10185-
if (boot_buf) {
10186-
PVOID b_ptr = boot_buf; SIZE_T z_sz = 0;
10187-
nt_free_memory(current_process_handle, &b_ptr, &z_sz, 0x8000);
10188-
}
10189-
10190-
if (anomaly) {
10191-
debug("NVRAM: Environment was loaded using a virtual boot loader"); // "virtual" here -> non genuine
10192-
detection_result = true;
10193-
should_break_loop = true;
10194-
break;
10195-
}
10196-
}
10197-
}
10198-
1019910175
if (current_var->NextEntryOffset == 0) break;
1020010176
const SIZE_T next_entry_off = static_cast<SIZE_T>(current_var->NextEntryOffset);
1020110177
const size_t next_var_offset = current_offset + next_entry_off;
@@ -12718,7 +12694,7 @@ std::array<VM::core::technique, VM::enum_size + 1> VM::core::technique_table = [
1271812694
{VM::FIRMWARE, {100, VM::firmware}},
1271912695
{VM::PCI_DEVICES, {95, VM::pci_devices}},
1272012696
{VM::SIDT, {50, VM::sidt}},
12721-
{VM::AZURE, {30, VM::hyperv_hostname}},
12697+
{VM::AZURE, {30, VM::azure}},
1272212698
#endif
1272312699

1272412700
#if (LINUX)

0 commit comments

Comments
 (0)