Function at 0x1400c5240
Capabilities:
Connect socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r14
sub rsp, 0x150
mov rax, qword [0x14031a320]
xor rax, rsp
mov qword [rsp + 0x140], rax
mov rdi, r8
mov rsi, rdx
mov r14, rcx
mov rbx, qword [rcx + 0x198]
test rbx, rbx
je 0x1400c5644
mov r8d, dword [rbx + 0xc]
mov edx, dword [rbx + 8]
mov ecx, dword [rbx + 4]
call qword [sym.imp.WS2_32.dll_socket]
mov rbp, rax
cmp rax, 0xffffffffffffffff
jne 0x1400c52f0
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c52b4
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.socket_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
nop
jmp 0x1400c567a
mov dword [rsp + 0x38], 0x3e8
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x38]
mov edx, 0xffff
mov r8d, 0x1006
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x1400c537c
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c5340
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.socket_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
nop
jmp 0x1400c567a
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x38]
mov edx, 0xffff
mov r8d, 0x1005
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x1400c5400
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c53c4
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.socket_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
nop
jmp 0x1400c567a
mov r8d, dword [rbx + 0x10]
mov rdx, qword [rbx + 0x20]
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x1400c5424
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1400c5683
mov r8d, dword [rsi + 0x10]
cmp qword [rsi + 0x18], 0x10
jb 0x1400c5432
mov rsi, qword [rsi]
xor r9d, r9d
mov rdx, rsi
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x1400c54ad
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c5468
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.send_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_closesocket]
nop
jmp 0x1400c567a
mov edx, 1
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_shutdown]
cmp eax, 0xffffffff
jne 0x1400c5527
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c54e2
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.shutdown_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_closesocket]
nop
jmp 0x1400c567a
mov rax, rdi
cmp qword [rdi + 0x18], 0x10
jb 0x1400c5534
mov rax, qword [rdi]
mov qword [rdi + 0x10], 0
mov byte [rax], 0
xor r9d, r9d
mov r8d, pe_nt_image_headers64
lea rdx, [rsp + 0x40]
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_recv]
test eax, eax
jle 0x1400c55d3
nop word [rax + rax]
mov esi, eax
mov rcx, qword [rdi + 0x10]
mov rdx, qword [rdi + 0x18]
mov rax, rdx
sub rax, rcx
cmp rsi, rax
ja 0x1400c55a3
lea rax, [rcx + rsi]
mov qword [rdi + 0x10], rax
mov rax, rdi
cmp rdx, 0x10
jb 0x1400c5589
mov rax, qword [rdi]
lea rbx, [rax + rcx]
mov r8, rsi
lea rdx, [rsp + 0x40]
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
mov byte [rbx + rsi], 0
jmp 0x1400c55b8
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x40]
mov rdx, rsi
mov rcx, rdi
call fcn.1400bcc40
xor r9d, r9d
mov r8d, pe_nt_image_headers64
lea rdx, [rsp + 0x40]
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x1400c5560
je 0x1400c5637
mov rbx, qword [r14 + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c55f7
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.recv_failed_with_error:
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
mov rdi, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
mov rcx, rax
lea rdx, [0x1402e09ac]
call fcn.1400bc5b0
nop
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_unlock]
mov rcx, rbp
call qword [sym.imp.WS2_32.dll_closesocket]
mov al, 1
jmp 0x1400c5685
mov rbx, qword [rcx + 0x1a8]
mov qword [rsp + 0x30], rbx
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_lock]
test eax, eax
je 0x1400c5666
mov ecx, eax
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Throw_C_error_int_]
nop
lea rdx, str.unable_to_connect_to_server_n
mov rcx, qword [r14 + 0x1a0]
call fcn.1400bc5b0
nop
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll__Mtx_unlock]
xor al, al
mov rcx, qword [rsp + 0x140]
xor rcx, rsp
call fcn.140252d20
add rsp, 0x150
pop r14
pop rdi
pop rsi
pop rbp
pop rbx
ret