Function at 0x401230
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Convert ip address from string
Create tcp socket
Execute command
Get socket status
Initialize winsock library
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40305d
mov eax, dword fs:[0]
push eax
sub esp, 0x2e0
mov eax, dword [0x406040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push str.title_TCP_Scanner_by_brighver
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
add esp, 4
mov edx, str.Welcome_to_my_small_project_scanner_
push 0x401b50
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.This_tool_will_attempt_to_ping_to_a_specified_IP_address_and_port.
push 0x401b50
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.You_can_press_CtrlC_or_close_the_program_to_stop_the_connection_attempts._n
push 0x401b50
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push 0x5dc
call dword [sym.imp.KERNEL32.dll_Sleep]
xorps xmm0, xmm0
mov dword [ebp - 0x18], 0
movups xmmword [ebp - 0x28], xmm0
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
mov dword [ebp - 4], 0
mov edx, str.IP:
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.00401930
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
lea edx, [ebp - 0x28]
call fcn.00401b80
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Port:
call fcn.00401930
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
lea eax, [ebp - 0x2e4]
push eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::operator___int__]
lea eax, [ebp - 0x2e0]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x401374
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.WSAStartup_failed:
push 0x401b50
push eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov esi, 1
jmp 0x401654
push 0x401220
push 2
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_signal]
add esp, 8
cmp dword [0x4060a0], 0
je 0x40162f
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x4016b1
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 1
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp - 0x2e4]
xorps xmm0, xmm0
mov eax, 2
movups xmmword [ebp - 0x4c], xmm0
mov word [ebp - 0x4c], ax
call dword [sym.imp.WS2_32.dll_htons]
cmp dword [ebp - 0x14], 0xf
lea ecx, [ebp - 0x48]
mov word [ebp - 0x4a], ax
lea eax, [ebp - 0x28]
cmova eax, dword [ebp - 0x28]
push ecx
push eax
push 2
call dword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x401684
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll_clock]
mov edi, eax
lea eax, [ebp - 0x4c]
push 0x10
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x40155a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x401530
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x3c], 3
push eax
push 0
lea eax, [ebp - 0x150]
mov dword [ebp - 0x38], 0
push eax
push 0
push 0
mov dword [ebp - 0x14c], esi
mov dword [ebp - 0x150], 1
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x401545
lea eax, [ebp - 0x30]
mov dword [ebp - 0x30], 4
push eax
lea eax, [ebp - 0x34]
push eax
push 0x1007
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_getsockopt]
cmp dword [ebp - 0x34], 0
jne 0x401530
mov eax, dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll_clock]
call eax
sub eax, edi
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.e_0_37mConnected_to_e_0_32m
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [0x4044a8]
mulsd xmm0, qword [0x4044a8]
movsd qword [ebp - 0x2ec], xmm0
call fcn.00401930
cmp dword [ebp - 0x14], 0xf
lea edx, [ebp - 0x28]
push dword [ebp - 0x18]
cmova edx, dword [ebp - 0x28]
mov ecx, eax
call fcn.00401f30
movsd xmm0, qword [ebp - 0x2ec]
add esp, 4
mov edx, str.e_0_37m:_time
mov ecx, eax
push 0x401b50
push dword [ebp - 0x2e4]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00401930
mov edx, str.e_0_32m
mov ecx, eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___double_]
mov edx, str.ms_e_0_37mprotocole_0_32mTCP_e_0_37mporte_0_32m
jmp 0x4015eb
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.e_0_31mConnection_failede_0m
push 0x401b50
jmp 0x401601
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.e_0_31mConnection_timed_oute_0m
push 0x401b50
jmp 0x401601
mov eax, dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll_clock]
call eax
sub eax, edi
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.e_0_37mConnected_to_e_0_32m
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [0x4044a8]
mulsd xmm0, qword [0x4044a8]
movsd qword [ebp - 0x2ec], xmm0
call fcn.00401930
cmp dword [ebp - 0x14], 0xf
lea edx, [ebp - 0x28]
push dword [ebp - 0x18]
cmova edx, dword [ebp - 0x28]
mov ecx, eax
call fcn.00401f30
movsd xmm0, qword [ebp - 0x2ec]
add esp, 4
mov edx, str.e_0_37m:_time
mov ecx, eax
push 0x401b50
push dword [ebp - 0x2e4]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00401930
mov edx, str.e_0_32m
mov ecx, eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___double_]
mov edx, str._ms_e_0_37mprotocole_0_32mTCP_e_0_37mporte_0_32m
mov ecx, eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov edx, str.e_0m
mov ecx, eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push esi
call edi
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [0x4060a0], 0
jne 0x401397
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Exiting...
push 0x401b50
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor esi, esi
mov ecx, dword [ebp - 0x14]
cmp ecx, 0xf
jbe 0x4016f7
mov edx, dword [ebp - 0x28]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4016ed
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4016ed
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Invalid_address__Address_not_supported
push 0x401b50
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push esi
call edi
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov esi, 1
jmp 0x401654
push 0x401b50
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Socket_creation_failed:
push eax
call fcn.00401930
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov esi, 1
jmp 0x401654
push ecx
push edx
call fcn.004021da
add esp, 8
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040219c
mov esp, ebp
pop ebp
ret