Function at 0x401240
Capabilities:
Check for debugger via api
Check for kernel debugger via shared user data structure
Check for peb beingdebugged flag
Check for peb ntglobalflag flag
Check for time delay via queryperformancecounter
Execute anti-debugging instructions
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [0x40e040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
call fcn.00401eb0
mov bl, al
call fcn.00402410
mov ecx, dword fs:[0x30]
or al, bl
movzx eax, al
push str.ntdll.dll
test byte [ecx + 0x68], 0x70
mov ecx, 1
cmovne eax, ecx
mov dword [ebp - 0x12c], eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4012d9
push str.NtQueryInformationProcess
push eax
call esi
mov esi, eax
test esi, esi
je 0x4012d3
lea eax, [ebp - 0x118]
push eax
push 4
lea eax, [ebp - 0x114]
push eax
push 7
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
test eax, eax
js 0x4012d3
cmp dword [ebp - 0x114], 0xffffffff
jne 0x4012d3
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov eax, dword fs:[0x30]
mov bl, byte [ebp - 0x159]
or bl, byte [ebp - 0x12c]
push str.Ntdll.dll
mov bh, byte [eax + 2]
mov byte [ebp - 0x159], bl
mov dword [ebp - 0x114], 0
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x401324
push str.NtQueryInformationProcess
push edi
call esi
mov esi, eax
test esi, esi
jne 0x401399
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor al, al
mov esi, dword [sym.imp.KERNEL32.dll_HeapWalk]
test bh, bh
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov ecx, 1
movzx eax, al
xorps xmm0, xmm0
cmovne eax, ecx
movq qword [ebp - 0x148], xmm0
or al, bl
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x118], eax
movups xmmword [ebp - 0x158], xmm0
lea eax, [ebp - 0x158]
push eax
call edi
push eax
call esi
test eax, eax
je 0x4013d4
cmp word [ebp - 0x14e], 4
jne 0x401363
mov ecx, dword [ebp - 0x154]
mov eax, dword [ebp - 0x158]
cmp dword [ecx + eax], 0xabababab
sete byte [ebp - 0x15b]
jmp 0x4013db
push 0
push 4
lea eax, [ebp - 0x114]
push eax
push 0x1e
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
js 0x401324
cmp dword [ebp - 0x114], 0
je 0x401324
mov al, 1
jmp 0x401326
mov byte [ebp - 0x15b], 0
push 4
push 0x3000
push 0x1000
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
mov dword [ebp - 0x130], esi
test esi, esi
jne 0x401403
mov byte [ebp - 0x15a], al
jmp 0x401442
push 8
lea eax, [ebp - 0x130]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_K32QueryWorkingSetEx]
test eax, eax
je 0x40142d
test byte [ebp - 0x12c], 1
mov byte [ebp - 0x15a], 1
jne 0x401434
mov byte [ebp - 0x15a], 0
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov esi, eax
call fcn.00402920
movzx ebx, al
test esi, esi
mov eax, 1
cmovne ebx, eax
or bl, byte [ebp - 0x15a]
push 0x1234
call dword [sym.imp.USER32.dll_CloseWindow]
test eax, eax
jne 0x401483
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x578
je 0x401485
mov bl, 1
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov edi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea eax, [ebp - 0x120]
push eax
call edi
mov esi, 4
lea eax, [ebp - 0x148]
push eax
call edi
sub esi, 1
jne 0x4014a6
rdtsc
mov dword [ebp - 0x114], eax
rdtsc
mov dword [ebp - 0x12c], eax
mov ecx, dword [ebp - 0x148]
sub ecx, dword [ebp - 0x120]
mov edx, dword [ebp - 0x144]
sbb edx, dword [ebp - 0x11c]
call fcn.00407560
mulsd xmm0, qword [0x40b5b0]
mov edx, dword [ebp - 0x124]
mov ecx, dword [ebp - 0x128]
movsd qword [ebp - 0x120], xmm0
call fcn.00407560
movsd xmm1, qword [ebp - 0x120]
divsd xmm1, xmm0
mov eax, dword [ebp - 0x12c]
movzx ecx, byte [ebp - 0x15b]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
comisd xmm1, xmmword [0x40b5a8]
seta dl
sub eax, dword [ebp - 0x114]
cmp eax, 0xff
mov eax, 1
cmovae ecx, eax
or dl, cl
or dl, byte [ebp - 0x118]
or dl, bl
mov byte [ebp - 0x15b], dl
call esi
mov edi, eax
mov ebx, edx
xor eax, eax
push eax
push ecx
pop eax
pop ecx
sub ecx, eax
shl ecx, 4
call esi
sub eax, edi
sbb edx, ebx
mov dword [ebp - 0x124], edx
jne 0x40157d
cmp eax, 0xc350
ja 0x40157d
mov bl, byte [ebp - 0x15b]
jmp 0x401586
mov bl, byte [ebp - 0x159]
or bl, 1
mov esi, dword [sym.imp.KERNEL32.dll_GetSystemTime]
lea eax, [ebp - 0x14c]
push eax
mov bh, bl
call esi
xor eax, eax
push eax
push ecx
pop eax
pop ecx
sub ecx, eax
shl ecx, 4
lea eax, [ebp - 0x138]
push eax
call esi
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x14c]
push eax
call esi
test eax, eax
jne 0x4015cd
mov byte [ebp - 0x15a], al
jmp 0x401619
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x138]
push eax
call esi
test eax, eax
jne 0x4015e9
mov byte [ebp - 0x15a], al
jmp 0x401619
mov ecx, dword [ebp - 0x128]
sub ecx, dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
sbb eax, dword [ebp - 0x11c]
jne 0x401612
mov byte [ebp - 0x15a], 0
cmp ecx, 0xc350
jbe 0x401619
mov byte [ebp - 0x15a], 1
call fcn.004029b0
or al, byte [ebp - 0x15a]
or bl, al
call fcn.00402a50
or bl, al
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 0x114]
mov dword [ebp - 0x114], 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CheckRemoteDebuggerPresent]
test eax, eax
je 0x40165f
cmp dword [ebp - 0x114], 0
setne byte [ebp - 0x159]
jmp 0x401666
mov byte [ebp - 0x159], 0
call fcn.00402af0
or al, byte [ebp - 0x159]
or al, bl
mov byte [ebp - 0x159], al
lea eax, [ebp - 0x110]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4016c4
push 0
push pe_nt_image_headers32
push 3
push 0
push 0
push 0x80000000
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x4016c4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bh, byte [ebp - 0x159]
jmp 0x4016c7
or bh, 1
call fcn.00402b80
mov bl, al
or bl, bh
call fcn.00402e80
mov cl, byte [0x7ffe02d4]
or bl, al
movzx eax, cl
mov byte [ebp - 0x159], bl
mov ebx, eax
and eax, 1
and ebx, 2
mov dword [ebp - 0x118], eax
call fcn.00402f10
cmp byte [ebp - 0x118], bl
mov ecx, 1
mov bl, byte [ebp - 0x159]
movzx eax, al
cmovne eax, ecx
or bl, al
call fcn.00402f90
or bl, al
call fcn.00403010
mov ecx, dword [ebp - 4]
or al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040653e
mov esp, ebp
pop ebp
ret