Skip to content

Commit 66c2342

Browse files
authored
Merge pull request #602 from kernelwernel/dev
VMAware 2.6.0 - Final version
2 parents fd96f14 + 28d2fc0 commit 66c2342

4 files changed

Lines changed: 2380 additions & 1973 deletions

File tree

.github/workflows/cmake-multi-platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: CMake on multiple platforms
44

55
on:
6-
pull_request:
6+
push:
77
branches: [ "main", "dev" ]
88

99
jobs:

.github/workflows/windows.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,68 @@
1+
# this code is absolutely atrocious but hey, if it works then it works.
2+
13
"on": "push"
24
"jobs":
35
"build_run_win_64_debug":
46
"runs-on": "windows-latest"
57
"steps":
68
- "uses": "actions/checkout@main"
79
- "run": "cmd.exe /c .github\\workflows\\build_run_win_64_debug.bat"
10+
- name: Rename binary with commit info
11+
shell: pwsh
12+
run: |
13+
$shortSha = "${{ github.sha }}".Substring(0,12)
14+
$run = "${{ github.run_number }}"
15+
Add-Content $env:GITHUB_ENV "SHORT_SHA=$shortSha"
16+
Rename-Item build\Debug\vmaware.exe "vmaware_${run}_${shortSha}.exe"
817
- "uses": "actions/upload-artifact@main"
918
"with":
10-
"path": "build\\Debug\\vmaware.exe"
19+
"path": build\Debug\vmaware_${{ github.run_number }}_${{ env.SHORT_SHA }}.exe
1120
"name": "vmaware64_debug.exe"
1221
"build_run_win_32_debug":
1322
"runs-on": "windows-latest"
1423
"steps":
1524
- "uses": "actions/checkout@main"
1625
- "run": "cmd.exe /c .github\\workflows\\build_run_win_32_debug.bat"
26+
- name: Rename binary with commit info
27+
shell: pwsh
28+
run: |
29+
$shortSha = "${{ github.sha }}".Substring(0,12)
30+
$run = "${{ github.run_number }}"
31+
Add-Content $env:GITHUB_ENV "SHORT_SHA=$shortSha"
32+
Rename-Item build\Debug\vmaware.exe "vmaware_${run}_${shortSha}.exe"
1733
- "uses": "actions/upload-artifact@main"
1834
"with":
19-
"path": "build\\Debug\\vmaware.exe"
35+
"path": build\Debug\vmaware_${{ github.run_number }}_${{ env.SHORT_SHA }}.exe
2036
"name": "vmaware32_debug.exe"
2137
"build_run_win_32_release":
2238
"runs-on": "windows-latest"
2339
"steps":
2440
- "uses": "actions/checkout@main"
2541
- "run": "cmd.exe /c .github\\workflows\\build_run_win_32_release.bat"
42+
- name: Rename binary with commit info
43+
shell: pwsh
44+
run: |
45+
$shortSha = "${{ github.sha }}".Substring(0,12)
46+
$run = "${{ github.run_number }}"
47+
Add-Content $env:GITHUB_ENV "SHORT_SHA=$shortSha"
48+
Rename-Item build\Release\vmaware.exe "vmaware_${run}_${shortSha}.exe"
2649
- "uses": "actions/upload-artifact@main"
2750
"with":
28-
"path": "build\\Release\\vmaware.exe"
51+
"path": build\Release\vmaware_${{ github.run_number }}_${{ env.SHORT_SHA }}.exe
2952
"name": "vmaware32_release.exe"
3053
"build_run_win_64_release":
3154
"runs-on": "windows-latest"
3255
"steps":
3356
- "uses": "actions/checkout@main"
3457
- "run": "cmd.exe /c .github\\workflows\\build_run_win_64_release.bat"
58+
- name: Rename binary with commit info
59+
shell: pwsh
60+
run: |
61+
$shortSha = "${{ github.sha }}".Substring(0,12)
62+
$run = "${{ github.run_number }}"
63+
Add-Content $env:GITHUB_ENV "SHORT_SHA=$shortSha"
64+
Rename-Item build\Release\vmaware.exe "vmaware_${run}_${shortSha}.exe"
3565
- "uses": "actions/upload-artifact@main"
3666
"with":
37-
"path": "build\\Release\\vmaware.exe"
67+
"path": build\Release\vmaware_${{ github.run_number }}_${{ env.SHORT_SHA }}.exe
3868
"name": "vmaware64_release.exe"

src/cli.cpp

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747

4848
#include "vmaware.hpp"
4949

50-
constexpr const char* ver = "2.5.0";
51-
constexpr const char* date = "December 2025";
50+
constexpr const char* ver = "2.6.0";
51+
constexpr const char* date = "January 2025";
5252

5353
std::string bold = "\033[1m";
5454
std::string underline = "\033[4m";
@@ -544,7 +544,7 @@ static const char* get_vm_description(const std::string& vm_brand) {
544544
using RtlInitUnicodeString_t = VOID(__stdcall*)(PUNICODE_STRING, PCWSTR);
545545

546546
#pragma warning(push)
547-
#pragma warning(disable:4191)
547+
#pragma warning(disable:4191)
548548
auto pRtlInitUnicodeString = reinterpret_cast<RtlInitUnicodeString_t>(
549549
GetProcAddress(ntdll, "RtlInitUnicodeString"));
550550
auto pNtCreateFile = reinterpret_cast<NtCreateFile_t>(
@@ -561,7 +561,7 @@ static const char* get_vm_description(const std::string& vm_brand) {
561561
pRtlInitUnicodeString(&name, L"\\??\\C:\\Program Files\\KernelLogger");
562562

563563
HANDLE hFile;
564-
IO_STATUS_BLOCK iosb = { { 0 } };
564+
IO_STATUS_BLOCK iosb;
565565
OBJECT_ATTRIBUTES attrs{};
566566
InitializeObjectAttributes(&attrs, &name, 0, nullptr, nullptr);
567567

@@ -762,9 +762,7 @@ static void general(
762762
checker(VM::VMWARE_STR, "STR instruction");
763763
checker(VM::VMWARE_BACKDOOR, "VMware IO port backdoor");
764764
checker(VM::MUTEX, "mutex strings");
765-
checker(VM::INTEL_THREAD_MISMATCH, "Intel thread count mismatch");
766-
checker(VM::XEON_THREAD_MISMATCH, "Intel Xeon thread count mismatch");
767-
checker(VM::AMD_THREAD_MISMATCH, "AMD thread count mismatch");
765+
checker(VM::THREAD_MISMATCH, "Thread count mismatch");
768766
checker(VM::CUCKOO_DIR, "Cuckoo directory");
769767
checker(VM::CUCKOO_PIPE, "Cuckoo pipe");
770768
checker(VM::AZURE, "Azure Hyper-V");
@@ -867,13 +865,13 @@ static void general(
867865

868866
// percentage manager
869867
{
870-
const char* percent_color = "";
868+
const char* percent_color;
871869

872-
if (vm.percentage == 0) { percent_color = red.c_str(); }
870+
if (vm.percentage == 0) { percent_color = red.c_str(); }
873871
else if (vm.percentage < 25) { percent_color = red_orange.c_str(); }
874872
else if (vm.percentage < 50) { percent_color = orange.c_str(); }
875873
else if (vm.percentage < 75) { percent_color = green_orange.c_str(); }
876-
else { percent_color = green.c_str(); }
874+
else { percent_color = green.c_str(); }
877875

878876
std::cout << bold << "VM likeliness: " << ansi_exit << percent_color << static_cast<u32>(vm.percentage) << "%" << ansi_exit << "\n";
879877
}
@@ -887,27 +885,26 @@ static void general(
887885

888886
// detection count manager
889887
{
890-
const char* count_color = "";
888+
const char* count_color;
891889

892890
switch (vm.detected_count) {
893-
case 0: count_color = red.c_str(); break;
894-
case 1: count_color = red_orange.c_str(); break;
895-
case 2: count_color = orange.c_str(); break;
896-
case 3: count_color = orange.c_str(); break;
897-
case 4: count_color = green_orange.c_str(); break;
898-
default:
899-
// anything over 4 is green
900-
count_color = green.c_str();
891+
case 0: count_color = red.c_str(); break;
892+
case 1: count_color = red_orange.c_str(); break;
893+
case 2: count_color = orange.c_str(); break;
894+
case 3: count_color = orange.c_str(); break;
895+
case 4: count_color = green_orange.c_str(); break;
896+
default:
897+
count_color = green.c_str();
901898
}
902899

903-
std::cout <<
900+
std::cout <<
904901
bold <<
905-
"VM detections: " <<
902+
"VM detections: " <<
906903
ansi_exit <<
907-
count_color <<
908-
static_cast<u32>(vm.detected_count) <<
904+
count_color <<
905+
static_cast<u32>(vm.detected_count) <<
909906
"/" <<
910-
static_cast<u32>(vm.technique_count) <<
907+
static_cast<u32>(vm.technique_count) <<
911908
ansi_exit <<
912909
"\n";
913910
}

0 commit comments

Comments
 (0)