Function at 0x4040e0
Capabilities:
Access peb ldr_data
Get process heap flags
Get process heap force flags

Disassembly:
push 0xffffffffffffffff
push 0x421528
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov ebp, ecx
mov dword [esp + 0x30], 1
call fcn.0041745e
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
lea edi, [eax + 0x10]
mov dword [esp + 0x14], edi
mov byte [esp + 0x30], 2
call fcn.0041745e
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x38]
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x24], esp
mov bl, 3
mov esi, esp
push eax
mov byte [esp + 0x38], bl
mov dword [esp + 0x28], eax
call fcn.004019a0
add eax, 0x10
add esp, 4
mov ecx, ebp
mov dword [esi], eax
call fcn.00403bf0
mov esi, eax
push 0x422a74
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x24]
push ecx
call fcn.00401f20
add esp, 0xc
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x34], 4
call fcn.00401fe0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
mov byte [esp + 0x30], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4041a8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x40]
push 0
push 0x42249c
call fcn.00401580
cmp esi, 0xffffffff
je 0x40425c
imul esi, esi, 0x1c
mov eax, dword [esi + ebp + 0x30]
test eax, eax
lea ebx, [esi + ebp]
mov esi, dword [ebx + 0x28]
mov dword [esp + 0x18], 0
jle 0x40425c
mov edi, edi
test esi, esi
je 0x40422e
lea eax, [esi + 8]
push eax
lea ecx, [esp + 0x18]
call fcn.00401fe0
mov eax, dword [esp + 0x10]
test eax, eax
mov edi, dword [esp + 0x14]
je 0x40421a
mov ecx, dword [edi - 0xc]
test ecx, ecx
jl 0x40421a
push eax
push edi
call fcn.00408270
add esp, 8
test eax, eax
je 0x40421a
sub eax, edi
mov dword [esp + 0x24], eax
je 0x404233
mov eax, dword [esp + 0x18]
mov ecx, dword [ebx + 0x30]
mov esi, dword [esi]
inc eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jl 0x4041e0
jmp 0x40425c
call fcn.004162d3
mov eax, dword [esp + 0x40]
push eax
lea ecx, [esp + 0x40]
push ecx
push ecx
lea eax, [edi - 0x10]
mov dword [esp + 0x4c], esp
mov esi, esp
push eax
call fcn.004019a0
add eax, 0x10
add esp, 4
mov ecx, ebp
mov dword [esi], eax
call fcn.00403a50
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov byte [esp + 0x30], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40427f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
add edi, 0xfffffff0
mov byte [esp + 0x30], 1
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40429e
mov ecx, dword [edi]
mov edx, dword [ecx]
push edi
call dword [edx + 4]
mov eax, dword [esp + 0x20]
mov byte [esp + 0x30], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4042be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
mov dword [esp + 0x30], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4042e4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x28]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x24
ret 0xc