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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30c
mov eax, dword [0x407008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov dword [ebp - 8], 0
xor eax, eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 2]
and eax, 0xff
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x401bc8
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CheckRemoteDebuggerPresent]
cmp dword [ebp - 8], 0
je 0x40180e
mov eax, 0x1001
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x40182e
mov eax, 0x1002
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
mov dword [ebp - 8], 0
xor eax, eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0x68]
and eax, 0x70
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x401bc8
call fcn.004011a0
test eax, eax
je 0x40186f
mov eax, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.004012d0
test eax, eax
je 0x40188e
mov eax, 0x1009
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.004015e0
test eax, eax
je 0x4018ad
mov eax, 0x2006
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.00401660
test eax, eax
je 0x4018cc
mov eax, 0x2007
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.004013a0
test eax, eax
je 0x4018eb
mov eax, 0x2000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.00401430
test eax, eax
je 0x40190a
mov eax, 0x2001
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.004014b0
test eax, eax
je 0x401929
mov eax, 0x2002
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.00401530
test eax, eax
je 0x401948
mov eax, 0x2003
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.004016e0
test eax, eax
je 0x401967
mov eax, 0x2004
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
push 0x405230
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov dword [ebp - 8], 0
mov dword [ebp - 0x2ec], 0
rdtsc
mov dword [ebp - 0x14], edx
mov dword [ebp - 8], eax
xor eax, eax
mov eax, 5
shr eax, 2
sub eax, ebx
cmp eax, ecx
rdtsc
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x2ec], eax
mov eax, dword [ebp - 0x14]
xor esi, esi
cdq
xor ebx, ebx
mov edi, eax
mov eax, dword [ebp - 8]
cdq
or esi, eax
or edi, edx
mov eax, dword [ebp - 0xc]
cdq
mov ecx, eax
mov eax, dword [ebp - 0x2ec]
cdq
or ebx, eax
or ecx, edx
sub ebx, esi
sbb ecx, edi
mov dword [ebp - 0xc], ecx
jne 0x4019dc
cmp ebx, 0x10000
ja 0x4019dc
xor eax, eax
jmp 0x4019e1
mov eax, 0x3000
test eax, eax
je 0x4019fb
mov eax, 0x3000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
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]
mov dword [ebp - 0xc], eax
js 0x401a37
jg 0x401a30
cmp ecx, 0x1e
jbe 0x401a37
mov eax, 0x3001
jmp 0x401a39
xor eax, eax
test eax, eax
je 0x401a53
mov eax, 0x3001
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
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 0x401a87
mov eax, 0x3002
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
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 0x401afc
cmp dword [ebp - 0x2e4], 0
jne 0x401af5
cmp dword [ebp - 0x2e0], 0
jne 0x401af5
cmp dword [ebp - 0x2dc], 0
jne 0x401af5
cmp dword [ebp - 0x2d8], 0
jne 0x401af5
cmp dword [ebp - 0x2d4], 0
jne 0x401af5
cmp dword [ebp - 0x2d0], 0
je 0x401afc
mov eax, 0x4000
jmp 0x401afe
xor eax, eax
test eax, eax
je 0x401b18
mov eax, 0x4000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
call fcn.00401760
test eax, eax
je 0x401b37
mov eax, 0x5000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
movaps xmm0, xmmword [0x4053c0]
xor ecx, ecx
mov dword [ebp - 0xc], 0
movups xmmword [ebp - 0x308], xmm0
mov dword [ebp - 0x2f8], 0x434b5b4c
mov dword [ebp - 0x2f4], 0x47505d49
mov word [ebp - 0x2f0], 0x4040
mov byte [ebp - 0x2ee], 0
mov al, byte [ebp - 0x308]
xor byte [ebp + ecx - 0x307], al
inc ecx
cmp ecx, 0x19
jb 0x401b72
lea eax, [ebp - 0xc]
mov byte [ebp - 0x2ee], 0
push eax
push 0x20019
push 0
lea eax, [ebp - 0x307]
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
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040397d
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 0x1000
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040397d
mov esp, ebp
pop ebp
ret