Skip to content

Commit bf7eb42

Browse files
committed
1.9 release
1 parent 5485b7a commit bf7eb42

3 files changed

Lines changed: 333 additions & 248 deletions

File tree

src/cli.cpp

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
#include "vmaware.hpp"
4545

46-
constexpr const char* ver = "1.8";
47-
constexpr const char* date = "August 2024";
46+
constexpr const char* ver = "1.9";
47+
constexpr const char* date = "September 2024";
4848

4949
constexpr const char* bold = "\033[1m";
5050
constexpr const char* ansi_exit = "\x1B[0m";
@@ -73,6 +73,7 @@ enum arg_enum : std::uint8_t {
7373
};
7474

7575
std::bitset<14> arg_bitset;
76+
const std::uint8_t max_bits = static_cast<std::uint8_t>(VM::MULTIPLE) + 1;
7677

7778
#if (MSVC)
7879
class win_ansi_enabler_t
@@ -131,8 +132,8 @@ R"(Usage:
131132
-t | --type returns the VM type (if a VM was found)
132133
133134
Extra:
134-
--disable-notes no notes will be provided
135-
--spoofable allow spoofable techniques to be ran (not included by default)
135+
--disable-notes no notes will be provided
136+
--spoofable allow spoofable techniques to be ran (not included by default)
136137
137138
)";
138139
std::exit(0);
@@ -440,6 +441,22 @@ bool is_disabled(const VM::enum_flags flag) {
440441
}
441442

442443

444+
std::bitset<max_bits> settings() {
445+
std::bitset<max_bits> tmp;
446+
447+
if (arg_bitset.test(SPOOFABLE)) {
448+
tmp.set(VM::SPOOFABLE);
449+
}
450+
451+
if (arg_bitset.test(ALL)) {
452+
tmp |= VM::ALL;
453+
tmp.set(VM::SPOOFABLE);
454+
}
455+
456+
return tmp;
457+
}
458+
459+
443460
void general() {
444461
const std::string detected = ("[ " + std::string(green) + "DETECTED" + std::string(ansi_exit) + " ]");
445462
const std::string not_detected = ("[" + std::string(red) + "NOT DETECTED" + std::string(ansi_exit) + "]");
@@ -478,21 +495,6 @@ void general() {
478495
};
479496

480497
bool notes_enabled = false;
481-
const std::uint8_t max_bits = static_cast<std::uint8_t>(VM::MULTIPLE) + 1;
482-
483-
auto settings = [&]() -> std::bitset<max_bits> {
484-
std::bitset<max_bits> tmp;
485-
486-
if (arg_bitset.test(SPOOFABLE)) {
487-
tmp.set(VM::SPOOFABLE);
488-
}
489-
490-
if (arg_bitset.test(ALL)) {
491-
tmp |= VM::ALL;
492-
}
493-
494-
return tmp;
495-
};
496498

497499
if (arg_bitset.test(NOTES)) {
498500
notes_enabled = false;
@@ -815,26 +817,6 @@ int main(int argc, char* argv[]) {
815817
std::cerr << "--stdout, --percent, --detect, --brand, --type, and --conclusion must NOT be a combination, choose only a single one\n";
816818
return 1;
817819
}
818-
819-
const std::uint8_t max_bits = static_cast<std::uint8_t>(VM::MULTIPLE) + 1;
820-
821-
auto settings = [&]() -> std::bitset<max_bits> {
822-
std::bitset<max_bits> setting_bits;
823-
824-
if (arg_bitset.test(SPOOFABLE)) {
825-
setting_bits.set(VM::SPOOFABLE);
826-
}
827-
828-
if (arg_bitset.test(ALL)) {
829-
std::cout << "\n\n\n\n\nALL SET\n\n\n\n";
830-
setting_bits |= VM::ALL;
831-
setting_bits.set(VM::SPOOFABLE);
832-
}
833-
834-
setting_bits.set(NULL_ARG);
835-
836-
return setting_bits;
837-
};
838820

839821
if (arg_bitset.test(STDOUT)) {
840822
return (!VM::detect(VM::NO_MEMO, settings()));

src/vmaware.hpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ██║ ██║██╔████╔██║███████║██║ █╗ ██║███████║██████╔╝█████╗
55
* ╚██╗ ██╔╝██║╚██╔╝██║██╔══██║██║███╗██║██╔══██║██╔══██╗██╔══╝
66
* ╚████╔╝ ██║ ╚═╝ ██║██║ ██║╚███╔███╔╝██║ ██║██║ ██║███████╗
7-
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ 1.8 (August 2024)
7+
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ 1.9 (September 2024)
88
*
99
* C++ VM detection library
1010
*
@@ -23,14 +23,14 @@
2323
*
2424
*
2525
* ================================ SECTIONS ==================================
26-
* - enums for publicly accessible techniques => line 312
27-
* - struct for internal cpu operations => line 569
28-
* - struct for internal memoization => line 995
29-
* - struct for internal utility functions => line 1118
30-
* - struct for internal core components => line 9196
31-
* - start of internal VM detection techniques => line 2491
32-
* - start of public VM detection functions => line 9541
33-
* - start of externally defined variables => line 10017
26+
* - enums for publicly accessible techniques => line 322
27+
* - struct for internal cpu operations => line 581
28+
* - struct for internal memoization => line 1007
29+
* - struct for internal utility functions => line 1134
30+
* - struct for internal core components => line 9152
31+
* - start of internal VM detection techniques => line 2409
32+
* - start of public VM detection functions => line 9495
33+
* - start of externally defined variables => line 10095
3434
*
3535
*
3636
* ================================ EXAMPLE ==================================
@@ -10020,6 +10020,8 @@ struct VM {
1002010020
case SMBIOS_VM_BIT: return "SMBIOS_VM_BIT";
1002110021
case PODMAN_FILE: return "PODMAN_FILE";
1002210022
case WSL_PROC: return "WSL_PROC";
10023+
case ANYRUN_DRIVER: return "ANYRUN_DRIVER";
10024+
case ANYRUN_DIRECTORY: return "ANYRUN_DIRECTORY";
1002310025
default: return "Unknown flag";
1002410026
}
1002510027
}

0 commit comments

Comments
 (0)