|
43 | 43 |
|
44 | 44 | #include "vmaware.hpp" |
45 | 45 |
|
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"; |
48 | 48 |
|
49 | 49 | constexpr const char* bold = "\033[1m"; |
50 | 50 | constexpr const char* ansi_exit = "\x1B[0m"; |
@@ -73,6 +73,7 @@ enum arg_enum : std::uint8_t { |
73 | 73 | }; |
74 | 74 |
|
75 | 75 | std::bitset<14> arg_bitset; |
| 76 | +const std::uint8_t max_bits = static_cast<std::uint8_t>(VM::MULTIPLE) + 1; |
76 | 77 |
|
77 | 78 | #if (MSVC) |
78 | 79 | class win_ansi_enabler_t |
@@ -131,8 +132,8 @@ R"(Usage: |
131 | 132 | -t | --type returns the VM type (if a VM was found) |
132 | 133 |
|
133 | 134 | 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) |
136 | 137 |
|
137 | 138 | )"; |
138 | 139 | std::exit(0); |
@@ -440,6 +441,22 @@ bool is_disabled(const VM::enum_flags flag) { |
440 | 441 | } |
441 | 442 |
|
442 | 443 |
|
| 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 | + |
443 | 460 | void general() { |
444 | 461 | const std::string detected = ("[ " + std::string(green) + "DETECTED" + std::string(ansi_exit) + " ]"); |
445 | 462 | const std::string not_detected = ("[" + std::string(red) + "NOT DETECTED" + std::string(ansi_exit) + "]"); |
@@ -478,21 +495,6 @@ void general() { |
478 | 495 | }; |
479 | 496 |
|
480 | 497 | 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 | | - }; |
496 | 498 |
|
497 | 499 | if (arg_bitset.test(NOTES)) { |
498 | 500 | notes_enabled = false; |
@@ -815,26 +817,6 @@ int main(int argc, char* argv[]) { |
815 | 817 | std::cerr << "--stdout, --percent, --detect, --brand, --type, and --conclusion must NOT be a combination, choose only a single one\n"; |
816 | 818 | return 1; |
817 | 819 | } |
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 | | - }; |
838 | 820 |
|
839 | 821 | if (arg_bitset.test(STDOUT)) { |
840 | 822 | return (!VM::detect(VM::NO_MEMO, settings())); |
|
0 commit comments