Parsi Coders
[C\C++] VMWare Detection - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Cracking / Anti Crack (http://parsicoders.com/forumdisplay.php?fid=75)
+--- انجمن: Anti Debug (http://parsicoders.com/forumdisplay.php?fid=76)
+--- موضوع: [C\C++] VMWare Detection (/showthread.php?tid=822)



[C\C++] VMWare Detection - Amin_Mansouri - 08-30-2011

شناسایی ماشین مجازی یا همان vm در c++

کد:
#include <windows.h>
#include <iostream>

int main()
{

int flag = 0;
__try {
__asm {
push edx;
push ecx;
push ebx;
mov eax, 'VMXh';
mov ebx, 0; // This can be any value except
mov ecx, 10; // "CODE" to get the VMware Version
mov edx, 'VX'; // Port Number
in eax, dx; // Read port
//On return EAX returns the VERSION
cmp ebx, 'VMXh'; // is it VMware
setz [flag]; // set return value
pop ebx;
pop ecx;
pop edx;
}
}
__except(EXCEPTION_EXECUTE_HANDLER) {
flag = 0;
MessageBoxA(NULL, "No VMware Instance Detected", "No VMware", MB_OK);
}
if (flag != 0) { MessageBox(NULL, "VMware Detected", "VMware Detected", MB_OK); }

getchar();

}