Function at 0x4d5458
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.004053f4
xor eax, eax
push ebp
push 0x4d5758
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 5], 0
mov word [0x563cf0], si
cmp dword [ebp + 8], 0
je 0x4d549f
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 0x4d54d6
cmp dword [ebp + 8], 0
je 0x4d5737
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d5774
call fcn.004d52a4
pop ecx
jmp 0x4d5737
xor eax, eax
push ebp
push 0x4d5730
push dword fs:[eax]
mov dword fs:[eax], esp
push 0x4d524c
call sub.wsock32.dll_WSASetBlockingHook
test eax, eax
jne 0x4d5515
cmp dword [ebp + 8], 0
je 0x4d550b
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d5788
call fcn.004d52a4
pop ecx
call fcn.00404944
jmp 0x4d5737
xor eax, eax
push ebp
push 0x4d5716
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 0x4d555f
cmp dword [ebp + 8], 0
je 0x4d5550
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d57a4
call fcn.004d52a4
pop ecx
call fcn.00404944
call fcn.00404944
jmp 0x4d5737
xor eax, eax
push ebp
push 0x4d56fc
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 0x4d55ca
cmp dword [ebp + 8], 0
je 0x4d55b6
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d57b4
call fcn.004d52a4
pop ecx
call fcn.00404944
call fcn.00404944
call fcn.00404944
jmp 0x4d5737
mov word [ebp - 0x1b0], 2
push ebx
call sub.wsock32.dll_htons
mov word [ebp - 0x1ae], ax
mov al, byte [ebp + 0xc]
dec eax
sub al, 4
jae 0x4d561d
push ebp
lea edx, [ebp - 0x1b4]
mov eax, dword [ebp - 4]
call fcn.004d5344
pop ecx
mov eax, dword [ebp - 0x1b4]
call fcn.00405404
push eax
call sub.wsock32.dll_inet_addr
mov dword [ebp - 0x1b8], eax
mov eax, dword [ebp - 0x1b8]
mov dword [ebp - 0x1ac], eax
jmp 0x4d563d
mov eax, dword [ebp - 4]
call fcn.00405404
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
mov dword [0x563cf4], 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 0x4d56a5
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x274d
je 0x4d5685
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x4d5685
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x274c
je 0x4d5685
xor eax, eax
jmp 0x4d5687
mov al, 1
mov byte [ebp - 5], al
cmp dword [ebp + 8], 0
je 0x4d56e5
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d57c4
call fcn.004d52a4
pop ecx
jmp 0x4d56e5
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 0x4d56e5
cmp dword [ebp + 8], 0
je 0x4d56e5
push ebp
call sub.wsock32.dll_WSAGetLastError
mov edx, eax
mov eax, 0x4d57d4
call fcn.004d52a4
pop ecx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4d5703
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 0x4d575f
lea eax, [ebp - 0x1b4]
call fcn.00404f44
lea eax, [ebp - 4]
call fcn.00404f44
ret