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 [0x40d040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
call fcn.00401eb0
mov ecx, dword fs:[0x30]
movzx ebx, al
mov eax, 1
push str.ntdll.dll
test byte [ecx + 0x68], 0x70
cmovne ebx, eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4012ca
push str.NtQueryInformationProcess
push eax
call esi
mov esi, eax
test esi, esi
je 0x4012c4
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 0x4012c4
cmp dword [ebp - 0x114], 0xffffffff
jne 0x4012c4
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov eax, dword fs:[0x30]
or byte [ebp - 0x15b], bl
push str.Ntdll.dll
mov dword [ebp - 0x114], 0
mov al, byte [eax + 2]
mov byte [ebp - 0x159], al
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x401313
push str.NtQueryInformationProcess
push edi
call esi
mov esi, eax
test esi, esi
jne 0x401397
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor al, al
cmp byte [ebp - 0x159], 0
mov ecx, 1
mov esi, dword [sym.imp.KERNEL32.dll_HeapWalk]
xorps xmm0, xmm0
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
movzx eax, al
cmovne eax, ecx
movq qword [ebp - 0x148], xmm0
or al, byte [ebp - 0x15b]
mov dword [ebp - 0x118], 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 0x4013d4
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 0x4013db
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea eax, [ebp - 0x114]
push 0
push 4
push eax
push 0x1e
call ebx
push eax
call esi
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
js 0x401319
cmp dword [ebp - 0x114], 0
je 0x401319
mov al, 1
jmp 0x40131b
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 0x401403
mov byte [ebp - 0x15a], al
jmp 0x40143e
push 8
lea eax, [ebp - 0x130]
push eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_K32QueryWorkingSetEx]
test eax, eax
je 0x401429
test byte [ebp - 0x12c], 1
mov byte [ebp - 0x15a], 1
jne 0x401430
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.00402410
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 0x40147f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x578
je 0x401481
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 0x4014a2
rdtsc
mov dword [ebp - 0x12c], eax
rdtsc
mov dword [ebp - 0x114], eax
mov ecx, dword [ebp - 0x148]
sub ecx, dword [ebp - 0x120]
mov edx, dword [ebp - 0x144]
sbb edx, dword [ebp - 0x11c]
call fcn.00407240
mulsd xmm0, qword [0x40a2b0]
mov edx, dword [ebp - 0x124]
mov ecx, dword [ebp - 0x128]
movsd qword [ebp - 0x120], xmm0
call fcn.00407240
movsd xmm1, qword [ebp - 0x120]
divsd xmm1, xmm0
mov eax, dword [ebp - 0x114]
movzx ecx, byte [ebp - 0x159]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
comisd xmm1, xmmword [0x40a2a8]
seta dl
sub eax, dword [ebp - 0x12c]
cmp eax, 0xff
mov eax, 1
cmovae ecx, eax
or dl, cl
or dl, byte [ebp - 0x118]
or dl, bl
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 0x401579
cmp eax, 0xc350
ja 0x401579
mov bl, byte [ebp - 0x159]
jmp 0x401582
mov bl, byte [ebp - 0x15b]
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 0x4015c9
mov byte [ebp - 0x15a], al
jmp 0x401615
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x138]
push eax
call esi
test eax, eax
jne 0x4015e5
mov byte [ebp - 0x15a], al
jmp 0x401615
mov ecx, dword [ebp - 0x128]
sub ecx, dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
sbb eax, dword [ebp - 0x11c]
jne 0x40160e
mov byte [ebp - 0x15a], 0
cmp ecx, 0xc350
jbe 0x401615
mov byte [ebp - 0x15a], 1
call fcn.004024a0
or al, byte [ebp - 0x15a]
or bl, al
call fcn.00402540
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 0x40165b
cmp dword [ebp - 0x114], 0
setne byte [ebp - 0x159]
jmp 0x401662
mov byte [ebp - 0x159], 0
call fcn.004025e0
or al, byte [ebp - 0x159]
or al, bl
mov byte [ebp - 0x15b], al
lea eax, [ebp - 0x110]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4016c0
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 0x4016c0
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov bh, byte [ebp - 0x15b]
jmp 0x4016c3
or bh, 1
call fcn.00402670
mov bl, al
or bl, bh
call fcn.00402970
or bl, al
call fcn.00402a00
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.00402bf0
cmp byte [ebp - 0x118], bl
mov ecx, 1
mov bl, byte [ebp - 0x159]
movzx eax, al
cmovne eax, ecx
or bl, al
call fcn.00402c70
or bl, al
call fcn.00402cf0
mov ecx, dword [ebp - 4]
or al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040621e
mov esp, ebp
pop ebp
ret