Function at 0x180022340
Capabilities:
Encrypt or decrypt data via bcrypt

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x30]
sub rsp, 0x130
mov rax, qword [0x1801d72c0]
xor rax, rsp
mov qword [rbp + 0x20], rax
mov qword [rsp + 0x50], r9
mov r15, r8
mov rsi, rdx
mov qword [rsp + 0x68], rdx
xor r14d, r14d
mov qword [rsp + 0x60], r14
mov qword [rsp + 0x68], r14
mov r13, qword [r8 + 0x10]
mov dword [rbp - 0x30], r14d
cmp r13, 0x14
ja 0x1800223ba
xorps xmm0, xmm0
movups xmmword [rdx], xmm0
mov qword [rdx + 0x10], r14
mov qword [rdx + 0x18], r14
xor r8d, r8d
lea rdx, [0x1801a09d9]
mov rcx, rsi
call fcn.180005170
jmp 0x180022527
xorps xmm1, xmm1
movdqu xmmword [rbp - 0x10], xmm1
mov qword [rbp], r14
mov rdx, r13
lea rcx, [rbp - 0x10]
call fcn.18003d420
mov r8, r13
xor edx, edx
mov rbx, qword [rbp - 0x10]
mov rcx, rbx
call fcn.180183cb0
lea rax, [rbx + r13]
mov qword [rbp - 8], rax
xorps xmm1, xmm1
movdqu xmmword [rbp + 8], xmm1
mov r12, r14
mov qword [rbp + 0x18], r14
movdqu xmmword [rbp - 0x28], xmm1
mov qword [rbp - 0x18], r14
mov edx, recv
lea rcx, [rbp - 0x28]
call fcn.18003d420
xor eax, eax
mov rdi, qword [rbp - 0x28]
mov qword [rdi], rax
mov dword [rdi + 8], eax
lea rax, [rdi + 0xc]
mov qword [rbp - 0x20], rax
cmp qword [r15 + 0x18], 0xf
jbe 0x180022438
mov rax, qword [r15]
lea r8, [rax + 0xf]
mov rdx, rax
jmp 0x18002243f
lea r8, [r15 + 0xf]
mov rdx, r15
add rdx, 3
sub r8, rdx
mov rcx, rdi
call fcn.180183610
cmp qword [r15 + 0x18], 0xf
jbe 0x180022460
mov r8, qword [r15]
add r8, r13
mov r15, qword [r15]
jmp 0x180022464
lea r8, [r15 + r13]
lea rdx, [r15 + 0xf]
sub r8, rdx
mov rcx, rbx
call fcn.180183610
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1801a52c8]
lea rcx, [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
je 0x180022551
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], r14
mov qword [rsi + 0x18], r14
xor r8d, r8d
lea rdx, [0x1801a09d9]
mov rcx, rsi
call fcn.180005170
nop
test rdi, rdi
je 0x1800224ee
mov rdx, qword [rbp - 0x18]
sub rdx, rdi
cmp rdx, 0x1000
mov rax, rdi
jb 0x1800224e5
add rdx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022947
mov rcx, rdi
call fcn.180152a40
nop
test rbx, rbx
je 0x180022527
mov rdx, qword [rbp]
sub rdx, rbx
mov rax, rbx
cmp rdx, 0x1000
jb 0x18002251f
add rdx, 0x27
mov rbx, qword [rbx - 8]
sub rax, rbx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022935
mov rcx, rbx
call fcn.180152a40
mov rax, rsi
mov rcx, qword [rbp + 0x20]
xor rcx, rsp
call fcn.1801525e0
mov rbx, qword [rsp + 0x170]
add rsp, 0x130
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov dword [rsp + 0x20], r14d
mov r9d, 0x20
lea r8, str.ChainingModeGCM
lea rdx, str.ChainingMode
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptSetProperty]
test eax, eax
je 0x18002258b
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
jmp 0x180022493
mov dword [rsp + 0x30], r14d
mov rcx, qword [rsp + 0x50]
mov eax, dword [rcx]
mov dword [rsp + 0x28], eax
mov rax, qword [rcx + 8]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, [rsp + 0x68]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
jne 0x180022579
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rsp + 0x70], xmm0
movups xmmword [rbp - 0x80], xmm0
movups xmmword [rbp - 0x70], xmm0
movups xmmword [rbp - 0x60], xmm0
movups xmmword [rbp - 0x50], xmm0
mov qword [rbp - 0x40], rax
mov dword [rsp + 0x70], 0x58
mov dword [rsp + 0x74], 1
add r13, 0xffffffffffffffe1
mov qword [rsp + 0x78], rdi
mov dword [rbp - 0x80], recv
lea rax, [rbx + r13]
mov qword [rbp - 0x68], rax
mov dword [rbp - 0x60], reloc.WS2_32.dll_recv
mov dword [rsp + 0x48], r14d
lea rax, [rbp - 0x30]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x38], r14d
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x70]
mov r8d, r13d
mov rdx, rbx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.bcrypt.dll_BCryptDecrypt]
test eax, eax
je 0x180022664
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
jmp 0x180022493
mov eax, dword [rbp - 0x30]
mov edx, eax
test eax, eax
je 0x18002267d
lea rcx, [rbp + 8]
call fcn.180045670
mov eax, dword [rbp - 0x30]
mov r12, qword [rbp + 0x18]
mov dword [rsp + 0x48], r14d
lea rcx, [rbp - 0x30]
mov qword [rsp + 0x40], rcx
mov dword [rsp + 0x38], eax
mov r15, qword [rbp + 8]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x70]
mov r8d, r13d
mov rdx, rbx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov rcx, qword [rsp + 0x68]
test eax, eax
je 0x180022774
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], r14
mov qword [rsi + 0x18], r14
xor r8d, r8d
lea rdx, [0x1801a09d9]
mov rcx, rsi
call fcn.180005170
nop
test rdi, rdi
je 0x180022733
mov rdx, qword [rbp - 0x18]
sub rdx, rdi
mov rax, rdi
cmp rdx, 0x1000
jb 0x18002272a
add rdx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022947
mov rcx, rdi
call fcn.180152a40
nop
test r15, r15
je 0x1800224ee
sub r12, r15
mov rax, r15
cmp r12, 0x1000
jb 0x180022764
add r12, 0x27
mov r15, qword [r15 - 8]
sub rax, r15
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022929
mov rdx, r12
mov rcx, r15
call fcn.180152a40
jmp 0x1800224ee
test rcx, rcx
je 0x18002277f
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x180022791
xor edx, edx
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], r14
mov r13d, reloc.WS2_32.dll_ntohs
mov qword [rsi + 0x18], r13
mov rcx, qword [rbp + 0x10]
cmp r15, rcx
jne 0x1800227b6
mov byte [rsi], 0
jmp 0x180022880
mov rax, rcx
sub rax, r15
mov qword [rsp + 0x50], rax
movabs rdx, 0x7fffffffffffffff
cmp rax, rdx
ja 0x18002293b
cmp rax, r13
jbe 0x180022855
mov r13, rax
or r13, 0xf
cmp r13, rdx
jbe 0x180022815
mov r13, rdx
movabs rax, 0x8000000000000000
add rax, 0x27
mov rcx, rax
call fcn.180152a74
test rax, rax
je 0x180022941
lea r14, [rax + 0x27]
and r14, 0xffffffffffffffe0
mov qword [r14 - 8], rax
jmp 0x18002284a
mov eax, reloc.WS2_32.dll_shutdown
cmp r13, rax
cmovb r13, rax
lea rcx, [r13 + 1]
test rcx, rcx
je 0x18002284a
cmp rcx, 0x1000
jb 0x180022842
lea rax, [rcx + 0x27]
cmp rax, rcx
jbe 0x18002292f
jmp 0x1800227f6
call fcn.180152a74
mov r14, rax
mov qword [rsi], r14
mov qword [rsi + 0x18], r13
mov rcx, qword [rbp + 0x10]
mov r14, rsi
cmp r13, 0xf
jbe 0x180022861
mov r14, qword [rsi]
sub rcx, r15
mov r8, rcx
mov rdx, r15
mov rcx, r14
call fcn.180183610
mov rax, qword [rsp + 0x50]
mov qword [rsi + 0x10], rax
mov byte [rax + r14], 0
test rdi, rdi
je 0x1800228ba
mov rdx, qword [rbp - 0x18]
sub rdx, rdi
mov rax, rdi
cmp rdx, 0x1000
jb 0x1800228b1
add rdx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022947
mov rcx, rdi
call fcn.180152a40
nop
test r15, r15
je 0x1800228ef
sub r12, r15
mov rax, r15
cmp r12, 0x1000
jb 0x1800228e3
add r12, 0x27
mov r15, qword [r15 - 8]
sub rax, r15
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022929
mov rdx, r12
mov rcx, r15
call fcn.180152a40
nop
test rbx, rbx
je 0x180022527
mov rdx, qword [rbp]
sub rdx, rbx
mov rax, rbx
cmp rdx, 0x1000
jb 0x18002251f
add rdx, 0x27
mov rbx, qword [rbx - 8]
sub rax, rbx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180022935
jmp 0x18002251f
call fcn.18015f738
nop
call fcn.180001bf0
nop
call fcn.18015f738
nop
call fcn.180001db0
int3
call fcn.18015f738
nop
call fcn.18015f738
int3