Function at 0x493940
Capabilities:
Connect socket
Set socket configuration

Disassembly:
sub esp, 0x248
push esi
mov esi, eax
cmp dword [esi + 0x110], 0xffffffff
jne 0x493d03
mov eax, dword [esi + 0xf8]
push edi
mov edi, 1
sub eax, edi
je 0x493b37
sub eax, edi
je 0x493986
sub eax, edi
je 0x49398f
push str.503_Invalid_sequence_of_commands._r_n
mov eax, esi
call fcn.00491580
add esp, 4
call fcn.00491b30
pop edi
pop esi
add esp, 0x248
ret
mov eax, dword [esi + 0x100]
push 6
push edi
push eax
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x110], eax
je 0x493cdf
lea ecx, [esp + 0x30]
push ecx
call fcn.0051ec40
mov eax, dword [esi + 0x110]
push 4
lea edx, [esp + 0x10]
push edx
push edi
push 0xffff
push eax
mov dword [esp + 0x20], edi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ecx, dword [0x58b338]
mov edx, dword [ecx + 0x10]
mov eax, dword [esi + 0x110]
push 0x33
push 0x403
push edx
push eax
call dword [sym.imp.WS2_32.dll_WSAAsyncSelect]
mov edx, dword [esi + 0x108]
mov ecx, dword [esi + 0x100]
xor eax, eax
push edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
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
lea eax, [esp + 0x34]
push 0x5465b8
push eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x28], 6
mov dword [esp + 0x24], edi
call fcn.0051fa10
mov eax, dword [esp + 0x44]
add esp, 0xc
lea ecx, [esp + 8]
push ecx
mov ecx, dword [esi + 0x104]
lea edx, [esp + 0x14]
push edx
push eax
push ecx
call dword [0x581e64]
test eax, eax
jne 0x493b10
mov edx, dword [esp + 0x38]
mov eax, dword [esi + 0x104]
mov ecx, dword [esi + 0x100]
push edx
push eax
push ecx
push str.connect_to_port__d_s_s_n
call fcn.0048dc10
mov eax, dword [esp + 0x18]
mov edx, dword [eax + 0x10]
mov eax, dword [eax + 0x18]
mov ecx, dword [esi + 0x110]
add esp, 0x10
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x493acc
mov eax, esi
call fcn.00493420
mov edx, dword [esp + 8]
push edx
call dword [0x581e68]
lea eax, [esp + 0x30]
push eax
call fcn.00522920
pop edi
pop esi
add esp, 0x248
ret
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x493af2
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov eax, esi
call fcn.00491580
add esp, 8
call fcn.00491b30
mov edx, dword [esp + 8]
push edx
call dword [0x581e68]
lea eax, [esp + 0x30]
push eax
call fcn.00522920
pop edi
pop esi
add esp, 0x248
ret
push str.500_Failed_to_get_port_address._r_n
mov eax, esi
call fcn.00491580
add esp, 4
call fcn.00491b30
lea eax, [esp + 0x30]
push eax
call fcn.00522920
pop edi
pop esi
add esp, 0x248
ret
push 6
push edi
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x110], eax
je 0x493cdf
lea ecx, [esp + 0x140]
push ecx
call fcn.0051ec40
lea edx, [esp + 0x30]
push edx
call fcn.0051ec40
mov ecx, dword [esi + 0x110]
push 4
lea eax, [esp + 0x10]
push eax
push edi
push 0xffff
push ecx
mov dword [esp + 0x20], edi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edx, dword [0x58b338]
mov eax, dword [edx + 0x10]
mov ecx, dword [esi + 0x110]
push 0x33
push 0x403
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAAsyncSelect]
movzx edx, byte [esi + 0x103]
movzx ecx, byte [esi + 0x101]
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
push edx
movzx edx, byte [esi + 0x100]
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 + 0x102]
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], edi
call fcn.0051fa10
mov ecx, dword [esi + 0x104]
push ecx
lea edx, [esp + 0x4c]
push 0x5465b8
push edx
call fcn.0051fa10
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 [0x581e64]
test eax, eax
jne 0x493cab
mov eax, dword [esp + 8]
mov ecx, dword [eax + 0x10]
mov edx, dword [eax + 0x18]
mov eax, dword [esi + 0x110]
push ecx
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x493c78
mov eax, esi
call fcn.00493420
mov ecx, dword [esp + 8]
push ecx
call dword [0x581e68]
jmp 0x493cbf
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x493c9e
call edi
push eax
push str.500_Failed_to_connect_to_port__d._r_n
mov eax, esi
call fcn.00491580
add esp, 8
call fcn.00491b30
mov ecx, dword [esp + 8]
push ecx
call dword [0x581e68]
jmp 0x493cbf
push str.500_Failed_to_get_port_address._r_n
mov eax, esi
call fcn.00491580
add esp, 4
call fcn.00491b30
lea edx, [esp + 0x30]
push edx
call fcn.00522920
lea eax, [esp + 0x140]
push eax
call fcn.00522920
pop edi
pop esi
add esp, 0x248
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.500_Failed_to_create_port_socket__d._r_n
mov eax, esi
call fcn.00491580
add esp, 8
call fcn.00491b30
pop edi
pop esi
add esp, 0x248
ret
pop esi
add esp, 0x248
jmp fcn.00493420