Function at 0x408500
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x18
mov eax, dword [0x4306a0]
push ebx
push ebp
push esi
push edi
push 1
xor edi, edi
push edi
push edi
push 6
push 1
mov ebx, 2
push ebx
mov dword [esp + 0x3c], eax
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40870d
push 0x10000
push esi
call fcn.00404f70
push 0x10000
push esi
call fcn.00405020
push esi
call fcn.004050d0
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
add esp, 0x14
mov dword [esp + 0x1c], eax
push 0x43078c
mov dword [esp + 0x24], eax
mov word [esp + 0x18], bx
call dword [sym.imp.WS2_32.dll_inet_addr]
xor ecx, ecx
mov cx, word [0x43076c]
mov dword [esp + 0x18], eax
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov ebp, dword [sym.imp.WS2_32.dll_connect]
push 0x10
lea edx, [esp + 0x18]
push edx
push esi
mov word [esp + 0x22], ax
call ebp
cmp eax, 0xffffffff
jne 0x40861e
movzx eax, word [0x43076c]
push eax
push 0x43078c
push str.handle_connectionfirst_connect_fail_s:_d.
call fcn.0040b4c0
add esp, 0xc
mov dword [esp + 0x10], edi
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x10
lea ecx, [esp + 0x18]
push ecx
push esi
call ebp
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4085fe
mov edx, dword [esp + 0x10]
push edx
push str.handle_connectionconnect__d__fail.
call fcn.0040b4c0
mov eax, dword [esp + 0x18]
add esp, 8
inc eax
cmp eax, 2
mov dword [esp + 0x10], eax
jl 0x4085c2
cmp dword [esp + 0x10], 2
jne 0x408614
push 2
push str.handle_connectionreconnect_failattempt_count__d___i.
call fcn.0040b4c0
add esp, 8
cmp ebx, 0xffffffff
je 0x40863b
mov ebx, 2
mov ecx, 0x434964
call fcn.004075b0
mov edi, eax
test edi, edi
jne 0x408690
push str.handle_connectiong_queue_handle.pop___fail
call fcn.0040b4c0
add esp, 4
mov ebx, dword [esp + 0x10]
push 2
push esi
call dword [sym.imp.WS2_32.dll_shutdown]
cmp eax, 0xffffffff
jne 0x40865b
push esi
push str.close_socketshutdown_failcurrent_socket:_p
call fcn.0040b4c0
add esp, 8
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
cmp eax, 0xffffffff
jne 0x408675
push esi
push str.close_socketclosesocket_failscurrent_socket:_p
call fcn.0040b4c0
add esp, 8
or esi, 0xffffffff
test edi, edi
je 0x408711
push edi
mov ecx, 0x434964
call fcn.004077a0
jmp 0x408711
mov eax, dword [esp + 0x30]
mov dword [edi + 0x70], eax
mov eax, dword [esp + 0x2c]
mov dword [edi + 0x74], ebx
mov dword [edi + 0x6c], ebx
push 0
mov dword [edi], esi
mov dword [edi + 0x78], eax
mov dword [eax + 0x78], edi
mov eax, dword [0x430760]
push edi
push eax
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
cmp eax, ebx
je 0x4086c9
push str.handle_connectionerror_occur__associate_completion_port_fail.
jmp 0x408633
mov ecx, 0x434928
call fcn.004070c0
mov ebx, eax
test ebx, ebx
jne 0x4086eb
push str.handle_connectiong_queue_io.pop___fail
call fcn.0040b4c0
add esp, 4
jmp 0x40863f
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
push ecx
push edx
push eax
push ebx
push edi
call fcn.00408440
add esp, 0x14
test eax, eax
jne 0x408720
jmp 0x40863f
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x408720
push ebx
mov ecx, 0x434928
call fcn.004077a0
mov ecx, dword [esp + 0x24]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
call fcn.00421871
add esp, 0x18
ret