(C++) SMSW by Thomas Roccia

Created the Saturday 05 September 2020. Updated 3 years, 6 months ago.

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;
}