Function at 0x405900
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push 0xffffffffffffffff
push 0x4df3f8
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov eax, dword [0x517050]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
mov esi, ecx
mov ebp, dword [esp + 0x30]
mov eax, dword [ebp + 0x34]
mov ecx, dword [ebp + 0x30]
movzx ecx, word [eax + ecx]
movzx ecx, cx
add eax, 2
cmp ecx, 5
mov dword [ebp + 0x34], eax
je 0x40594c
xor eax, eax
jmp 0x405bbb
call fcn.0041cdb6
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x405966
push 0x80004005
call fcn.0040b720
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x30], eax
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x28], 0
mov ecx, dword [0x5302e4]
neg ecx
sbb ecx, ecx
and ecx, 0xe
add ecx, 0x3a8
push ecx
lea edi, [esp + 0x34]
call fcn.00401db0
mov eax, dword [ebp + 4]
add esp, 4
test eax, eax
je 0x4059c3
mov ecx, dword [ebp + 8]
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jb 0x4059c8
call fcn.0043ddbb
mov eax, dword [ebp + 4]
mov edi, dword [ebp + 0x34]
mov ecx, dword [ebp + 0x30]
lea edx, [esi + esi*2]
lea esi, [eax + edx*8]
mov dword [esp + 0x34], edi
jmp 0x4059e0
mov eax, dword [ebp + 0x34]
mov dl, byte [ecx + eax]
add eax, 1
test dl, dl
mov dword [ebp + 0x34], eax
jne 0x4059e0
sub eax, edi
mov edi, eax
lea eax, [esp + 0x30]
push eax
call fcn.00408f60
mov ecx, dword [esp + 0x30]
mov eax, dword [ecx - 0xc]
mov ebx, dword [esi + 4]
add eax, 1
cmp edi, eax
mov dword [esp + 0x14], eax
jb 0x405af4
cmp ebx, dword [esi + 8]
jbe 0x405a21
call fcn.0043ddbb
mov edx, dword [esp + 0x34]
mov dword [esp + 0x1c], ebx
add ebx, edx
cmp ebx, dword [esi + 8]
ja 0x405a35
cmp ebx, dword [esi + 4]
jae 0x405a3a
call fcn.0043ddbb
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x14]
lea ecx, [eax + edx]
push ebx
mov eax, esi
push eax
mov byte [esp + 0x20], 0
mov eax, dword [esp + 0x20]
push eax
mov eax, dword [esp + 0x3c]
push eax
mov eax, dword [esp + 0x40]
push eax
push ecx
lea ecx, [esp + 0x30]
push ecx
mov ebx, edx
call fcn.0040ad90
add esp, 0x1c
cmp edi, dword [esp + 0x14]
jbe 0x405b8e
mov ebx, dword [esi + 4]
cmp ebx, dword [esi + 8]
jbe 0x405a84
call fcn.0043ddbb
mov ebp, dword [ebp + 0x34]
add ebp, ebx
cmp ebp, dword [esi + 8]
mov dword [esp + 0x1c], ebx
ja 0x405a97
cmp ebp, dword [esi + 4]
jae 0x405a9c
call fcn.0043ddbb
mov ebx, dword [esi + 4]
cmp ebx, dword [esi + 8]
jbe 0x405aa9
call fcn.0043ddbb
mov edx, dword [esp + 0x34]
mov dword [esp + 0x1c], ebx
add ebx, edx
cmp ebx, dword [esi + 8]
ja 0x405abd
cmp ebx, dword [esi + 4]
jae 0x405ac2
call fcn.0043ddbb
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], ebx
add ebx, eax
cmp ebx, dword [esi + 8]
mov edi, esi
ja 0x405ad8
cmp ebx, dword [esi + 4]
jae 0x405add
call fcn.0043ddbb
push ebp
mov eax, esi
push eax
push ebx
push edi
lea ecx, [esp + 0x28]
push ecx
mov ebx, esi
call fcn.00408b60
jmp 0x405b8e
cmp ebx, dword [esi + 8]
jbe 0x405afe
call fcn.0043ddbb
mov ebp, dword [ebp + 0x34]
add ebp, ebx
cmp ebp, dword [esi + 8]
mov dword [esp + 0x1c], ebx
ja 0x405b11
cmp ebp, dword [esi + 4]
jae 0x405b16
call fcn.0043ddbb
mov ebx, dword [esi + 4]
cmp ebx, dword [esi + 8]
jbe 0x405b23
call fcn.0043ddbb
mov edx, dword [esp + 0x34]
mov dword [esp + 0x1c], ebx
add ebx, edx
cmp ebx, dword [esi + 8]
ja 0x405b37
cmp ebx, dword [esi + 4]
jae 0x405b3c
call fcn.0043ddbb
push ebp
mov eax, esi
push eax
push ebx
push esi
lea eax, [esp + 0x28]
push eax
mov ebx, esi
call fcn.00408b60
mov ebx, dword [esi + 4]
cmp ebx, dword [esi + 8]
jbe 0x405b5b
call fcn.0043ddbb
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x1c], ebx
add ebx, ecx
cmp ebx, dword [esi + 8]
ja 0x405b6f
cmp ebx, dword [esi + 4]
jae 0x405b74
call fcn.0043ddbb
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x14]
push ebx
push esi
push edx
add ecx, eax
push ecx
push eax
mov ecx, esi
call fcn.0040ae00
mov dword [esp + 0x28], 0xffffffff
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405bb6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 8