Function at 0x50c410
Capabilities:
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffac
xor eax, eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x20], eax
xor eax, eax
push ebp
push 0x50c6ed
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 4], eax
cmp dword [ebp + 0xc], 0
je 0x50c6ca
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
push 0x40
mov eax, dword [ebp - 0xc]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c6ca
mov eax, dword [ebp - 0xc]
cmp word [eax], 0x5a4d
jne 0x50c6ca
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x3c]
add eax, dword [ebp - 0xc]
mov dword [ebp - 8], eax
push 0xf8
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c6ca
mov eax, dword [ebp - 8]
cmp dword [eax], 0x4550
jne 0x50c6ca
mov eax, dword [ebp - 8]
add eax, 0x78
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x50c6ca
mov eax, dword [ebp - 0x10]
cmp dword [eax], 0
je 0x50c6ca
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
push 0x28
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c6ca
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x20]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x24]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x1c]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x30], eax
cmp dword [ebp + 0xc], 0xffff
jle 0x50c59b
mov dword [ebp - 0x1c], 0xffffffff
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x18]
dec eax
test eax, eax
jl 0x50c5a7
inc eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x18]
shl eax, 2
add eax, dword [ebp - 0x2c]
mov dword [ebp - 0x3c], eax
push 4
mov eax, dword [ebp - 0x3c]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c591
lea eax, [ebp - 0x20]
mov edx, dword [ebp - 0x3c]
mov edx, dword [edx]
add edx, dword [ebp - 0xc]
call fcn.004045b8
lea eax, [ebp - 0x48]
mov edx, dword [ebp + 0xc]
call fcn.004045b8
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x20]
call fcn.004047cc
jne 0x50c591
mov eax, dword [ebp - 0x18]
add eax, eax
add eax, dword [ebp - 0x34]
mov dword [ebp - 0x40], eax
push 2
mov eax, dword [ebp - 0x40]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c591
mov eax, dword [ebp - 0x40]
movzx eax, word [eax]
mov dword [ebp - 0x1c], eax
inc dword [ebp - 0x18]
dec dword [ebp - 0x44]
jne 0x50c52b
jmp 0x50c5a7
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x14]
sub eax, dword [edx + 0x10]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jl 0x50c6ca
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x14]
cmp eax, dword [edx + 0x14]
jg 0x50c6ca
mov eax, dword [ebp - 0x1c]
shl eax, 2
add eax, dword [ebp - 0x30]
mov dword [ebp - 0x38], eax
push 4
mov eax, dword [ebp - 0x38]
push eax
call sub.kernel32.dll_IsBadReadPtr
test eax, eax
jne 0x50c6ca
mov eax, dword [ebp - 0x38]
mov eax, dword [eax]
mov edx, dword [ebp - 0x10]
cmp eax, dword [edx]
jb 0x50c5fd
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov edx, dword [ebp - 0x10]
add eax, dword [edx + 4]
mov edx, dword [ebp - 0x38]
cmp eax, dword [edx]
jae 0x50c619
mov eax, dword [ebp - 0x38]
cmp dword [eax], 0
je 0x50c6ca
mov eax, dword [ebp - 0x38]
mov eax, dword [eax]
add eax, dword [ebp - 0xc]
mov dword [ebp - 4], eax
jmp 0x50c6ca
lea eax, [ebp - 0x20]
mov edx, dword [ebp - 0x38]
mov edx, dword [edx]
add edx, dword [ebp + 8]
call fcn.004045b8
mov edx, dword [ebp - 0x20]
mov eax, 0x50c708
call fcn.004049c4
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jbe 0x50c6ca
lea eax, [ebp - 0x4c]
push eax
mov ecx, dword [ebp - 0x24]
dec ecx
mov edx, 1
mov eax, dword [ebp - 0x20]
call fcn.004048e0
mov eax, dword [ebp - 0x4c]
call fcn.00404880
push eax
call sub.kernel32.dll_GetModuleHandleA_2
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x50c695
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x24]
dec ecx
mov edx, 1
mov eax, dword [ebp - 0x20]
call fcn.004048e0
mov eax, dword [ebp - 0x50]
call fcn.00404880
push eax
call sub.kernel32.dll_LoadLibraryA
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x50c6ca
lea eax, [ebp - 0x54]
push eax
mov eax, dword [ebp - 0x20]
call fcn.00404680
mov ecx, eax
mov edx, dword [ebp - 0x24]
inc edx
mov eax, dword [ebp - 0x20]
call fcn.004048e0
mov eax, dword [ebp - 0x54]
call fcn.00404880
push eax
mov eax, dword [ebp - 0x28]
push eax
call sub.kernel32.dll_GetProcAddress_1
mov dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x50c6f4
lea eax, [ebp - 0x54]
mov edx, 4
call fcn.004043e4
lea eax, [ebp - 0x20]
call fcn.004043c0
ret