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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push esi
mov eax, dword [ebp + 8]
cmp dword [eax], 0
je 0x4012d0
mov eax, 1
jmp 0x401536
mov ecx, dword fs:[0x30]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0xc]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov ecx, 4
shl ecx, 0
mov edx, dword [ebp - 0x34]
mov eax, dword [edx + ecx + 8]
mov dword [ebp - 0x1c], eax
jmp 0x401316
mov ecx, 4
imul edx, ecx, 0
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + edx]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x18], 0
je 0x4013a8
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x18]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x3c], ecx
mov edx, dword [ebp - 0x3c]
add edx, 0x78
mov dword [ebp - 0x40], edx
mov eax, 8
imul ecx, eax, 0
mov edx, dword [ebp - 0x40]
mov eax, dword [edx + ecx]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x401360
jmp 0x401305
mov ecx, dword [ebp - 0xc]
add ecx, dword [ebp - 0x24]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0xc]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
mov edx, dword [ecx]
or edx, 0x20202020
cmp edx, 0x6c64746e
je 0x40138d
jmp 0x401305
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax + 4]
or ecx, 0x20202020
cmp ecx, 0x6c642e6c
jne 0x4013a3
jmp 0x4013a8
jmp 0x401305
cmp dword [ebp - 0x10], 0
jne 0x4013b5
xor eax, eax
jmp 0x401536
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x18]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
add edx, dword [ecx + 0x1c]
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0x20]
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0x24]
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x14], 0
mov ecx, dword [ebp + 8]
add ecx, 4
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + edx*4 - 4]
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x2c]
movzx eax, word [edx]
cmp eax, 0x775a
jne 0x401450
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.0040153d
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 8]
mov dword [ecx + edx*8], eax
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x48]
movzx ecx, word [eax + edx*2 - 2]
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 8]
mov esi, dword [ebp - 0x4c]
mov ecx, dword [esi + ecx*4]
mov dword [eax + edx*8 + 4], ecx
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
cmp dword [ebp - 0x14], 0x1000
jne 0x401450
jmp 0x40146a
cmp dword [ebp - 0x14], 0x1000
jne 0x40145b
jmp 0x40146a
mov eax, dword [ebp - 0x18]
sub eax, 1
mov dword [ebp - 0x18], eax
jne 0x4013f2
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
mov dword [ecx], edx
mov dword [ebp - 0x20], 0
jmp 0x401484
mov eax, dword [ebp - 0x20]
add eax, 1
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
sub edx, 1
cmp dword [ebp - 0x20], edx
jae 0x401531
mov dword [ebp - 4], 0
jmp 0x4014a7
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
sub edx, dword [ebp - 0x20]
sub edx, 1
cmp dword [ebp - 4], edx
jae 0x40152c
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov eax, dword [ecx + eax*8 + 4]
cmp eax, dword [esi + edx*8 + 0xc]
jbe 0x401527
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [edx + ecx*8]
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [edx + ecx*8 + 4]
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov eax, dword [esi + eax*8 + 8]
mov dword [edx + ecx*8], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov eax, dword [esi + eax*8 + 0xc]
mov dword [edx + ecx*8 + 4], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x54]
mov dword [edx + ecx*8 + 8], eax
mov ecx, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x50]
mov dword [edx + ecx*8 + 0xc], eax
jmp 0x40149e
jmp 0x40147b
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret 4