Function at 0x418850
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51b667
mov eax, dword fs:[0]
push eax
sub esp, 0x28c
mov eax, dword [0x580b30]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
movzx edi, cx
mov eax, 0xd907
mov dword [ebp - 0x1d4], 0xd907
cmp di, ax
jbe 0x41894f
lea ecx, [ebp - 0x298]
push ecx
call fcn.00402bd0
push 0xd907
push ecx
push str.__maxTcpPort_
push ecx
push edi
push ecx
push str.minTcpPort_
push ecx
lea edx, [ebp - 0x288]
push str.The_input_minimal_and_maximal_ports_are_reversed_with
push edx
mov dword [ebp - 4], 0
call fcn.004050c0
add esp, 0xc
push eax
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.00411bc0
add esp, 4
push eax
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.00411bc0
lea ecx, [ebp - 0x2c]
lea eax, [ebp - 0x298]
call fcn.00402c70
push eax
push 2
mov byte [ebp - 4], 1
call fcn.00409e90
mov ecx, eax
call fcn.004688b0
mov esi, 8
cmp dword [ebp - 0x18], esi
jb 0x41892e
mov eax, dword [ebp - 0x2c]
push eax
call fcn.00469e1a
add esp, 4
lea ecx, [ebp - 0x298]
mov dword [ebp - 4], 0xffffffff
call fcn.00401820
mov ecx, edi
mov edi, 0xd907
mov dword [ebp - 0x1d4], ecx
jmp 0x418954
mov esi, 8
lea edx, [ebp - 0x1d0]
push edx
push 2
mov dword [ebp - 0x1d8], 0
call dword [sym.imp.WS2_32.dll_WSAStartup]
mov ebx, eax
test ebx, ebx
je 0x4189ee
lea eax, [ebp - 0x298]
push eax
call fcn.00402bd0
push ebx
push ecx
lea ecx, [ebp - 0x288]
push str.WinSock_init_failure_with_error:
push ecx
mov dword [ebp - 4], 2
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.004197e0
lea ecx, [ebp - 0x2c]
lea eax, [ebp - 0x298]
call fcn.00402c70
push eax
push 1
mov byte [ebp - 4], 3
call fcn.00409e90
mov ecx, eax
call fcn.004688b0
cmp dword [ebp - 0x18], esi
jb 0x4189d5
mov edx, dword [ebp - 0x2c]
push edx
call fcn.00469e1a
add esp, 4
lea ecx, [ebp - 0x298]
mov dword [ebp - 4], 0xffffffff
call fcn.00401820
xor eax, eax
jmp 0x418c8c
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x418a8e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
lea eax, [ebp - 0x298]
push eax
call fcn.00402bd0
push edi
push ecx
lea ecx, [ebp - 0x288]
push str.socket___failed_with_error:
push ecx
mov dword [ebp - 4], 4
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.004197e0
lea ecx, [ebp - 0x2c]
lea eax, [ebp - 0x298]
call fcn.00402c70
push eax
push 1
mov byte [ebp - 4], 5
call fcn.00409e90
mov ecx, eax
call fcn.004688b0
cmp dword [ebp - 0x18], esi
jb 0x418a6f
mov edx, dword [ebp - 0x2c]
push edx
call fcn.00469e1a
add esp, 4
lea ecx, [ebp - 0x298]
mov dword [ebp - 4], 0xffffffff
call fcn.00401820
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor eax, eax
jmp 0x418c8c
lea eax, [ebp - 0x1f0]
push eax
call fcn.004116d0
add esp, 4
mov ecx, 2
mov dword [ebp - 4], 6
push str.127.0.0.1
mov word [ebp - 0x3c], cx
call dword [sym.imp.WS2_32.dll_inet_addr]
movzx esi, di
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x1dc], esi
cmp di, word [ebp - 0x1d4]
ja 0x418c4e
mov edi, dword [sym.imp.WS2_32.dll_htons]
jmp 0x418ae0
lea edx, [ebp - 0x1dc]
push edx
lea eax, [ebp - 0x1e0]
lea ecx, [ebp - 0x1f0]
call fcn.00412420
mov eax, dword [eax]
cmp eax, dword [ebp - 0x1ec]
jne 0x418bab
push esi
call edi
push 0x10
lea ecx, [ebp - 0x3c]
push ecx
push ebx
mov word [ebp - 0x3a], ax
call dword [sym.imp.WS2_32.dll_connect]
lea edx, [ebp - 0x298]
push edx
cmp eax, 0xffffffff
je 0x418bc4
call fcn.00402bd0
push str._is_already_open_thus_unavailable.
push ecx
push esi
push ecx
lea eax, [ebp - 0x288]
push str.TCP_port
push eax
mov byte [ebp - 4], 9
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.00411bc0
add esp, 4
push eax
call fcn.004050c0
add esp, 8
lea ecx, [ebp - 0x2c]
lea eax, [ebp - 0x298]
call fcn.00402c70
push eax
push 4
mov byte [ebp - 4], 0xa
call fcn.00409e90
mov ecx, eax
call fcn.004688b0
cmp dword [ebp - 0x18], 8
jb 0x418b95
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.00469e1a
add esp, 4
lea ecx, [ebp - 0x298]
mov byte [ebp - 4], 6
call fcn.00401820
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
inc esi
mov dword [ebp - 0x1dc], esi
cmp si, word [ebp - 0x1d4]
jbe 0x418ae0
jmp 0x418c4e
call fcn.00402bd0
push str._is_available
push ecx
push esi
push ecx
lea eax, [ebp - 0x288]
push str.Port
push eax
mov byte [ebp - 4], 7
call fcn.004050c0
add esp, 0xc
mov ecx, eax
call fcn.00411bc0
add esp, 4
push eax
call fcn.004050c0
add esp, 8
lea ecx, [ebp - 0x2c]
lea eax, [ebp - 0x298]
call fcn.00402c70
push eax
push 4
mov byte [ebp - 4], 8
call fcn.00409e90
mov ecx, eax
call fcn.004688b0
cmp dword [ebp - 0x18], 8
jb 0x418c2f
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.00469e1a
add esp, 4
lea ecx, [ebp - 0x298]
mov byte [ebp - 4], 6
call fcn.00401820
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
movzx edx, si
mov dword [ebp - 0x1d8], edx
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov dword [ebp - 4], 0xb
mov eax, dword [ebp - 0x1ec]
mov ecx, dword [eax]
push eax
push ecx
lea esi, [ebp - 0x1e0]
lea eax, [ebp - 0x1f0]
call fcn.00412850
mov eax, dword [ebp - 0x1ec]
push eax
call fcn.00469e1a
mov ax, word [ebp - 0x1d8]
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004d31b7
mov esp, ebp
pop ebp
ret