10-16-2011، 07:39 PM
با سورس زیر میتونید تشخیص بدید برنامه تو vm اجرا شده یا نه ...
کد:
/*
Virtual Machine Detection
Coded by stoopid
Credits to Cobein
*/
#include <stdio.h>
#include <windows.h>
char* sProduct[] = { "*VMWARE*", "*VBOX*", "*VIRTUAL*" };
bool DetectVM()
{
HKEY hKey;
char szBuffer[64];
unsigned long hSize = sizeof(szBuffer) - 1;
if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, "SYSTEM\\ControlSet001\\Services\\Disk\\Enum", 0, KEY_READ, &hKey ) == ERROR_SUCCESS )
{
if( RegQueryValueEx( hKey, "0", NULL, NULL, (unsigned char *)szBuffer, &hSize ) == ERROR_SUCCESS)
{
for( int i = 0; i < ( sizeof( sProduct ) / sizeof( char* ) ); i++ )
{
if( strstr( szBuffer, sProduct[ i ] ) )
{
RegCloseKey( hKey );
return true;
}
}
}
RegCloseKey( hKey );
}
return false;
}
int main()
{
if ( DetectVM() ) {
printf ( "VM detected\n" );
}
else {
printf ( "No VM detected\n" );
}
return 0;
}
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg