Windows C++ / SMSW

Author Thomas Roccia (fr0gger)
Platform Windows
Language C++
Technique SMSW

Code

#include <iostream>

using namespace std;

void smsw()
{
	unsigned int reax = 0;

	__asm
	{
		mov eax, 0xCCCCCCCC
		smsw eax
		mov DWORD PTR[reax], eax
	}

	if ((((reax >> 24) & 0xFF) == 0xcc) && (((reax >> 16) & 0xFF) == 0xcc))
	{
	    cout << "VM detected!" << endl;
	}
}

int main()
{
    smsw();
    cout << "Hello world!" << endl;
    return 0;
}

Created

September 5, 2020

Last Revised

April 22, 2024