Function at 0x410220
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x480160]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
mov eax, 0x4710f8
call fcn.0040f410
mov esi, eax
xor ebx, ebx
cmp esi, ebx
je 0x410332
cmp dword [0x491608], ebx
jne 0x410256
call fcn.004101b0
mov edi, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov eax, 2
push edi
mov word [ebp - 0x18], ax
call dword [sym.imp.WS2_32.dll_htons]
push 0x7f000001
mov word [ebp - 0x16], ax
call dword [sym.imp.WS2_32.dll_htonl]
push ebx
push 1
push 2
mov dword [ebp - 0x14], eax
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
jne 0x410346
test byte [0x4815b8], 0x80
je 0x41031a
mov edi, dword [sym.imp.MSVCR100.dll__errno]
call edi
mov ebx, dword [eax]
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x10
call edi
push str.socket_loopback_client:_could_not_create_socket_n
mov dword [eax], ebx
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 0xc
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call edi
mov dword [eax], ebx
xor ebx, ebx
cmp dword [esi + 4], ebx
je 0x410332
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
push esi
call edx
add esp, 4
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
mov dword [esi], ebx
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00459ce1
mov esp, ebp
pop ebp
ret
push 0x10
lea ecx, [ebp - 0x18]
push ecx
push eax
mov dword [esi + 0xc], eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x410414
test byte [0x4815b8], 0x80
je 0x4103e4
mov edi, dword [sym.imp.MSVCR100.dll__errno]
call edi
mov ebx, dword [eax]
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x10
call edi
mov edx, dword [ebp + 8]
push edx
push 0x4712dc
push str.socket_loopback_client:_could_not_connect_to__s:_d_n
mov dword [eax], ebx
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 0x14
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call edi
mov dword [eax], ebx
xor ebx, ebx
cmp dword [esi + 4], ebx
je 0x410332
mov eax, dword [esi]
mov ecx, dword [eax + 4]
push esi
call ecx
add esp, 4
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
mov dword [esi], ebx
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00459ce1
mov esp, ebp
pop ebp
ret
push edi
push 0x46f8ad
mov eax, esi
call fcn.0040f3d0
push eax
push str._d_lo_client:_s_d_
lea edx, [esi + 0x18]
push 0x20
push edx
call dword [sym.imp.MSVCR100.dll__snprintf]
add esp, 0x18
test byte [0x4815b8], 0x80
je 0x4104c9
mov edi, dword [sym.imp.MSVCR100.dll__errno]
call edi
mov ebx, dword [eax]
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x10
call edi
mov dword [eax], ebx
mov eax, esi
call fcn.0040f3d0
push eax
mov eax, dword [ebp + 8]
push 0x4712dc
push eax
push str.socket_loopback_client:_port__d_type__s___fd__d_n
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x14
call dword [sym.imp.MSVCR100.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 4
push 0x4815a0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call edi
mov dword [eax], ebx
mov eax, esi
call fcn.0040f3d0
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00459ce1
mov esp, ebp
pop ebp
ret