Function at 0x401ae0
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x45c
mov eax, dword [0x4153f8]
xor eax, esp
mov dword [esp + 0x458], eax
xor eax, eax
push ebp
mov ebp, dword [esp + 0x464]
push esi
push edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c]
push ecx
push ebp
push ebx
mov dword [esp + 0x30], 1
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x401b9b
cmp dword [0x418e28], 0
je 0x401dc2
push 0
push 0x400
push 0x41a340
push 0x400
push eax
push 0
push 0x12ff
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x41a340
push ebp
push ebx
push 0x41783c
push 0xd0
push 0x417848
push 0x417858
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x20
jmp 0x401dc2
mov edi, dword [esp + 0x10]
test edi, edi
je 0x401d79
mov ecx, dword [edi + 0x10]
push 0xa
push 0x20
lea edx, [esp + 0x40]
push edx
mov edx, dword [edi + 0x18]
push 0x401
lea eax, [esp + 0x68]
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_getnameinfo]
test eax, eax
je 0x401c29
cmp dword [0x418e28], 0
je 0x401d6e
push 0
push 0x400
push 0x41a340
push 0x400
push eax
push 0
push 0x12ff
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x41a340
push ebp
push ebx
push 0x417880
push 0xdb
push 0x41788c
push str.usbip_err:__13s:_4d____12s___s__s:__s_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x20
jmp 0x401d6e
cmp dword [0x418e2c], 0
je 0x401c6a
cmp dword [0x418e28], 0
je 0x401c6a
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x5c]
push ecx
push 0x4178c4
push 0xdf
push 0x4178d0
push str.usbip_dbg:__13s:_4d____12s__trying__s_port__s_n_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x1c
mov edx, dword [edi + 0xc]
mov eax, dword [edi + 8]
mov ecx, dword [edi + 4]
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
test esi, esi
jns 0x401cb9
cmp dword [0x418e28], 0
je 0x401d6e
push 0x417910
push 0xe3
push 0x41791c
push str.usbip_err:__13s:_4d____12s__socket_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x14
jmp 0x401d6e
push 4
lea edx, [esp + 0x18]
push edx
push 1
push 6
push esi
mov dword [esp + 0x28], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x401d05
cmp dword [0x418e28], 0
je 0x401d05
push str.usbip_set_nodelay
push 0xae
push 0x41779c
push str.usbip_err:__13s:_4d____12s__setsockopt_TCP_NODELAY_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x14
push 4
lea eax, [esp + 0x18]
push eax
push 8
push 0xffff
push esi
mov dword [esp + 0x28], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x401d54
cmp dword [0x418e28], 0
je 0x401d54
push str.usbip_set_keepalive
push 0xba
push 0x4177f4
push str.usbip_err:__13s:_4d____12s__setsockopt_SO_KEEPALIVE_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x14
mov ecx, dword [edi + 0x10]
mov edx, dword [edi + 0x18]
push ecx
push edx
push esi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x401ddd
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov edi, dword [edi + 0x1c]
test edi, edi
jne 0x401ba7
cmp dword [0x418e2c], 0
je 0x401db7
cmp dword [0x418e28], 0
je 0x401db7
push str.no_destination_to_connect_to
push ebp
push ebx
push str.tcp_connect
push 0xf9
push str.usbip_network.c
push str.usbip_dbg:__13s:_4d____12s___s:_s___s_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x20
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
or eax, 0xffffffff
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x458]
xor ecx, esp
call fcn.0040601f
add esp, 0x45c
ret
cmp dword [0x418e2c], 0
je 0x401e1e
cmp dword [0x418e28], 0
je 0x401e1e
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x5c]
push ecx
push 0x417950
push 0xf3
push 0x41795c
push str.usbip_dbg:__13s:_4d____12s__connected_to__s:_s_n
call fcn.0040602e
add eax, 0x40
push eax
call fcn.004062a0
add esp, 0x1c
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov ecx, dword [esp + 0x464]
pop edi
mov eax, esi
pop esi
pop ebp
xor ecx, esp
call fcn.0040601f
add esp, 0x45c
ret