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

Disassembly:
sub esp, 0x64
push ebx
push ebp
push esi
mov esi, dword [esp + 0x78]
push edi
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
cmp ebx, 8
mov dword [esp + 0x24], ebx
jl 0x51f8c9
lea eax, [ebx + 1]
push eax
call fcn.0052194e
mov ebp, eax
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
add esp, 4
mov dword [esp + 0x14], ebp
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x30], eax
mov edx, ecx
mov esi, edi
mov edi, ebp
mov dword [esp + 0x34], eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov dword [esp + 0x38], eax
and ecx, 3
mov dword [esp + 0x3c], eax
rep movsb byte es:[edi], byte [esi]
mov dword [esp + 0x40], eax
lea eax, [ebx + ebp]
xor ecx, ecx
xor ebx, ebx
cmp ebp, eax
mov dword [esp + 0x2c], ecx
mov esi, ebp
mov dword [esp + 0x20], eax
mov edi, ebp
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], ecx
jae 0x51f8c0
mov al, byte [esi]
test al, al
jge 0x51f6e1
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x51f7cf
cmp esi, ebp
jbe 0x51f7cf
push 2
push 0x7bbdbf
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f5e6
test ebx, ebx
jne 0x51f7cf
mov byte [esi], bl
add esi, 2
mov ebx, 1
mov dword [esp + 0x2c], edi
mov edi, esi
mov dword [esp + 0x18], ebx
jmp 0x51f7c3
push 2
push 0x7bbdbb
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f618
cmp ebx, 1
jne 0x51f7cf
mov byte [esi], al
add esi, 2
mov dword [esp + 0x30], edi
mov edi, esi
mov ebx, 2
jmp 0x51f7c3
push 2
push 0x7bbdb7
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f649
cmp ebx, 2
jne 0x51f7cf
mov byte [esi], al
add esi, ebx
mov dword [esp + 0x34], edi
mov edi, esi
mov ebx, 3
jmp 0x51f7c3
push 2
push 0x7bbdb3
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f67b
cmp ebx, 3
jne 0x51f7cf
mov byte [esi], al
add esi, 2
mov dword [esp + 0x38], edi
mov edi, esi
mov ebx, 4
jmp 0x51f7c3
push 2
push 0x7bbdaf
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f6ad
cmp ebx, 4
jne 0x51f7cf
mov byte [esi], al
add esi, 2
mov dword [esp + 0x3c], edi
mov edi, esi
mov ebx, 5
jmp 0x51f7c3
push 2
push 0x7bbdab
push esi
call fcn.00521a31
add esp, 0xc
test eax, eax
jne 0x51f7cf
cmp ebx, 5
jne 0x51f7cf
mov byte [esi], al
add esi, 2
mov dword [esp + 0x40], edi
mov ebx, 6
jmp 0x51f7c3
cmp al, 0x30
jl 0x51f6fe
cmp al, 0x39
jg 0x51f6fe
mov al, byte [esi + 1]
inc esi
test al, al
jne 0x51f7c3
mov dword [esp + ebx*4 + 0x2c], edi
jmp 0x51f7c2
test ebx, ebx
jne 0x51f746
mov ecx, dword [esp + 0x10]
test ecx, ecx
jne 0x51f7ad
mov ecx, dword [esp + 0x18]
test ecx, ecx
jne 0x51f7cf
cmp al, 0x2f
je 0x51f72a
cmp al, 0x2d
je 0x51f72a
cmp al, 0x2e
jne 0x51f7cf
movsx ecx, al
mov byte [esi], 0
mov ebx, 1
inc esi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], ebx
mov edi, esi
jmp 0x51f7c3
cmp ebx, 3
jne 0x51f77f
mov ecx, dword [esp + 0x10]
test ecx, ecx
jne 0x51f7ad
mov ecx, dword [esp + 0x18]
test ecx, ecx
jne 0x51f7cf
cmp al, 0x2f
je 0x51f767
cmp al, 0x2d
je 0x51f767
cmp al, 0x3a
jne 0x51f7cf
movsx edx, al
mov byte [esi], 0
inc esi
mov dword [esp + 0x38], edi
mov dword [esp + 0x10], edx
mov edi, esi
mov ebx, 4
jmp 0x51f7c3
cmp ebx, 2
jne 0x51f7ad
cmp al, 0x20
je 0x51f794
cmp al, 0x2f
je 0x51f794
cmp al, 0x2d
je 0x51f794
test al, al
jne 0x51f7ad
mov byte [esi], 0
inc esi
mov dword [esp + 0x34], edi
mov edi, esi
mov ebx, 3
mov dword [esp + 0x10], 0
jmp 0x51f7c3
mov ecx, dword [esp + 0x10]
movsx eax, al
cmp ecx, eax
jne 0x51f7cf
mov byte [esi], 0
inc esi
mov dword [esp + ebx*4 + 0x2c], edi
mov edi, esi
inc ebx
cmp esi, dword [esp + 0x20]
jb 0x51f593
jmp 0x51f7d9
cmp esi, dword [esp + 0x20]
jb 0x51f8c0
cmp ebx, 1
jne 0x51f8b7
mov ecx, dword [esp + 0x14]
push ecx
call fcn.005212cc
push 0x100
call fcn.0052194e
mov ecx, eax
xor edx, edx
mov dword [esp + 0x1c], eax
mov esi, eax
mov dword [ecx], edx
mov eax, dword [esp + 0x2c]
add esp, 8
xor ebp, ebp
mov dword [ecx + 4], edx
xor ebx, ebx
test eax, eax
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], edx
mov dword [ecx + 0x10], edx
jle 0x51f869
mov edi, dword [esp + 0x7c]
test ebx, ebx
jne 0x51f849
mov edx, dword [esp + 0x7c]
push 4
push edx
push esi
call fcn.00521a71
mov dword [esp + 0x38], esi
add esp, 0xc
add esi, 5
add ebp, 4
mov ebx, 1
add edi, 4
jmp 0x51f863
push 2
push edi
push esi
call fcn.00521a71
mov dword [esp + ebx*4 + 0x38], esi
add esp, 0xc
add esi, 3
inc ebx
add ebp, 2
add edi, 2
cmp ebp, dword [esp + 0x24]
jl 0x51f821
xor edi, edi
xor ebp, ebp
cmp ebx, edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], ebp
jle 0x51f9d0
mov esi, 0x1f
mov eax, dword [esp + ebp*4 + 0x2c]
push eax
call fcn.00521391
add esp, 4
cmp ebp, 5
mov ecx, eax
ja case.default.0x51f8a2
jmp dword [ebp*4 + 0x51fa25]
test ecx, ecx
jne 0x51f8d3
mov edi, 1
jmp case.default.0x51f8a2
cmp ebx, 2
jge 0x51f869
mov ebp, dword [esp + 0x14]
push ebp
call fcn.005212cc
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x64
ret
mov dword [esp + 0x7c], ecx
jmp case.default.0x51f8a2
cmp ecx, 1
jl 0x51f9b8
cmp ecx, 0xc
jg 0x51f9b8
mov dword [esp + 0x10], ecx
jmp case.default.0x51f8a2
mov eax, 0x1e
mov ebp, 0x190
mov dword [esp + 0x50], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x44], esi
cdq
idiv ebp
mov dword [esp + 0x48], 0x1c
mov dword [esp + 0x4c], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x68], esi
mov dword [esp + 0x70], esi
test edx, edx
je 0x51f963
mov eax, dword [esp + 0x7c]
mov ebp, 0x64
cdq
idiv ebp
test edx, edx
je 0x51f96b
mov edx, dword [esp + 0x7c]
and edx, reloc.WS2_32.dll_closesocket
jns 0x51f961
dec edx
or edx, 0xfffffffc
inc edx
jne 0x51f96b
mov dword [esp + 0x48], 0x1d
cmp ecx, 1
jl 0x51f984
mov eax, dword [esp + 0x10]
cmp ecx, dword [esp + eax*4 + 0x40]
ja 0x51f984
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x28], ecx
jmp case.default.0x51f8a2
mov ebp, dword [esp + 0x18]
mov edi, 1
jmp case.default.0x51f8a2
cmp ecx, 0x17
jle 0x51f99b
mov edi, 1
jmp case.default.0x51f8a2
mov dword [esp + 0x1c], ecx
jmp case.default.0x51f8a2
cmp ecx, 0x3b
jle 0x51f9ad
mov edi, 1
jmp case.default.0x51f8a2
mov dword [esp + 0x20], ecx
jmp case.default.0x51f8a2
cmp ecx, 0x3b
jle 0x51f9bf
mov edi, 1
jmp case.default.0x51f8a2
mov dword [esp + 0x24], ecx
inc ebp
cmp ebp, ebx
mov dword [esp + 0x18], ebp
jl 0x51f88a
mov ecx, dword [esp + 0x14]
push ecx
call fcn.005212cc
add esp, 4
test edi, edi
jne 0x51f8c9
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x2c]
push eax
mov eax, dword [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x88]
push edx
push eax
push ecx
call fcn.00520ac1
mov edx, dword [esp + 0x90]
add esp, 0x18
mov eax, 1
fstp qword [edx]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret