Function at 0x4954f0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Set socket configuration

Disassembly:
sub esp, 0x24c
mov eax, dword [0x596fb8]
xor eax, esp
mov dword [esp + 0x248], eax
push esi
mov esi, ecx
cmp dword [esi + 0x204], 0xffffffff
jne 0x4957f4
mov eax, dword [esi + 0x178]
sub eax, 1
push edi
je 0x495625
sub eax, 1
je 0x49560e
sub eax, 1
je 0x495544
push str.503_Invalid_sequence_of_commands._r_n
call fcn.00492d50
add esp, 4
jmp 0x495609
movsx eax, word [esi + 0x180]
lea edi, [esi + 0x180]
push 6
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x204], eax
je 0x4957e3
push 4
lea ecx, [esp + 0xc]
push ecx
push 1
push 0xffff
push eax
mov dword [esp + 0x1c], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edx, dword [0x59812c]
mov eax, dword [edx + 0x10]
mov ecx, dword [esi + 0x204]
push 0x33
push 0x403
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAAsyncSelect]
mov dx, word [edi]
mov eax, dword [esi + 0x204]
sub dx, 2
neg dx
sbb edx, edx
and edx, 0xc
add edx, 0x10
push edx
push edi
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x4955e8
call fcn.00494f40
pop edi
pop esi
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.00549750
add esp, 0x24c
ret
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x49560e
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov ecx, esi
call fcn.00492d50
add esp, 8
call fcn.00493470
pop edi
pop esi
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.00549750
add esp, 0x24c
ret
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x204], eax
je 0x4957e3
lea ecx, [esp + 0x140]
push ecx
call fcn.00401210
lea edx, [esp + 0x30]
push edx
call fcn.00401210
mov ecx, dword [esi + 0x204]
push 4
lea eax, [esp + 0x10]
push eax
push 1
push 0xffff
push ecx
mov dword [esp + 0x20], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edx, dword [0x59812c]
mov eax, dword [edx + 0x10]
mov ecx, dword [esi + 0x204]
push 0x33
push 0x403
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAAsyncSelect]
movzx edx, byte [esi + 0x183]
movzx ecx, byte [esi + 0x181]
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
push edx
movzx edx, byte [esi + 0x180]
mov dword [esp + 0x14], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
movzx eax, byte [esi + 0x182]
push eax
push ecx
push edx
lea eax, [esp + 0x150]
push str._d._d._d._d
push eax
mov dword [esp + 0x2c], 2
mov dword [esp + 0x34], 6
mov dword [esp + 0x30], 1
call fcn.00524170
mov ecx, dword [esi + 0x184]
push ecx
lea edx, [esp + 0x4c]
push 0x550660
push edx
call fcn.00524170
mov edx, dword [esp + 0x5c]
add esp, 0x24
lea eax, [esp + 8]
push eax
mov eax, dword [esp + 0x14c]
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
call dword [0x58df6c]
test eax, eax
jne 0x4957a1
mov eax, dword [esp + 8]
mov ecx, dword [eax + 0x10]
mov edx, dword [eax + 0x18]
mov eax, dword [esi + 0x204]
push ecx
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x49576e
call fcn.00494f40
mov ecx, dword [esp + 8]
push ecx
call dword [0x58df70]
jmp 0x4957b5
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x495794
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov ecx, esi
call fcn.00492d50
add esp, 8
call fcn.00493470
mov ecx, dword [esp + 8]
push ecx
call dword [0x58df70]
jmp 0x4957b5
push str.500_Failed_to_get_port_address._r_n
mov ecx, esi
call fcn.00492d50
add esp, 4
call fcn.00493470
lea edx, [esp + 0x30]
push edx
call fcn.00401230
lea eax, [esp + 0x140]
push eax
call fcn.00401230
pop edi
pop esi
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.00549750
add esp, 0x24c
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.500_Failed_to_create_port_socket__d._r_n
jmp 0x4955ff
call fcn.00494f40
mov ecx, dword [esp + 0x24c]
pop esi
xor ecx, esp
call fcn.00549750
add esp, 0x24c
ret