Function at 0x140040350
Capabilities:
Connect socket
Terminate process

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rdi
sub rsp, 0x1a8
lea rbp, [rsp + 0x20]
lea rdi, [rsp + 0x20]
mov ecx, getprotobynumber
mov eax, 0xcccccccc
rep stosd dword [rdi], eax
mov rcx, qword [rsp + 0x1c8]
mov rax, qword [0x14009ad80]
xor rax, rbp
mov qword [rbp + 0x170], rax
lea rcx, [0x1401a0c96]
call fcn.140068b20
mov qword [rbp + 8], 0
mov rax, qword [rbp + 0x1a0]
mov eax, dword [rax + 0x270]
shr eax, 6
and eax, 1
mov dword [rbp + 0x24], eax
mov rax, qword [rbp + 0x1a0]
cmp dword [rax + 0x220], 0x100
jne 0x1400404ec
mov rax, qword [rbp + 0x1a0]
mov rax, qword [rax + 0x2f8]
mov qword [rbp + 0x68], rax
cmp qword [rbp + 0x68], 1
jge 0x1400404c7
lea rax, [rbp + 0x88]
mov rdi, rax
xor eax, eax
mov ecx, reloc.WS2_32.dll_recv
rep stosb byte [rdi], al
xor r8d, r8d
mov edx, 1
mov ecx, 2
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rbp + 0x68], rax
cmp qword [rbp + 0x68], 0xffffffffffffffff
jne 0x14004043a
lea rdx, str.redis:_socket___failed_to_create_socket_n
xor ecx, ecx
call fcn.14002ddd0
mov ecx, 1
call qword [sym.imp.ucrtbased.dll_exit]
mov rax, qword [rbp + 0x1a0]
mov ecx, dword [rax + 0x2d8]
call qword [sym.imp.WS2_32.dll_htonl]
mov dword [rbp + 0x8c], eax
mov rax, qword [rbp + 0x1a0]
movzx ecx, word [rax + 0x2f0]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp + 0x8a], ax
mov eax, 2
mov word [rbp + 0x88], ax
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rbp + 0x88]
mov rcx, qword [rbp + 0x68]
call qword [sym.imp.WS2_32.dll_connect]
mov dword [rbp + 0x44], eax
cmp dword [rbp + 0x44], 0
je 0x1400404b5
lea rdx, str.redis:_connect___failed_n
xor ecx, ecx
call fcn.14002ddd0
lea rcx, str.connect
call qword [sym.imp.ucrtbased.dll_perror]
mov rax, qword [rbp + 0x1a0]
mov rcx, qword [rbp + 0x68]
mov qword [rax + 0x2f8], rcx
mov rax, qword [rbp + 0x1a0]
mov rax, qword [rax + 0x218]
mov rdx, qword [rbp + 0x68]
mov rcx, qword [rbp + 0x1a0]
call qword [rax + reloc.WS2_32.dll_recv]
mov rax, qword [rbp + 0x68]
jmp 0x1400405dc
mov eax, 1
imul rax, rax, 0
mov rcx, qword [rbp + 0x1a8]
movsx eax, byte [rcx + rax]
cmp eax, 0x2d
jne 0x14004052c
mov eax, 1
imul rax, rax, 1
mov rcx, qword [rbp + 0x1a8]
movsx eax, byte [rcx + rax]
test eax, eax
jne 0x14004052c
mov ecx, 1
call qword [sym.imp.ucrtbased.dll___acrt_iob_func]
mov qword [rbp + 8], rax
cmp qword [rbp + 8], 0
jne 0x1400405bb
mov r8d, dword [rbp + 0x24]
mov rdx, qword [rbp + 0x1a8]
lea rcx, [rbp + 8]
call fcn.140015920
mov dword [rbp + 0x44], eax
cmp dword [rbp + 0x44], 0
jne 0x14004055b
cmp qword [rbp + 8], 0
jne 0x1400405bb
cmp dword [rbp + 0x24], 0
je 0x140040571
lea rax, str.appending
mov qword [rbp + 0x168], rax
jmp 0x14004057f
lea rax, str.writing
mov qword [rbp + 0x168], rax
mov ecx, 2
call qword [sym.imp.ucrtbased.dll___acrt_iob_func]
mov r8, qword [rbp + 0x168]
lea rdx, str.out:_could_not_open_file_for__s_n
mov rcx, rax
call fcn.140001b10
mov rcx, qword [rbp + 0x1a8]
call qword [sym.imp.ucrtbased.dll_perror]
mov dword [0x14019b914], 1
xor eax, eax
jmp 0x1400405dc
mov rax, qword [rbp + 0x1a0]
mov eax, dword [rax + 0x230]
or eax, 1
mov rcx, qword [rbp + 0x1a0]
mov dword [rcx + 0x230], eax
mov rax, qword [rbp + 8]
mov rdi, rax
lea rcx, [rbp - 0x20]
lea rdx, [0x140086e80]
call fcn.140068a90
mov rax, rdi
mov rcx, qword [rbp + 0x170]
xor rcx, rbp
call fcn.140068cb0
lea rsp, [rbp + 0x188]
pop rdi
pop rbp
ret