Function at 0x409040
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x415f5d
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x41c140]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x4c], ecx
mov eax, dword [ebp + 8]
lea edx, [ecx + 0x3c]
mov esi, dword [ecx + 0x30]
add ecx, 0x20
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
mov edi, eax
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x40], esi
lea edx, [edi + 2]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x409093
sub edi, edx
mov eax, 0x7ffffffe
sar edi, 1
sub eax, esi
cmp eax, edi
jb 0x409262
cmp dword [ecx + 0x14], 8
jb 0x4090bc
mov ecx, dword [ecx]
mov dword [ebp - 0x1c], ecx
lea edx, [edi + esi]
mov dword [ebp - 0x2c], 0
mov esi, 7
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x20], edx
xorps xmm0, xmm0
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x18], eax
movups xmmword [ebp - 0x3c], xmm0
cmp edx, esi
jbe 0x40915f
mov esi, edx
or esi, 7
cmp esi, 0x7ffffffe
jbe 0x409110
mov eax, 0x7fffffff
mov esi, 0x7ffffffe
add eax, eax
push eax
call fcn.004011c0
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov edx, dword [ebp - 0x20]
jmp 0x409159
mov eax, 0xa
cmp esi, eax
cmovb esi, eax
lea eax, [esi + 1]
cmp eax, 0x7fffffff
ja 0x409267
add eax, eax
cmp eax, 0x1000
jb 0x409142
push eax
call fcn.004011c0
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov edx, dword [ebp - 0x20]
jmp 0x409159
test eax, eax
je 0x409157
push eax
call fcn.004149bb
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov edx, dword [ebp - 0x20]
jmp 0x409159
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x28], esi
mov esi, dword [ebp - 0x40]
add esi, esi
mov dword [ebp - 0x2c], edx
push esi
push ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [ebp - 0x18]
lea eax, [edi + edi]
push eax
push dword [ebp - 0x44]
add ecx, esi
push ecx
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov edx, dword [ebp - 0x20]
add esp, 0x18
mov word [eax + edx*2], cx
lea eax, [ebp - 0x3c]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 0x24]
push eax
push 0x41dbdc
call fcn.00406150
mov ecx, dword [ebp - 0x28]
mov esi, eax
mov dword [ebp - 4], 0xffffffff
cmp ecx, 8
jb 0x4091ec
mov edx, dword [ebp - 0x3c]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x4091e2
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4091e2
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.004149eb
add esp, 8
mov edx, dword [ebp - 0x48]
xor eax, eax
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 7
mov word [ebp - 0x3c], ax
test edx, edx
je 0x409243
mov eax, dword [ebp - 0x4c]
mov dword [edx], esi
mov ecx, dword [eax + 0xf4]
lea esi, [eax + 0xf0]
cmp ecx, dword [eax + 0xf8]
je 0x409230
mov dword [ecx], edx
add dword [eax + 0xf4], 4
mov eax, 1
jmp 0x409245
lea eax, [ebp - 0x14]
push eax
push ecx
mov ecx, esi
call fcn.004087d0
mov eax, 1
jmp 0x409245
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004149f9
mov esp, ebp
pop ebp
ret 8
call fcn.00401c90
call fcn.00401c10
int3