Function at 0x50bed3
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x74
push ebx
push ebp
mov ebp, dword [esp + 0x80]
mov ebx, ecx
push esi
push edi
push 7
cmp byte [ebx + 0x68], 0
pop eax
push 3
pop ecx
cmovne eax, ecx
mov dword [esp + 0x1c], eax
test ebp, eax
jne 0x50c3a6
xor eax, eax
mov dword [esp + 0x30], eax
mov ecx, dword [ebx + 0x10]
test ecx, ecx
je 0x50bf2f
mov edx, dword [ebx + 0x3c]
test dx, dx
jne 0x50bf2f
mov dword [esp + 0x4c], edx
xor edx, edx
push edx
mov dword [esp + 0x54], edx
lea edx, [esp + 0x50]
mov eax, dword [ecx]
push edx
push ecx
call dword [eax + 0x10]
test eax, eax
jne 0x50c3a9
mov esi, dword [ebx + 4]
sub esi, ebp
cmp ebp, dword [ebx + 0xc]
jb 0x50c3a6
cmp ebp, dword [ebx + 4]
ja 0x50c3a6
cmp esi, 8
jb 0x50c3a6
mov edx, dword [ebx]
add edx, ebp
mov eax, dword [edx]
mov edi, dword [edx + 4]
mov dword [esp + 0x18], eax
or eax, edi
je 0x50c39e
mov ecx, dword [esp + 0x1c]
xor eax, eax
and ecx, dword [esp + 0x18]
and eax, edi
or ecx, eax
jne 0x50c3a6
xor eax, eax
cmp eax, edi
jb 0x50c3a6
ja 0x50bf8e
cmp esi, dword [esp + 0x18]
jb 0x50c3a6
mov eax, dword [ebx + 8]
mov esi, dword [esp + 0x18]
add eax, esi
mov dword [ebx + 8], eax
cmp eax, dword [ebx + 4]
ja 0x50c3a6
cmp byte [ebx + 0x69], 0
push 0x66
pop ecx
push 0x3e
pop eax
cmovne ecx, eax
xor eax, eax
cmp edi, eax
jb 0x50c3a6
ja 0x50bfc4
cmp esi, ecx
jb 0x50c3a6
or dword [esp + 0x58], 0xffffffff
or dword [esp + 0x5c], 0xffffffff
or dword [esp + 0x60], 0xffffffff
mov byte [esp + 0x69], al
mov eax, dword [edx + 8]
mov dword [esp + 0x44], eax
shr eax, 4
and eax, 0xffffff01
mov dword [esp + 0x2c], eax
mov byte [esp + 0x68], al
mov eax, dword [edx + 0x10]
mov dword [esp + 0x10], eax
mov eax, dword [edx + 0x14]
add edx, ecx
mov dword [esp + 0x14], eax
movzx eax, word [edx - 6]
movzx esi, word [edx - 2]
mov dword [esp + 0x3c], eax
movzx eax, word [edx - 4]
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x18]
mov dword [esp + 0x20], eax
test al, 1
jne 0x50c3a6
mov eax, dword [esp + 0x24]
test al, 1
jne 0x50c3a6
add eax, 2
cmp dword [esp + 0x24], 0
cmove eax, dword [esp + 0x24]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
not eax
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x20]
add eax, 2
cmp dword [esp + 0x20], 0
cmove eax, dword [esp + 0x20]
add eax, dword [esp + 0x28]
add eax, ecx
xor ecx, ecx
add eax, dword [esp + 0x1c]
and eax, dword [esp + 0x34]
cmp ecx, edi
ja 0x50c3a6
jb 0x50c07c
cmp eax, esi
ja 0x50c3a6
mov ecx, dword [esp + 0x24]
xor eax, eax
cmp word [ecx + edx], ax
jne 0x50c3a6
test ecx, ecx
je 0x50c0a3
xor esi, esi
cmp word [eax + edx], si
je 0x50c3a6
add eax, 2
cmp eax, ecx
jb 0x50c092
mov esi, dword [esp + 0x20]
test esi, esi
je 0x50c0d4
mov ecx, dword [esp + 0x28]
add ecx, edx
xor edx, edx
cmp word [ecx + esi], dx
jne 0x50c3a6
mov eax, edx
test esi, esi
je 0x50c0d4
cmp word [eax + ecx], dx
je 0x50c3a6
add eax, 2
cmp eax, esi
jb 0x50c0c3
mov eax, dword [esp + 0x8c]
lea esi, [esp + 0x54]
sub esp, 0x18
mov dword [esp + 0x78], eax
mov eax, dword [ebx + 0x60]
dec eax
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x7c], eax
push 6
pop ecx
mov edi, esp
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebx + 0x38]
call fcn.0050a608
add ebp, dword [esp + 0x18]
mov edi, eax
xor eax, eax
mov dword [esp + 0x40], edi
mov dword [esp + 0x38], eax
cmp dword [esp + 0x3c], eax
jbe 0x50c2f2
mov esi, dword [ebx + 4]
mov edx, esi
sub edx, ebp
cmp ebp, dword [ebx + 0xc]
jb 0x50c3a6
cmp ebp, esi
ja 0x50c3a6
cmp edx, 8
jb 0x50c3a6
mov edi, dword [ebx]
mov ecx, dword [esp + 0x1c]
add edi, ebp
mov dword [esp + 0x48], edi
mov eax, dword [edi]
mov dword [esp + 0x18], eax
mov eax, dword [edi + 4]
and ecx, dword [esp + 0x18]
mov dword [esp + 0x28], eax
xor eax, eax
and eax, dword [esp + 0x28]
or ecx, eax
jne 0x50c3a6
xor eax, eax
cmp eax, dword [esp + 0x28]
jb 0x50c3a6
ja 0x50c17f
cmp edx, dword [esp + 0x18]
jb 0x50c3a6
mov cl, byte [ebx + 0x69]
push 0x28
pop eax
push 0x18
test cl, cl
pop edx
cmovne eax, edx
xor edx, edx
cmp dword [esp + 0x28], edx
jb 0x50c3a6
ja 0x50c1a5
cmp dword [esp + 0x18], eax
jb 0x50c3a6
mov eax, dword [esp + 0x18]
add dword [ebx + 8], eax
cmp dword [ebx + 8], esi
ja 0x50c3a6
test cl, cl
je 0x50c1bd
push 0x10
jmp 0x50c1cb
mov eax, dword [edi + 8]
or eax, dword [edi + 0xc]
jne 0x50c3a6
push 0x24
pop edx
movzx ecx, word [edx + edi]
test cl, 1
jne 0x50c3a6
mov esi, dword [esp + 0x1c]
lea eax, [ecx + 2]
test ecx, ecx
cmove eax, ecx
add esi, 2
add eax, edx
add eax, esi
xor esi, esi
and eax, dword [esp + 0x34]
cmp esi, dword [esp + 0x28]
ja 0x50c3a6
jb 0x50c208
cmp eax, dword [esp + 0x18]
ja 0x50c3a6
add edx, edi
xor eax, eax
cmp word [edx + ecx + 2], ax
jne 0x50c3a6
test ecx, ecx
je 0x50c22f
xor esi, esi
cmp word [eax + edx + 2], si
je 0x50c3a6
add eax, 2
cmp eax, ecx
jb 0x50c21d
mov edx, dword [ebx]
add edx, dword [esp + 0x54]
test ecx, ecx
jne 0x50c289
test dword [esp + 0x44], 0x400
jne 0x50c249
cmp byte [esp + 0x2c], cl
jne 0x50c289
cmp byte [ebx + 0x69], 0
jne 0x50c27d
lea edi, [edx + 0x40]
mov ecx, edi
call fcn.00502d42
test al, al
je 0x50c289
mov esi, dword [esp + 0x48]
add esi, 0x10
mov ecx, esi
call fcn.00502d42
test al, al
jne 0x50c2d7
push 0x14
push esi
push edi
call sub.msvcrt.dll_memcpy
add esp, 0xc
jmp 0x50c2d7
push 4
lea eax, [edi + 8]
push eax
lea eax, [edx + 0x10]
push eax
jmp 0x50c273
mov eax, dword [esp + 0x40]
lea esi, [esp + 0x6c]
or dword [esp + 0x70], 0xffffffff
sub esp, 0x18
or dword [esp + 0x8c], 0xffffffff
mov dword [esp + 0x90], eax
mov eax, dword [ebx + 0x60]
push 6
pop ecx
dec eax
mov word [esp + 0x98], 0x100
mov edi, esp
mov dword [esp + 0x94], eax
mov dword [esp + 0x84], ebp
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebx + 0x38]
mov byte [ebx + 0x6b], 1
call fcn.0050a608
mov eax, dword [esp + 0x38]
add ebp, dword [esp + 0x18]
inc eax
mov dword [esp + 0x38], eax
cmp eax, dword [esp + 0x3c]
jb 0x50c11b
mov edi, dword [esp + 0x40]
cmp dword [esp + 0x8c], 0
jge 0x50c373
cmp dword [esp + 0x30], 0
jne 0x50c373
cmp dword [esp + 0x20], 0
jne 0x50c373
cmp dword [esp + 0x24], 0
jne 0x50c373
cmp byte [esp + 0x2c], 0
je 0x50c395
mov eax, dword [ebx + 4]
mov edx, dword [ebx]
sub eax, ebp
add edx, ebp
cmp eax, 8
jb 0x50c373
mov eax, dword [edx]
or eax, dword [edx + 4]
mov esi, dword [esp + 0x14]
jne 0x50c377
mov ecx, dword [ebx + 0x60]
mov eax, dword [ebx + 0x5c]
mov eax, dword [eax + ecx*4 - 4]
mov ecx, dword [esp + 0x10]
mov dword [eax + 0x1c], 1
mov eax, ecx
or eax, esi
je 0x50c37b
mov eax, dword [ebx + 4]
sub eax, ebp
cmp eax, 0x10
jb 0x50c37b
mov eax, dword [edx + 8]
or eax, dword [edx + 0xc]
je 0x50c37b
xor edx, edx
lea eax, [ebp + 8]
cmp edx, esi
ja 0x50c37b
jb 0x50c36d
cmp eax, ecx
jae 0x50c37b
mov ecx, eax
mov esi, edx
jmp 0x50c37b
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp byte [esp + 0x2c], 0
je 0x50c395
mov eax, ecx
or eax, esi
je 0x50c395
push edi
push ecx
mov ecx, ebx
call fcn.0050bed3
test eax, eax
jne 0x50c3a9
inc dword [esp + 0x30]
jmp 0x50bf02
add dword [ebx + 8], 8
xor eax, eax
jmp 0x50c3a9
xor eax, eax
inc eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x74
ret 8