Function at 0x40d040
Capabilities:
Access peb ldr_data
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
push esi
cmp dword [0x4899c8], 0
je 0x40d05a
mov eax, 1
jmp 0x40d2b2
mov eax, dword fs:[0x30]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov eax, 4
shl eax, 0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + eax + 8]
mov dword [ebp - 0x1c], edx
jmp 0x40d09f
mov eax, 4
imul ecx, eax, 0
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + ecx]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
cmp dword [ecx + 0x18], 0
je 0x40d12f
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x18]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x10]
add eax, dword [edx + 0x3c]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
add ecx, 0x78
mov dword [ebp - 0x3c], ecx
mov edx, 8
imul eax, edx, 0
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ecx + eax]
mov dword [ebp - 0x20], edx
cmp dword [ebp - 0x20], 0
jne 0x40d0e9
jmp 0x40d08e
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
add edx, dword [ecx + 0xc]
mov dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax]
or ecx, 0x20202020
cmp ecx, 0x6c64746e
je 0x40d116
jmp 0x40d08e
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 4]
or eax, 0x20202020
cmp eax, 0x6c642e6c
jne 0x40d12a
jmp 0x40d12f
jmp 0x40d08e
cmp dword [ebp - 0x14], 0
jne 0x40d13c
xor eax, eax
jmp 0x40d2b2
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x18]
mov dword [ebp - 0x18], edx
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
add ecx, dword [eax + 0x1c]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
add eax, dword [edx + 0x20]
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
add edx, dword [ecx + 0x24]
mov dword [ebp - 0x44], edx
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0x4899cc
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp - 0x10]
add edx, dword [ecx + eax*4 - 4]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
movzx ecx, word [eax]
cmp ecx, 0x775a
jne 0x40d1d9
mov edx, dword [ebp - 0x28]
push edx
call fcn.0040c580
add esp, 4
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov dword [edx + ecx*8], eax
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x44]
movzx edx, word [ecx + eax*2 - 2]
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0x48]
mov edx, dword [esi + edx*4]
mov dword [ecx + eax*8 + 4], edx
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0x1f4
jne 0x40d1d9
jmp 0x40d1e4
mov ecx, dword [ebp - 0x18]
sub ecx, 1
mov dword [ebp - 0x18], ecx
jne 0x40d177
mov edx, dword [ebp - 0xc]
mov dword [0x4899c8], edx
mov dword [ebp - 0xc], 0
jmp 0x40d1ff
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
mov ecx, dword [0x4899c8]
sub ecx, 1
cmp dword [ebp - 0xc], ecx
jae 0x40d2ad
mov dword [ebp - 4], 0
jmp 0x40d223
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [0x4899c8]
sub eax, dword [ebp - 0xc]
sub eax, 1
cmp dword [ebp - 4], eax
jae 0x40d2a8
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov ecx, dword [edx + ecx*8 + 4]
cmp ecx, dword [esi + eax*8 + 0xc]
jbe 0x40d2a3
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edx*8]
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [eax + edx*8 + 4]
mov dword [ebp - 0x4c], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov ecx, dword [esi + ecx*8 + 8]
mov dword [eax + edx*8], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov ecx, dword [esi + ecx*8 + 0xc]
mov dword [eax + edx*8 + 4], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x50]
mov dword [eax + edx*8 + 8], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x4c]
mov dword [eax + edx*8 + 0xc], ecx
jmp 0x40d21a
jmp 0x40d1f6
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret