Function at 0x140037910
Capabilities:
Encrypt data via sspi
Send data
Send data on socket

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x98
movaps xmmword [rsp + 0x80], xmm6
mov qword [rsp + 0x20], rdx
mov rsi, rcx
test r8, r8
je 0x140037cc9
mov r14, r8
lea rax, [rsi + 8]
mov qword [rsp + 0x68], rax
lea r15, [rsp + 0x28]
xorps xmm6, xmm6
mov r13d, 0x7fffffff
mov rbp, qword [sym.imp.ws2_32.dll_send]
jmp 0x140037982
mov eax, ebx
and eax, 0xff00
cmp eax, 0x2300
mov rbp, qword [sym.imp.ws2_32.dll_send]
jne 0x140037d47
test r14, r14
je 0x140037cc9
mov rcx, r15
mov rdx, rsi
call fcn.1400397e0
cmp dword [rsp + 0x28], 1
jne 0x1400379d0
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rdi, rbp
shld rdi, rbx, 0x38
mov r12, rbp
shr r12, 8
lea eax, [rbx - 1]
cmp al, 2
jb 0x140037960
test bl, bl
jne 0x140037a7c
shr rbx, 0x20
jmp 0x140037be6
cmp dword [rsp + 0x2c], 0
je 0x140037a65
mov r8, qword [rsi + 0xb0]
mov rbx, qword [rsi + 0xb8]
cmp rbx, r8
jne 0x140037c44
mov rax, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
mov rdi, rax
shr rdi, 0x20
mov r12d, ecx
cmp r12, r14
cmovae r12, r14
mov r15d, eax
lea rbp, [r12 + r15]
add rdi, rbp
sub rdi, rbx
jbe 0x140037b16
mov rax, qword [rsi + 0xa8]
sub rax, rbx
cmp rax, rdi
jb 0x140037ad5
mov r13, qword [rsi + 0xa0]
lea rcx, [rbx + r13]
cmp rdi, 2
jb 0x140037b03
lea r8, [rdi - 1]
xor edx, edx
call fcn.140092ff0
add rbx, rdi
add rbx, 0xffffffffffffffff
add r13, rbx
mov rcx, r13
jmp 0x140037b08
mov ebx, 0x80090317
movabs rdi, 0x80090317000000
xor r12d, r12d
jmp 0x140037bed
cmp byte [rbp + 0x10], 0x23
jne 0x140037d8f
mov rcx, qword [rbp]
mov rax, qword [rbp + 8]
call qword [rax]
mov rax, qword [rbp + 8]
cmp qword [rax + 8], 0
je 0x140037ab8
mov r8, qword [rbp]
cmp qword [rax + 0x10], 0x11
jb 0x140037aaa
mov r8, qword [r8 - 8]
mov rcx, qword [0x140443578]
xor edx, edx
call sub.kernel32.dll_HeapFree
mov rcx, qword [0x140443578]
xor edx, edx
mov r8, rbp
call sub.kernel32.dll_HeapFree
mov rbp, qword [sym.imp.ws2_32.dll_send]
jmp 0x140037979
lea rcx, [rsi + 0xa0]
mov rdx, rbx
mov r8, rdi
call fcn.1400945d0
mov rbx, qword [rsi + 0xb0]
mov r13, qword [rsi + 0xa0]
lea rcx, [rbx + r13]
cmp rdi, 2
jae 0x140037a48
test rdi, rdi
je 0x140037b0f
mov byte [rcx], 0
add rbx, 1
mov qword [rsi + 0xb0], rbx
cmp rbx, rbp
jb 0x140037d93
mov r13, qword [rsi + 0xa0]
lea rdi, [r15 + r13]
mov rcx, rdi
mov rdx, qword [rsp + 0x20]
mov r8, r12
call fcn.1400931b0
cmp rbx, r15
jb 0x140037d93
sub ebx, ebp
test r13, r13
cmove r15, r13
mov rax, r12
cmove rax, r13
cmove rbx, r13
movabs rcx, 0x700000000
or r15, rcx
movabs rcx, 0x100000000
or rax, rcx
add rbp, r13
movabs rcx, 0x600000000
or rbx, rcx
mov qword [rsp + 0x30], r13
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x48], rbx
movups xmmword [rsp + 0x58], xmm6
lea r15, [rsp + 0x28]
mov qword [rsp + 0x78], r15
movabs rax, 0x400000000
mov qword [rsp + 0x70], rax
mov rcx, qword [rsp + 0x68]
xor edx, edx
lea r8, [rsp + 0x70]
xor r9d, r9d
call sub.secur32.dll_EncryptMessage
test eax, eax
je 0x140037c01
mov ebx, eax
mov edi, eax
shl rdi, 0x18
xor r12d, r12d
mov r13d, 0x7fffffff
mov rbp, qword [sym.imp.ws2_32.dll_send]
mov ecx, ebx
call fcn.140084604
cmp al, 0x23
je 0x140037979
jmp 0x140037d45
mov eax, dword [rsp + 0x38]
add eax, dword [rsp + 0x28]
add eax, dword [rsp + 0x48]
mov r8, qword [rsi + 0xb0]
cmp r8, rax
mov r13d, 0x7fffffff
mov rbp, qword [sym.imp.ws2_32.dll_send]
jb 0x140037c30
mov qword [rsi + 0xb0], rax
mov r8, rax
mov qword [rsi + 0xb8], 0
mov qword [rsi + 0xc0], r12
xor ebx, ebx
cmp r8, rbx
je 0x140037c93
mov rdi, qword [rsi + 0x50]
nop dword [rax]
sub r8, rbx
jb 0x140037d93
mov rdx, qword [rsi + 0xa0]
add rdx, rbx
cmp r8, 0x7fffffff
cmovae r8d, r13d
mov rcx, rdi
xor r9d, r9d
call rbp
cmp eax, 0xffffffff
je 0x140037cb6
cdqe
add rbx, rax
mov qword [rsi + 0xb8], rbx
mov r8, qword [rsi + 0xb0]
cmp r8, rbx
jne 0x140037c50
mov rax, qword [rsi + 0xc0]
test rax, rax
je 0x140037d75
sub r14, rax
jb 0x140037d93
add qword [rsp + 0x20], rax
jmp 0x140037979
call qword [sym.imp.ws2_32.dll_WSAGetLastError]
mov ebx, eax
shl rbx, 0x20
xor ebp, ebp
jmp 0x14003799e
mov r8, qword [rsi + 0xb0]
mov rbp, qword [rsi + 0xb8]
mov bl, 4
cmp r8, rbp
je 0x140037d34
mov rdi, qword [rsi + 0x50]
mov r14d, 0x7fffffff
mov r15, qword [sym.imp.ws2_32.dll_send]
nop
sub r8, rbp
jb 0x140037d93
mov rdx, qword [rsi + 0xa0]
add rdx, rbp
cmp r8, 0x7fffffff
cmovae r8d, r14d
mov rcx, rdi
xor r9d, r9d
call r15
cmp eax, 0xffffffff
je 0x140037d36
cdqe
add rbp, rax
mov qword [rsi + 0xb8], rbp
mov r8, qword [rsi + 0xb0]
cmp r8, rbp
jne 0x140037cf0
jmp 0x140037d47
call qword [sym.imp.ws2_32.dll_WSAGetLastError]
mov edi, eax
shl rdi, 0x18
xor r12d, r12d
xor ebx, ebx
shld r12, rdi, 8
shl rdi, 8
movzx eax, bl
or rax, rdi
mov rdx, r12
movaps xmm6, xmmword [rsp + 0x80]
add rsp, 0x98
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
lea rdi, str.failed_to_write_whole_buffer
mov r12, rdi
shr r12, 8
shl rdi, 0x38
or rdi, 0x17
mov bl, 2
jmp 0x140037d47
mov bl, 3
jmp 0x140037d47
ud2