Function at 0x1400bae70
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push rbx
sub rsp, 0x2c0
mov rax, qword [0x140209b48]
xor rax, rsp
mov qword [rsp + 0x2b0], rax
cmp qword [rcx + 0x260], 0xffffffffffffffff
mov rbx, rcx
jne 0x1400bb1e8
mov ecx, dword [rcx + 0x1cc]
sub ecx, 1
je 0x1400bafeb
sub ecx, 1
je 0x1400baf91
cmp ecx, 1
je 0x1400baed5
lea rdx, str.503_Invalid_sequence_of_commands._r_n
mov rcx, rbx
call fcn.1400b79f0
mov rcx, rbx
call fcn.1400b83d0
jmp 0x1400baf91
movsx ecx, word [rbx + 0x1d8]
mov edx, 1
mov qword [rsp + 0x2d8], rdi
lea r8d, [rdx + 5]
call qword [sym.imp.WS2_32.dll_socket]
cmp rax, 0xffffffffffffffff
mov qword [rbx + 0x260], rax
je 0x1400bafc9
lea r9, [rsp + 0x30]
mov edx, 0xffff
mov r8d, 1
mov rcx, rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rdx, qword [0x14020b010]
mov rcx, qword [rbx + 0x260]
mov rdx, qword [rdx + 0x20]
mov r9d, gethostbyname
mov r8d, 0x403
call qword [sym.imp.WS2_32.dll_WSAAsyncSelect]
cmp word [rbx + 0x1d8], 2
mov rcx, qword [rbx + 0x260]
mov eax, reloc.WS2_32.dll_recv
mov r8d, 0x1c
lea rdx, [rbx + 0x1d8]
cmove r8d, eax
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x1400bafaa
mov rcx, rbx
call fcn.1400ba7c0
mov rdi, qword [rsp + 0x2d8]
mov rcx, qword [rsp + 0x2b0]
xor rcx, rsp
call fcn.1401a6ae0
add rsp, 0x2c0
pop rbx
ret
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x1400baf89
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.500_Failed_to_connect_to_port__d._r_n
mov r8d, eax
jmp 0x1400bafd9
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.500_Failed_to_create_port_socket__d._r_n
mov r8d, eax
mov rcx, rbx
call fcn.1400b79f0
mov rcx, rbx
call fcn.1400b83d0
jmp 0x1400baf89
mov edx, 1
lea ecx, [rdx + 1]
lea r8d, [rdx + 5]
call qword [sym.imp.WS2_32.dll_socket]
cmp rax, 0xffffffffffffffff
mov qword [rbx + 0x260], rax
je 0x1400bb1c3
lea rcx, [rsp + 0x190]
call fcn.1400012c0
lea rcx, [rsp + 0x70]
call fcn.1400012c0
mov rcx, qword [rbx + 0x260]
lea r9, [rsp + 0x30]
mov edx, 0xffff
mov r8d, 1
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x20], 4
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rdx, qword [0x14020b010]
mov rcx, qword [rbx + 0x260]
mov rdx, qword [rdx + 0x20]
mov r9d, gethostbyname
mov r8d, 0x403
call qword [sym.imp.WS2_32.dll_WSAAsyncSelect]
movzx ecx, byte [rbx + 0x1da]
movzx eax, byte [rbx + 0x1db]
movzx r9d, byte [rbx + 0x1d9]
movzx r8d, byte [rbx + 0x1d8]
xor r11d, r11d
mov qword [rsp + 0x48], r11
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ecx
mov qword [rsp + 0x40], r11
lea rcx, [rsp + 0x190]
lea rdx, str._d._d._d._d
mov qword [rsp + 0x50], r11
mov qword [rsp + 0x58], r11
mov qword [rsp + 0x60], r11
mov qword [rsp + 0x68], r11
mov dword [rsp + 0x44], 2
mov dword [rsp + 0x4c], 6
mov dword [rsp + 0x48], 1
call fcn.140176700
mov r8d, dword [rbx + 0x1dc]
lea rdx, [0x1401aef94]
lea rcx, [rsp + 0x70]
call fcn.140176700
mov rdx, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x198]
lea r9, [rsp + 0x38]
lea r8, [rsp + 0x40]
call qword [0x140200a28]
test eax, eax
jne 0x1400bb190
mov rdx, qword [rsp + 0x38]
mov rcx, qword [rbx + 0x260]
mov r8d, dword [rdx + 0x10]
mov rdx, qword [rdx + 0x20]
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x1400bb156
mov rcx, rbx
call fcn.1400ba7c0
mov rcx, qword [rsp + 0x38]
call qword [0x140200a30]
jmp 0x1400bb1a7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x1400bb183
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.500_Failed_to_connect_to_port__d._r_n
mov rcx, rbx
mov r8d, eax
call fcn.1400b79f0
mov rcx, rbx
call fcn.1400b83d0
mov rcx, qword [rsp + 0x38]
call qword [0x140200a30]
jmp 0x1400bb1a7
lea rdx, str.500_Failed_to_get_port_address._r_n
mov rcx, rbx
call fcn.1400b79f0
mov rcx, rbx
call fcn.1400b83d0
lea rcx, [rsp + 0x70]
call fcn.140175010
lea rcx, [rsp + 0x190]
call fcn.140175010
jmp 0x1400baf91
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.500_Failed_to_create_port_socket__d._r_n
mov rcx, rbx
mov r8d, eax
call fcn.1400b79f0
mov rcx, rbx
call fcn.1400b83d0
jmp 0x1400baf91
call fcn.1400ba7c0
jmp 0x1400baf91