; Universal (?) Virtual Machine detector =^^= ; masm32 ; research & code by j00ru//vx ; .486 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib .data ExpTitle db 'VM PurplePill - (by j00ru//vx)',0 ExpON db 'Virtual Machine detected!',0 ExpOFF db 'Virtual Machine NOT detected!',0 buf dd 0DEADC0D3h .code start: ; SEH xor eax, eax push offset AccViolationSEH db 064h ; FS push dword ptr [eax] db 064h ; FS mov dword ptr [eax], esp ; 11 * Segment prefix DS: - on real CPU this code causes ; Access Violation #GP(0) exception db 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh mov eax, dword ptr [buf] ; no exception - detected! jmp detected AccViolationSEH: ; real CPU generates Access Violation exception ; other exception - vm detected! mov eax, [esp+4] cmp dword ptr [eax], EXCEPTION_ACCESS_VIOLATION jnz detected ; SEH xor eax, eax push offset IllInstructionSEH db 064h ; FS push dword ptr [eax] db 064h ; FS mov dword ptr [eax], esp ; 15 * Segment prefix DS: on real CPU this code causes ; Illegal Instruction #UD exception db 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh, 3eh mov eax, dword ptr [buf] ; no exception - vm detected! jmp detected IllInstructionSEH: ; real CPU generates Illegal Instruction exception ; other exception - vm detected! mov eax, [esp+4] cmp dword ptr [eax], EXCEPTION_ILLEGAL_INSTRUCTION jnz detected ; no virtual machine detected invoke MessageBoxA, 0, offset ExpOFF, offset ExpTitle, MB_ICONINFORMATION jmp exit detected: invoke MessageBoxA, 0, offset ExpON, offset ExpTitle, MB_ICONERROR jmp exit exit: invoke ExitProcess, 0 end start
SetLastError(ERROR_SUCCESS); /* Invalid parameter #0 */ Beep(0,0); bBeingEmulated = GetLastError() != ERROR_INVALID_PARAMETER;
There are 16,591 total registered users.
[+] expand