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

Disassembly:
sub esp, 0x24c
mov eax, dword [0x597f98]
xor eax, esp
mov dword [esp + 0x248], eax
push esi
mov esi, ecx
cmp dword [esi + 0x204], 0xffffffff
jne 0x4957b4
mov eax, dword [esi + 0x178]
sub eax, 1
push edi
je 0x4955e5
sub eax, 1
je 0x4955ce
sub eax, 1
je 0x495504
push str.503_Invalid_sequence_of_commands._r_n
call fcn.00492d20
add esp, 4
jmp 0x4955c9
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 0x4957a3
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 [0x59910c]
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 0x4955a8
call fcn.00494f00
pop edi
pop esi
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.005498cd
add esp, 0x24c
ret
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x4955ce
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov ecx, esi
call fcn.00492d20
add esp, 8
call fcn.00493440
pop edi
pop esi
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.005498cd
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 0x4957a3
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 [0x59910c]
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.00524440
mov ecx, dword [esi + 0x184]
push ecx
lea edx, [esp + 0x4c]
push 0x551658
push edx
call fcn.00524440
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 [0x58ef4c]
test eax, eax
jne 0x495761
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 0x49572e
call fcn.00494f00
mov ecx, dword [esp + 8]
push ecx
call dword [0x58ef50]
jmp 0x495775
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x495754
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov ecx, esi
call fcn.00492d20
add esp, 8
call fcn.00493440
mov ecx, dword [esp + 8]
push ecx
call dword [0x58ef50]
jmp 0x495775
push str.500_Failed_to_get_port_address._r_n
mov ecx, esi
call fcn.00492d20
add esp, 4
call fcn.00493440
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.005498cd
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 0x4955bf
call fcn.00494f00
mov ecx, dword [esp + 0x24c]
pop esi
xor ecx, esp
call fcn.005498cd
add esp, 0x24c
ret