Function at 0x401240
Capabilities:
Create tcp socket
Create thread
Create udp socket
Execute command
Initialize winsock library
Start tcp server

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x402ab8
mov eax, dword fs:[0]
push eax
sub esp, 0x214
mov eax, dword [0x405008]
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
lea eax, [ebp - 0x200]
push eax
push 0
call dword [sym.imp.FTD2XX.dll_Ordinal_1]
test eax, eax
je 0x4012d3
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_opening_FTDI_device
push 0x4019a0
call fcn.00401760
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]
push str.pause
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
add esp, 4
mov eax, 1
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.00401c6a
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x208]
push eax
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_80]
test eax, eax
je 0x401311
push str.Failed_to_get_COM_port_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 8
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x4012a4
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Selected_port:_COM
push 0x4019a0
push dword [ebp - 0x208]
call fcn.00401760
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___long_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_____]
lea eax, [ebp - 0x201]
push eax
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_30]
test eax, eax
je 0x40137d
push str.Failed_to_get_latency_timer_value_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 8
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x4012a4
mov bl, byte [ebp - 0x201]
cmp bl, 1
je 0x401407
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Latency_timer_is_wrong:
call fcn.00401760
push 0x4019a0
mov dl, bl
mov ecx, eax
call fcn.004019d0
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.Setting_Latency_timer_to_1
push 0x4019a0
call fcn.00401760
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 1
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_29]
test eax, eax
je 0x401407
push str.Failed_to_set_latency_timer_value_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 8
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x4012a4
lea eax, [ebp - 0x1fc]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x40143f
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_initializing_Winsock
push 0x4019a0
call fcn.00401760
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_____]
jmp 0x4012a4
push 0
push 1
push 2
mov dword [ebp - 0x58], 0x10
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401487
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_creating_socket
push 0x4019a0
call fcn.00401760
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 dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x40129e
mov eax, 2
mov dword [ebp - 0x68], 0
push 0x88b8
mov word [ebp - 0x6c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x6a], ax
lea eax, [ebp - 0x6c]
push 0x10
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x4014ed
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_binding_socket
push 0x4019a0
call fcn.00401760
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 dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x40129e
push 5
push esi
call dword [sym.imp.WS2_32.dll_listen]
push 0x4019a0
cmp eax, 0xffffffff
jne 0x401530
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_listening_on_socket
call fcn.00401760
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 dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x200]
call dword [sym.imp.FTD2XX.dll_Ordinal_2]
jmp 0x40129e
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Server_listening_on_port
push 0x88b8
call fcn.00401760
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 ebx, dword [sym.imp.WS2_32.dll_accept]
nop dword [eax + eax]
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x218]
push eax
push esi
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x401594
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
mov edx, str.Error_accepting_connection
push 0x4019a0
call fcn.00401760
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_____]
jmp 0x401560
push 0x41
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x214]
push eax
push 2
call dword [sym.imp.WS2_32.dll_inet_ntop]
push 0x4019a0
push dword [ebp - 0x216]
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
mov edx, str.Accepted_connection_from
movzx eax, ax
push eax
call fcn.00401760
lea edx, [ebp - 0x54]
mov ecx, eax
call fcn.00401760
mov edx, 0x403460
mov ecx, eax
call fcn.00401760
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___unsigned_short_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_____]
push 0xc
call fcn.00401d3d
mov dword [ebp - 0x5c], eax
mov dword [eax], edi
mov ecx, dword [ebp - 0x200]
mov dword [eax + 4], ecx
mov dword [eax + 8], 0x401190
lea ecx, [ebp - 0x21c]
mov dword [ebp - 4], 0
push ecx
push 0
push eax
push 0x401c10
push 0
push 0
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__beginthreadex]
add esp, 0x1c
mov dword [ebp - 0x220], eax
test eax, eax
je 0x401683
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 0x21c]
test ecx, ecx
je 0x40167b
push ecx
push eax
call dword [sym.imp.MSVCP140.dll__Thrd_detach]
add esp, 8
test eax, eax
jne 0x401674
xorps xmm0, xmm0
mov dword [ebp - 4], 0xffffffff
movlpd qword [ebp - 0x220], xmm0
jmp 0x401560
push eax
call dword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
push 1
call dword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_Cpp_error_int_]
push 6
mov dword [ebp - 0x21c], 0
call dword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_Cpp_error_int_]
int3