Function at 0x401830
Capabilities:
Check for debugger via api
Check for peb beingdebugged flag
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x308
mov eax, dword [0x407008]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov dword [ebp - 0xc], 0
xor eax, eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 2]
and eax, 0xff
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x401be5
mov dword [ebp - 0xc], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 0xc]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CheckRemoteDebuggerPresent]
cmp dword [ebp - 0xc], 0
je 0x40189c
mov eax, 0x1001
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x4018bb
mov eax, 0x1002
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xc], 0
xor eax, eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0x68]
and eax, 0x70
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x401be5
call fcn.004011a0
test eax, eax
je 0x4018fb
mov eax, 4
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004012d0
test eax, eax
je 0x401919
mov eax, 0x1009
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004015e0
test eax, eax
je 0x401937
mov eax, 0x2006
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.00401660
test eax, eax
je 0x401955
mov eax, 0x2007
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004013a0
test eax, eax
je 0x401973
mov eax, 0x2000
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.00401430
test eax, eax
je 0x401991
mov eax, 0x2001
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004014b0
test eax, eax
je 0x4019af
mov eax, 0x2002
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.00401530
test eax, eax
je 0x4019cd
mov eax, 0x2003
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004016e0
test eax, eax
je 0x4019eb
mov eax, 0x2004
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
push 0x405250
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
call fcn.00401760
test eax, eax
je 0x401a14
mov eax, 0x3000
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea eax, [ebp - 0x18]
push eax
call esi
xor eax, eax
push eax
push ecx
pop eax
pop ecx
sub ecx, eax
shl ecx, 4
lea eax, [ebp - 0x10]
push eax
call esi
mov ecx, dword [ebp - 0x10]
sub ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
sbb eax, dword [ebp - 0x14]
js 0x401a4d
jg 0x401a46
cmp ecx, 0x1e
jbe 0x401a4d
mov eax, 0x3001
jmp 0x401a4f
xor eax, eax
test eax, eax
je 0x401a68
mov eax, 0x3001
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount64]
call esi
mov edi, eax
xor eax, eax
push eax
push ecx
pop eax
pop ecx
sub ecx, eax
shl ecx, 4
call esi
sub eax, edi
cmp eax, 0x1e
jbe 0x401a9b
mov eax, 0x3002
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
push 0x2c8
lea eax, [ebp - 0x2e4]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
lea ecx, [ebp - 0x2e8]
mov dword [ebp - 0x2e8], 0x10010
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x401b10
cmp dword [ebp - 0x2e4], 0
jne 0x401b09
cmp dword [ebp - 0x2e0], 0
jne 0x401b09
cmp dword [ebp - 0x2dc], 0
jne 0x401b09
cmp dword [ebp - 0x2d8], 0
jne 0x401b09
cmp dword [ebp - 0x2d4], 0
jne 0x401b09
cmp dword [ebp - 0x2d0], 0
je 0x401b10
mov eax, 0x4000
jmp 0x401b12
xor eax, eax
test eax, eax
je 0x401b2b
mov eax, 0x4000
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
call fcn.004017f0
test eax, eax
je 0x401b49
mov eax, 0x5000
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
movaps xmm0, xmmword [str.o.8.3.__3_pJm_JwPXQLS_JWQ_]
xor ecx, ecx
mov dword [ebp - 0xc], 0
movups xmmword [ebp - 0x304], xmm0
mov dword [ebp - 0x2f4], 0x333b2b3c
mov dword [ebp - 0x2f0], 0x37202d39
mov word [ebp - 0x2ec], 0x3030
mov byte [ebp - 0x2ea], 0
nop dword [eax]
nop dword [eax + eax]
mov al, byte [ebp - 0x304]
xor byte [ebp + ecx - 0x303], al
inc ecx
cmp ecx, 0x19
jb 0x401b90
lea eax, [ebp - 0xc]
mov byte [ebp - 0x2ea], 0
push eax
push 0x20019
push 0
lea eax, [ebp - 0x303]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
neg eax
sbb eax, eax
and eax, 0xffffafff
add eax, 0x5001
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403b17
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 0x1000
pop edi
xor ecx, ebp
pop esi
call fcn.00403b17
mov esp, ebp
pop ebp
ret