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, 0x164
mov eax, dword [0x40f040]
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 - 0x160], 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 - 0x12c]
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 bh, byte [ebp - 0x15a]
or bh, byte [ebp - 0x160]
push str.Ntdll.dll
mov bl, byte [eax + 2]
mov byte [ebp - 0x15a], bh
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 0x401397
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor al, al
mov esi, dword [sym.imp.KERNEL32.dll_HeapWalk]
test bl, bl
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
mov dword [ebp - 0x160], eax
movups xmmword [ebp - 0x158], xmm0
mov dword [ebp - 0x140], 0
lea eax, [ebp - 0x158]
push eax
call edi
push eax
call esi
test eax, eax
je 0x4013d2
cmp word [ebp - 0x14e], 4
jne 0x401361
mov ecx, dword [ebp - 0x154]
mov eax, dword [ebp - 0x158]
cmp dword [ecx + eax], 0xabababab
sete byte [ebp - 0x159]
jmp 0x4013d9
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 - 0x159], 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 0x4013fd
xor bl, bl
jmp 0x401434
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 0x401424
test byte [ebp - 0x12c], 1
je 0x401424
mov bl, 1
jmp 0x401426
xor bl, bl
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
test eax, eax
movzx ecx, bl
mov eax, 1
cmovne ecx, eax
push 0x1234
mov dword [ebp - 0x12c], ecx
call dword [sym.imp.USER32.dll_CloseWindow]
test eax, eax
jne 0x401476
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x578
jne 0x401476
mov eax, dword [ebp - 0x160]
jmp 0x401478
mov al, 1
or bh, al
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
nop dword [eax + eax]
lea eax, [ebp - 0x148]
push eax
call edi
sub esi, 1
jne 0x4014a0
rdtsc
mov dword [ebp - 0x114], eax
rdtsc
mov dword [ebp - 0x160], eax
mov ecx, dword [ebp - 0x148]
sub ecx, dword [ebp - 0x120]
mov edx, dword [ebp - 0x144]
sbb edx, dword [ebp - 0x11c]
call fcn.004076c0
mulsd xmm0, qword [0x40c5e0]
mov edx, dword [ebp - 0x124]
mov ecx, dword [ebp - 0x128]
movsd qword [ebp - 0x120], xmm0
call fcn.004076c0
movsd xmm1, qword [ebp - 0x120]
divsd xmm1, xmm0
mov eax, dword [ebp - 0x160]
movzx ecx, byte [ebp - 0x159]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
comisd xmm1, xmmword [0x40c5d8]
seta dl
sub eax, dword [ebp - 0x114]
cmp eax, 0xff
mov eax, 1
cmovae ecx, eax
or dl, cl
or dl, byte [ebp - 0x12c]
or dl, bh
mov byte [ebp - 0x159], 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 0x401577
cmp eax, 0xc350
ja 0x401577
mov bl, byte [ebp - 0x159]
jmp 0x401580
mov bl, byte [ebp - 0x15a]
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 0x4015c7
mov byte [ebp - 0x159], al
jmp 0x401613
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x138]
push eax
call esi
test eax, eax
jne 0x4015e3
mov byte [ebp - 0x159], al
jmp 0x401613
mov ecx, dword [ebp - 0x128]
sub ecx, dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
sbb eax, dword [ebp - 0x11c]
jne 0x40160c
mov byte [ebp - 0x159], 0
cmp ecx, 0xc350
jbe 0x401613
mov byte [ebp - 0x159], 1
call fcn.00402920
or al, byte [ebp - 0x159]
or bl, al
call fcn.004029c0
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 0x401659
cmp dword [ebp - 0x114], 0
setne byte [ebp - 0x15a]
jmp 0x401660
mov byte [ebp - 0x15a], 0
call fcn.00402a60
or al, byte [ebp - 0x15a]
or al, bl
mov byte [ebp - 0x15a], al
lea eax, [ebp - 0x110]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4016be
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 0x4016be
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bh, byte [ebp - 0x15a]
jmp 0x4016c1
or bh, 1
call fcn.00402af0
mov bl, al
or bl, bh
call fcn.00402df0
or bl, al
call fcn.00402e80
mov cl, byte [0x7ffe02d4]
or bl, al
movzx eax, cl
mov byte [ebp - 0x15a], bl
mov ebx, eax
and eax, 1
and ebx, 2
mov dword [ebp - 0x12c], eax
call fcn.00403070
cmp byte [ebp - 0x12c], bl
mov ecx, 1
mov bl, byte [ebp - 0x15a]
movzx eax, al
cmovne eax, ecx
or bl, al
call fcn.004030f0
or bl, al
call fcn.00403170
mov ecx, dword [ebp - 4]
or al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040669e
mov esp, ebp
pop ebp
ret