Stores the machine status word into the destination operand.


Code Snippets

#include <iostream>

using namespace std;

void smsw()
	unsigned int reax = 0;

		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()
    cout << "Hello world!" << endl;
    return 0;

Detection Rules

    name: execute anti-VM instructions
    namespace: anti-analysis/anti-vm/vm-detection
    scope: basic block
      - Defense Evasion::Virtualization/Sandbox Evasion::System Checks [T1497.001]
      - Anti-Behavioral Analysis::Virtual Machine Detection::Instruction Testing [B0009.029]
      - Practical Malware Analysis Lab 17-03.exe_:0x401A80
    - or:
      - mnemonic: sdit
      - mnemonic: sgdt
      - mnemonic: sldt
      - mnemonic: smsw
      - mnemonic: str
      - mnemonic: in
      - mnemonic: cpuid
      - mnemonic: vpcext

Additional Resources

Subscribe to our Newsletter

The information entered into this form is mandatory. It will be subjected to computer processing. It is processed by computer in order to support our users and readers. The recipients of the data will be :

According to the Data Protection Act of January 6th, 1978, you have at any time, a right of access to and rectification of all of your personal data. If you wish to exercise this right and gain access to your personal data, please write to Thomas Roccia at

You may also oppose, for legitimate reasons, the processing of your personal data.