Function at 0x40f680
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov eax, dword [0x490250]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov eax, 0x481fe8
mov ebx, ecx
call fcn.0040e860
mov esi, eax
xor edi, edi
cmp esi, edi
je 0x40f78c
cmp dword [0x4a2d30], edi
jne 0x40f6b8
call fcn.0040f610
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
mov eax, 2
push ebx
mov word [ebp - 0x14], ax
call dword [sym.imp.WS2_32.dll_htons]
push 0x7f000001
mov word [ebp - 0x12], ax
call dword [sym.imp.WS2_32.dll_htonl]
push edi
push 1
push 2
mov dword [ebp - 0x10], eax
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
jne 0x40f7a0
test byte [0x492ce0], 0x80
je 0x40f774
call fcn.00455413
mov ebx, dword [eax]
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
add esp, 0x10
call fcn.00455413
push str.socket_loopback_client:_could_not_create_socket_n
mov dword [eax], ebx
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
call fcn.00454e90
add eax, 0x40
push eax
call fcn.004552a8
add esp, 0xc
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.00455413
mov dword [eax], ebx
cmp dword [esi + 4], edi
je 0x40f78c
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
push esi
call edx
add esp, 4
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov dword [esi], edi
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00454b91
mov esp, ebp
pop ebp
ret
push 0x10
lea ecx, [ebp - 0x14]
push ecx
push eax
mov dword [esi + 0xc], eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x40f868
test byte [0x492ce0], 0x80
je 0x40f838
call fcn.00455413
mov edi, dword [eax]
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
add esp, 0x10
call fcn.00455413
push ebx
push 0x482f58
push str.socket_loopback_client:_could_not_connect_to__s:_d_n
mov dword [eax], edi
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
call fcn.00454e90
add eax, 0x40
push eax
call fcn.004552a8
add esp, 0x14
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.00455413
mov dword [eax], edi
xor edi, edi
cmp dword [esi + 4], edi
je 0x40f78c
mov edx, dword [esi]
mov eax, dword [edx + 4]
push esi
call eax
add esp, 4
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov dword [esi], edi
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00454b91
mov esp, ebp
pop ebp
ret
push ebx
push 0x4814d1
mov eax, esi
call fcn.0040e820
push eax
push str._d_lo_client:_s_d_
lea ecx, [esi + 0x18]
push 0x20
push ecx
call fcn.00455325
add esp, 0x18
test byte [0x492ce0], 0x80
je 0x40f916
call fcn.00455413
mov edi, dword [eax]
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.socket_loopback_client
push str.sysdeps_win32.cpp
push str._s::_s__:
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
add esp, 0x10
call fcn.00455413
mov dword [eax], edi
mov eax, esi
call fcn.0040e820
push eax
push 0x482f58
push ebx
push str.socket_loopback_client:_port__d_type__s___fd__d_n
call fcn.00454e90
add eax, 0x40
push eax
call fcn.00455c4a
add esp, 0x14
call fcn.00454e90
add eax, 0x40
push eax
call fcn.004552a8
add esp, 4
push 0x492cc8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.00455413
mov dword [eax], edi
mov eax, esi
call fcn.0040e820
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00454b91
mov esp, ebp
pop ebp
ret