Function at 0x405040
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x45e642
mov eax, dword fs:[0]
push eax
sub esp, 0x78
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4c003c]
xor eax, esp
push eax
lea eax, [esp + 0x8c]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x30], edi
mov eax, dword [edi + 0x34]
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 8]
xor ecx, ecx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x2c], ecx
test edx, edx
jle 0x4053bc
mov eax, dword [edi + 0x34]
mov edx, dword [eax + 8]
add edx, ecx
mov ebp, dword [eax + edx*4 + 0x14]
lea eax, [esp + 0x20]
push eax
mov ecx, ebp
call fcn.004305f0
push eax
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x9c], 0
call fcn.004044f0
add esp, 8
mov edx, dword [esp + 0x20]
mov byte [esp + 0x94], 2
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x4050df
mov ecx, dword [esp + 0x20]
push ecx
call dword [0x46a6d4]
add esp, 4
mov eax, dword [esp + 0x50]
mov edx, eax
inc eax
mov dword [esp + 0x50], eax
test edx, edx
jne 0x4050fc
mov eax, dword [esp + 0x54]
cmp eax, dword [esp + 0x58]
je 0x4050fc
mov bl, 1
jmp 0x4050fe
xor bl, bl
test byte [esp + 0x14], 2
je 0x405125
and dword [esp + 0x14], 0xfffffffd
mov ecx, dword [esp + 0x34]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x405125
mov eax, dword [esp + 0x34]
push eax
call dword [0x46a6d4]
add esp, 4
test bl, bl
je 0x405378
test byte [esp + 0x14], 4
mov ecx, dword [esp + 0x54]
mov edi, dword [ecx]
mov dword [esp + 0x1c], edi
je 0x40515e
and dword [esp + 0x14], 0xfffffffb
mov edx, dword [esp + 0x38]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x40515e
mov ecx, dword [esp + 0x38]
push ecx
call dword [0x46a6d4]
add esp, 4
test byte [esp + 0x14], 0x10
mov esi, dword [esp + 0x50]
je 0x405189
and dword [esp + 0x14], 0xffffffef
mov edx, dword [esp + 0x3c]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x405189
mov ecx, dword [esp + 0x3c]
push ecx
call dword [0x46a6d4]
add esp, 4
test esi, esi
je 0x405349
lea eax, [edi + 8]
push eax
lea ecx, [esp + 0x1c]
call dword [0x46a714]
push 1
push 0
push ecx
mov byte [esp + 0x4c], 0x5f
mov edx, dword [esp + 0x4c]
mov ecx, esp
mov dword [esp + 0x34], esp
push edx
mov byte [esp + 0xa4], 3
call dword [0x46a71c]
lea ecx, [esp + 0x24]
call dword [0x46a66c]
mov ecx, dword [esp + 0x18]
mov ecx, dword [ecx + 8]
inc eax
sub ecx, eax
push ecx
lea edx, [esp + 0x28]
push edx
lea ecx, [esp + 0x20]
call dword [0x46a670]
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x98], 4
call dword [0x46a674]
mov eax, dword [esp + 0x24]
mov byte [esp + 0x94], 3
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x40521c
mov edx, dword [esp + 0x24]
push edx
call dword [0x46a75c]
add esp, 4
mov ecx, dword [ebp]
cmp dword [ecx + 0x3c], 0
je 0x405260
mov edx, dword [ecx + 0x38]
mov esi, ecx
mov eax, ecx
test edx, edx
jl 0x40524c
mov eax, dword [esi + edx*4 + 4]
cmp eax, ecx
je 0x405247
cmp dword [eax - 8], edi
jae 0x405247
mov esi, eax
mov eax, dword [eax + edx*4 + 4]
cmp eax, ecx
jne 0x405238
sub edx, 1
jns 0x405230
cmp eax, ecx
je 0x405255
cmp edi, dword [eax - 8]
jae 0x405257
mov eax, ecx
cmp eax, ecx
je 0x405260
mov esi, dword [eax - 4]
jmp 0x405263
or esi, 0xffffffff
mov ebx, dword [esp + 0x30]
mov ecx, dword [ebx + 0xc]
call dword [0x46be48]
cmp esi, eax
jge 0x405295
cmp esi, 0xffffffff
je 0x405295
mov ecx, dword [ebx + 0xc]
push esi
call dword [0x46be18]
add eax, 8
push eax
lea ecx, [esp + 0x1c]
call dword [0x46a6e8]
test al, al
jne 0x4052f8
mov ecx, dword [ebx + 0xc]
lea eax, [esp + 0x18]
push eax
call dword [0x46be6c]
mov dword [esp + 0x28], eax
mov eax, dword [ebp]
mov ecx, dword [eax + 0x34]
add eax, 0x34
cmp ecx, 1
je 0x4052bc
mov ecx, ebp
call fcn.0044e4d0
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x60]
push eax
mov ecx, ebp
call fcn.00430590
mov ecx, dword [ebp]
cmp eax, ecx
jne 0x4052ed
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x20]
push eax
lea edx, [esp + 0x64]
push edx
push ecx
mov ecx, ebp
call fcn.00403b20
jmp 0x4052f4
mov ecx, dword [esp + 0x28]
mov dword [eax - 4], ecx
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov byte [esp + 0x94], 2
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x40531b
mov ecx, dword [esp + 0x18]
push ecx
call dword [0x46a75c]
add esp, 4
dec dword [esp + 0x50]
test byte [esp + 0x14], 8
je 0x40515e
and dword [esp + 0x14], 0xfffffff7
mov edx, dword [esp + 0x44]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x40515e
mov ecx, dword [esp + 0x44]
jmp 0x405154
add dword [esp + 0x54], 4
test byte [esp + 0x14], 1
je 0x4050df
and dword [esp + 0x14], 0xfffffffe
mov edx, dword [esp + 0x48]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x4050df
mov ecx, dword [esp + 0x48]
jmp 0x4050d5
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x94], 0xffffffff
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x40539e
mov ecx, dword [esp + 0x4c]
push ecx
call dword [0x46a6d4]
add esp, 4
mov edi, dword [esp + 0x30]
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x2c]
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 8]
inc ecx
cmp ecx, edx
mov dword [esp + 0x2c], ecx
jl 0x40508b
mov ecx, dword [edi + 0xc]
mov esi, dword [edi + 0x2c]
call dword [0x46be48]
cmp esi, eax
jge 0x4053e7
mov ecx, dword [edi + 0xc]
push esi
call dword [0x46be18]
add eax, 8
push eax
lea ecx, [edi + 0x28]
call dword [0x46a6e8]
test al, al
jne 0x405400
mov ecx, dword [edi + 0xc]
lea eax, [edi + 0x28]
push eax
call dword [0x46be6c]
mov dword [edi + 0x2c], eax
cmp eax, 0xffffffff
jne 0x405400
xor al, al
jmp 0x405402
mov al, 1
mov ecx, dword [esp + 0x8c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x84
ret