Function at 0x515ffc
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe48
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x1b4], ebx
mov esi, ecx
mov ebx, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00405d78
xor eax, eax
push ebp
push 0x5162d4
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 5], 0
mov word [0x5a8610], si
cmp dword [ebp + 8], 0
je 0x516043
mov eax, dword [ebp + 8]
mov byte [eax], 0
lea eax, [ebp - 0x1a0]
push eax
push 0x101
call sub.wsock32.dll_WSAStartup
test eax, eax
je 0x51607a
cmp dword [ebp + 8], 0
je 0x5162b3
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x5162f0
call fcn.00515e3c
pop ecx
jmp 0x5162b3
xor eax, eax
push ebp
push 0x5162ac
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x515dc8
call sub.wsock32.dll_WSASetBlockingHook
test eax, eax
jne 0x5160b9
cmp dword [ebp + 8], 0
je 0x5160af
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x516304
call fcn.00515e3c
pop ecx
call fcn.004052d4
jmp 0x5162b3
xor eax, eax
push ebp
push 0x516292
push dword fs:[eax]
mov dword fs:[eax], esp
push 6
push 1
push 2
call sub.wsock32.dll_socket
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x516103
cmp dword [ebp + 8], 0
je 0x5160f4
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x516320
call fcn.00515e3c
pop ecx
call fcn.004052d4
call fcn.004052d4
jmp 0x5162b3
xor eax, eax
push ebp
push 0x516278
push dword fs:[eax]
mov dword fs:[eax], esp
mov word [ebp - 0x1b0], 2
mov word [ebp - 0x1ae], 0
xor eax, eax
mov dword [ebp - 0x1ac], eax
push 0x10
lea eax, [ebp - 0x1b0]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_bind
test eax, eax
je 0x51616e
cmp dword [ebp + 8], 0
je 0x51615a
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x516330
call fcn.00515e3c
pop ecx
call fcn.004052d4
call fcn.004052d4
call fcn.004052d4
jmp 0x5162b3
mov word [ebp - 0x1b0], 2
push ebx
call sub.wsock32.dll_htons
mov word [ebp - 0x1ae], ax
movzx eax, byte [ebp + 0xc]
dec eax
sub al, 4
jae 0x5161c2
push ebp
lea edx, [ebp - 0x1b4]
mov eax, dword [ebp - 4]
call fcn.00515edc
pop ecx
mov eax, dword [ebp - 0x1b4]
call fcn.00405d88
push eax
call sub.wsock32.dll_inet_addr
mov dword [ebp - 0x1b8], eax
mov eax, dword [ebp - 0x1b8]
mov dword [ebp - 0x1ac], eax
jmp 0x5161e2
mov eax, dword [ebp - 4]
call fcn.00405d88
push eax
call sub.wsock32.dll_inet_addr
mov dword [ebp - 0x1b8], eax
mov eax, dword [ebp - 0x1b8]
mov dword [ebp - 0x1ac], eax
call sub.kernel32.dll_GetTickCount_1
mov dword [0x5a8614], eax
push 0x10
lea eax, [ebp - 0x1b0]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_connect
test eax, eax
je 0x516221
mov byte [ebp - 5], 0
cmp dword [ebp + 8], 0
je 0x516261
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x516340
call fcn.00515e3c
pop ecx
jmp 0x516261
mov dword [ebp - 0x10], 0x10
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1b0]
push eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_getpeername
test eax, eax
sete byte [ebp - 5]
cmp byte [ebp - 5], 0
jne 0x516261
cmp dword [ebp + 8], 0
je 0x516261
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x516350
call fcn.00515e3c
pop ecx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51627f
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_closesocket
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5162db
lea eax, [ebp - 0x1b4]
call fcn.004058b4
lea eax, [ebp - 4]
call fcn.004058b4
ret