Function at 0x401240
Capabilities:
Check for debugger via api
Check for peb beingdebugged flag
Check for peb ntglobalflag flag
Execute anti-debugging instructions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [0x40f040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
call fcn.00401e10
mov ebx, eax
call fcn.00402370
mov ecx, dword fs:[0x30]
add ebx, eax
push str.ntdll.dll
test byte [ecx + 0x68], 0x70
mov ecx, 0
setne cl
add ebx, ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
je 0x4012cd
push str.NtQueryInformationProcess
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x4012cd
lea eax, [ebp - 0x11c]
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 0x4012c9
cmp dword [ebp - 0x114], 0xffffffff
jne 0x4012c9
mov edx, 1
jmp 0x4012d3
xor edx, edx
jmp 0x4012d3
mov edx, dword [ebp - 0x11c]
mov eax, dword fs:[0x30]
xor ecx, ecx
push str.Ntdll.dll
mov dword [ebp - 0x114], 0
cmp byte [eax + 2], cl
setne cl
add ecx, edx
add ebx, ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x401305
lea eax, [edi + 1]
jmp 0x401320
push str.NtQueryInformationProcess
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
jne 0x401384
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
xor eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_HeapWalk]
xorps xmm0, xmm0
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
add ebx, eax
movups xmmword [ebp - 0x154], xmm0
mov dword [ebp - 0x13c], 0
movq qword [ebp - 0x144], xmm0
nop word [eax + eax]
lea eax, [ebp - 0x154]
push eax
call edi
push eax
call esi
test eax, eax
je 0x4013c2
cmp word [ebp - 0x14a], 4
jne 0x401350
mov ecx, dword [ebp - 0x150]
xor edx, edx
mov eax, dword [ebp - 0x154]
cmp dword [ecx + eax], 0xabababab
sete dl
jmp 0x4013c4
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 0x40131e
cmp dword [ebp - 0x114], 0
je 0x40131e
mov eax, 1
jmp 0x401320
xor edx, edx
push 4
push 0x3000
push 0x1000
push 0
add ebx, edx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
mov dword [ebp - 0x120], esi
test esi, esi
jne 0x4013ea
xor edi, edi
jmp 0x401424
push 8
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_K32QueryWorkingSetEx]
test eax, eax
je 0x401414
test byte [ebp - 0x11c], 1
je 0x401414
mov edi, 1
jmp 0x401416
xor edi, edi
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
neg eax
sbb esi, esi
neg esi
call fcn.00402860
add eax, esi
add eax, edi
push 0x1234
add ebx, eax
call dword [sym.imp.USER32.dll_CloseWindow]
test eax, eax
jne 0x401460
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x578
jne 0x401460
xor ecx, ecx
jmp 0x401465
mov ecx, 1
rdtsc
mov dword [ebp - 0x158], eax
rdtsc
mov dword [ebp - 0x114], eax
mov eax, dword [ebp - 0x114]
sub eax, dword [ebp - 0x158]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
cmp eax, 0xff
sbb eax, eax
inc eax
add eax, ecx
add ebx, eax
mov dword [ebp - 0x158], ebx
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 - 0x11c], edx
jne 0x4014c3
cmp eax, 0xc350
ja 0x4014c3
xor eax, eax
jmp 0x4014c8
mov eax, 1
mov edi, dword [ebp - 0x158]
mov esi, dword [sym.imp.KERNEL32.dll_GetSystemTime]
add edi, eax
lea eax, [ebp - 0x138]
push eax
call esi
xor eax, eax
push eax
push ecx
pop eax
pop ecx
sub ecx, eax
shl ecx, 4
lea eax, [ebp - 0x148]
push eax
call esi
mov esi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x138]
push eax
call esi
test eax, eax
jne 0x401511
xor esi, esi
jmp 0x40155a
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x148]
push eax
call esi
test eax, eax
jne 0x401529
xor esi, esi
jmp 0x40155a
mov ecx, dword [ebp - 0x120]
mov eax, dword [ebp - 0x11c]
sub ecx, dword [ebp - 0x128]
sbb eax, dword [ebp - 0x124]
mov dword [ebp - 0x11c], eax
jne 0x401555
cmp ecx, 0xc350
ja 0x401555
xor esi, esi
jmp 0x40155a
mov esi, 1
call fcn.004028f0
add eax, esi
add edi, eax
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
mov esi, eax
call fcn.00402990
add eax, esi
add edi, eax
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]
neg eax
sbb esi, esi
and esi, dword [ebp - 0x114]
call fcn.00402a30
add eax, esi
add eax, edi
mov dword [ebp - 0x158], eax
lea eax, [ebp - 0x110]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4015fa
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 0x4015fa
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x114], 1
jmp 0x401604
mov dword [ebp - 0x114], 2
call fcn.00402ac0
mov dword [ebp - 0x11c], eax
call fcn.00402dc0
mov dword [ebp - 0x124], eax
call fcn.00402e50
mov cl, byte [0x7ffe02d4]
mov dword [ebp - 0x15c], eax
movzx esi, cl
call fcn.00403040
mov ecx, esi
and esi, 1
and ecx, 2
sub esi, ecx
lea edi, [esi + eax]
call fcn.004030c0
mov esi, eax
call fcn.00403140
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov ebx, eax
add ebx, dword [ebp - 0x158]
add ebx, edi
add ebx, dword [ebp - 0x114]
add ebx, esi
add ebx, dword [ebp - 0x15c]
add ebx, dword [ebp - 0x124]
add ebx, dword [ebp - 0x11c]
push 0x405860
push ebx
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040668e
mov esp, ebp
pop ebp
ret