Function at 0x51fff0
Capabilities:
Connect socket
Set socket configuration

Disassembly:
sub esp, 0x50
mov eax, dword [0x5df040]
xor eax, esp
mov dword [esp + 0x4c], eax
mov ecx, dword [esp + 0x5c]
mov edx, 2
push ebx
mov ebx, dword [esp + 0x58]
push ebp
mov ebp, dword [esp + 0x60]
push esi
mov esi, ecx
neg esi
mov eax, dword [ebp + 4]
sbb esi, esi
add esi, 2
mov dword [esp + 0xc], esi
push edi
lea edi, [edx + 0x15]
sub eax, 2
je 0x520096
sub eax, 0x15
je 0x520046
pop edi
pop esi
pop ebp
lea eax, [edx + 7]
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
mov dword [esp + 0x14], 0x1c
xorps xmm0, xmm0
movlpd qword [esp + 0x28], xmm0
movlpd qword [esp + 0x30], xmm0
mov dword [esp + 0x38], 0
mov word [esp + 0x24], di
test ecx, ecx
je 0x520074
movzx eax, word [ebp + 0x1a]
jmp 0x520078
movzx eax, word [ebp + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_htons]
movups xmm0, xmmword [ebp + 8]
mov word [esp + 0x26], ax
mov eax, dword [ebp + 0x5c]
movups xmmword [esp + 0x2c], xmm0
mov dword [esp + 0x3c], eax
jmp 0x5200cd
mov dword [esp + 0x14], 0x10
xorps xmm0, xmm0
movlpd qword [esp + 0x2c], xmm0
mov word [esp + 0x24], dx
test ecx, ecx
je 0x5200b6
movzx eax, word [ebp + 0x1a]
jmp 0x5200ba
movzx eax, word [ebp + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x26], ax
mov eax, dword [ebp + 8]
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0xb4]
mov ecx, dword [ebp + 4]
test eax, eax
je 0x5200f1
mov eax, dword [eax]
test eax, eax
je 0x5200f1
push dword [ebx + 0xb8]
push 0
push esi
push ecx
call eax
add esp, 0x10
jmp 0x5200fb
push 0
push esi
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x5202f8
mov edi, dword [ebp + 0x74]
mov eax, dword [edi + 0xb4]
test eax, eax
je 0x52011c
cmp dword [eax], 0
jne 0x520206
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 1
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [edi + 0x1c], 0
lea eax, [edi + 0x1c]
jle 0x52015b
push 4
push eax
push 0x1001
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x5202db
cmp dword [edi + 0x20], 0
lea eax, [edi + 0x20]
jle 0x520181
push 4
push eax
push 0x1002
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x5202db
mov eax, dword [ebp + 4]
cmp eax, 2
jne 0x5201b3
cmp dword [edi + 0x68], 0
je 0x5201e6
xorps xmm0, xmm0
movups xmmword [esp + 0x40], xmm0
mov word [esp + 0x40], ax
push dword [edi + 0x68]
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x44], eax
mov eax, 0x10
jmp 0x5202c6
cmp eax, 0x17
jne 0x5201e6
cmp dword [ebp + 0x5c], 0
jne 0x5201e6
lea eax, [edi + 0x6c]
mov edx, 0x59c184
mov dword [esp + 0x18], eax
mov ecx, eax
mov edi, 0xc
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x520295
add ecx, 4
add edx, 4
sub edi, 4
jae 0x5201d1
cmp dword [ebp + 4], 0x17
jne 0x520206
push 4
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push 0x1b
push 0x29
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp dword [esp + 0x6c], 0
je 0x52023f
mov eax, dword [ebx + 0xb4]
mov dword [esp + 0x20], 1
test eax, eax
je 0x520224
cmp dword [eax], 0
jne 0x52023f
push 4
lea eax, [esp + 0x24]
push eax
push 1
push 6
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x52035d
mov eax, dword [ebx + 0xac]
mov edi, dword [esp + 0x10]
test eax, eax
je 0x520262
push dword [ebx + 0xb0]
push edi
push esi
call eax
add esp, 0xc
test eax, eax
js 0x52035d
mov eax, dword [ebx + 0xb4]
test eax, eax
je 0x520319
mov eax, dword [eax + 8]
test eax, eax
je 0x520319
push dword [ebx + 0xb8]
lea ecx, [esp + 0x28]
push dword [esp + 0x18]
push ecx
push esi
call eax
add esp, 0x10
jmp 0x520329
xorps xmm0, xmm0
mov dword [esp + 0x58], 0
movups xmmword [esp + 0x40], xmm0
mov eax, 0x17
movq qword [esp + 0x50], xmm0
mov word [esp + 0x40], ax
mov eax, dword [esp + 0x18]
movups xmm0, xmmword [eax]
mov eax, 0x1c
movups xmmword [esp + 0x48], xmm0
push eax
lea eax, [esp + 0x44]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x5201e6
mov eax, dword [ebx + 0xb4]
test eax, eax
je 0x520310
mov eax, dword [eax + 4]
test eax, eax
je 0x520310
push dword [ebx + 0xb8]
push esi
call eax
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0xb
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x5202f8
push dword [esp + 0x14]
lea eax, [esp + 0x28]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x520342
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x520342
cmp eax, 0x2733
jne 0x52035d
mov eax, dword [ebx + 0xa4]
test eax, eax
je 0x520366
push dword [ebx + 0xa8]
push edi
push esi
call eax
add esp, 0xc
test eax, eax
jns 0x520366
push esi
push ebx
call fcn.0051ff70
jmp 0x5202f5
push 0x14
call dword [0x5df5e8]
mov edi, eax
add esp, 4
test edi, edi
jne 0x520397
push esi
push ebx
call fcn.0051ff70
add esp, 8
lea eax, [edi + 0xf]
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
push 0
mov dword [edi + 4], esi
mov dword [edi], ebp
call fcn.00514930
mov ecx, dword [esp + 0x70]
add esp, 4
mov dword [edi + 0x10], eax
mov dword [edi + 8], ecx
test eax, eax
jne 0x5203f2
push esi
push ebx
call fcn.0051ff70
push edi
call dword [0x5df5f0]
add esp, 0xc
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
mov eax, dword [ebp + 0x64]
push edi
push eax
test ecx, ecx
je 0x520402
call fcn.00514a60
jmp 0x520407
call fcn.00514a00
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x520443
push esi
push ebx
call fcn.0051ff70
push dword [edi + 0x10]
call fcn.00514950
push edi
call dword [0x5df5f0]
add esp, 0x10
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
push eax
push esi
push dword [ebx + 0x98]
call fcn.005153e0
add esp, 0xc
test eax, eax
jne 0x520491
push esi
push ebx
call fcn.0051ff70
push dword [edi + 0x10]
call fcn.00514950
push dword [esp + 0x1c]
call fcn.00514af0
push edi
call dword [0x5df5f0]
add esp, 0x14
mov eax, 0xf
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret
mov eax, dword [ebx + 0x9c]
test eax, eax
je 0x5204ab
push 0
push 1
push esi
push dword [ebx + 0xa0]
call eax
add esp, 0x10
cmp dword [esp + 0x6c], 0
je 0x5204b5
mov dword [ebp + 0x68], edi
mov ecx, dword [esp + 0x5c]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00423495
add esp, 0x50
ret