Function at 0x2a598
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xb0
mov rax, qword [0x00078100]
xor rax, rsp
mov qword [rsp + 0xa8], rax
mov rsi, rcx
xor ebx, ebx
lea rcx, [0x0006f580]
xor r12d, r12d
lea r13d, [rbx + 1]
call fcn.00044148
mov r11, qword [rsi + 0xc0]
test r11, r11
je 0x2a6d1
mov r8, qword [rsi + 0xe8]
test r8, r8
je 0x2a6d1
lea rcx, [r8 + 0xf0]
test rcx, rcx
je 0x2a61a
mov rax, qword [rcx]
test rax, rax
je 0x2a61a
mov eax, dword [rax + 4]
jmp 0x2a61c
xor eax, eax
mov rbp, qword [rsi + 0x138]
mov rdx, qword [r8 + 0x10]
cmp rbp, rdx
jae 0x2a648
mov r8, rdx
lea rcx, str.in_msglen___d____minlen___d_
mov rdx, rbp
call fcn.00044148
mov eax, 0xffff8e80
jmp 0x2a6e2
lea r14, [0x0006f138]
mov r15d, 8
cmp eax, 7
jne 0x2a713
mov r9, qword [rsi + 0x120]
and qword [rsp + 0x60], rbx
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
lea rdx, [r8 + 0x40]
mov r8, qword [r8 + 0x18]
mov qword [rsp + 0x28], r9
mov qword [rsp + 0x20], rbp
call fcn.0004212c
xor ebp, ebp
mov edi, eax
cmp eax, ebp
je 0x2a6bf
lea r8, str.cipher_crypt
mov dword [rsp + 0x28], eax
mov r9d, 0x5bb
mov qword [rsp + 0x20], r8
lea r8, [0x0006f138]
mov edx, r13d
mov rcx, rsi
call fcn.00044190
mov eax, edi
jmp 0x2a6e2
mov rax, qword [rsp + 0x60]
cmp qword [rsi + 0x138], rax
je 0x2ad64
lea rcx, str.should_never_happen
call fcn.00044148
mov eax, 0xffff9400
mov rcx, qword [rsp + 0xa8]
xor rcx, rsp
call fcn.0005cf80
lea r11, [rsp + 0xb0]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
cmp eax, 6
je 0x2ab65
cmp eax, r15d
je 0x2ab65
cmp eax, 2
jne 0x2a6d1
xor ecx, ecx
and qword [rsp + 0x60], rcx
cmp dword [rsi + 0x10], eax
jl 0x2a73a
mov rcx, qword [r8 + 0x18]
mov rdx, qword [r8 + 0x18]
lea rax, [rdx + rcx]
cmp rbp, rax
jb 0x2ab4a
mov rax, qword [r8 + 0x28]
lea rcx, [rax + rcx + 1]
cmp rbp, rcx
jb 0x2ab4a
mov r12, qword [rsi + 0x120]
mov rdi, rbp
cmp dword [r11 + 0x94], r13d
jne 0x2a969
lea rcx, str.using_encrypt_then_mac
call fcn.00044148
mov r11, qword [rsi + 0xe8]
lea rdx, [rsp + 0x70]
mov rax, qword [r11 + 0x28]
mov qword [rsp + 0x30], 0xd
mov ebp, 4
sub qword [rsi + 0x138], rax
sub rdi, rax
mov rax, qword [rsi + 0x108]
mov rcx, qword [rax]
mov r9d, 0x647
mov r8, r14
mov qword [rsp + 0x68], rcx
mov rcx, qword [rsi + 0x110]
movzx eax, word [rcx]
mov word [rdx], ax
mov al, byte [rcx + 2]
mov rcx, rsi
mov byte [rdx + 2], al
mov al, byte [rsi + 0x139]
mov edx, ebp
mov byte [rsp + 0x73], al
mov al, byte [rsi + 0x138]
mov byte [rsp + 0x74], al
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
lea rax, str.MACd_meta_data
mov qword [rsp + 0x20], rax
call fcn.00044260
mov rcx, qword [rsi + 0xe8]
mov ebx, 0x88
add rcx, rbx
je 0x2a830
mov rax, qword [rcx]
test rax, rax
je 0x2a830
mov rcx, qword [rcx + 8]
lea r8d, [rbp + 9]
lea rdx, [rsp + 0x68]
call qword [rax + 0x48]
mov rcx, qword [rsi + 0xe8]
add rcx, rbx
je 0x2a859
mov rax, qword [rcx]
test rax, rax
je 0x2a859
mov r8, qword [rsi + 0x138]
mov rdx, qword [rsi + 0x118]
mov rcx, qword [rcx + 8]
call qword [rax + 0x48]
mov rcx, qword [rsi + 0xe8]
add rcx, rbx
je 0x2a879
mov rax, qword [rcx]
test rax, rax
je 0x2a879
mov rcx, qword [rcx + 8]
lea rdx, [rsp + 0x78]
call qword [rax + 0x50]
mov rcx, qword [rsi + 0xe8]
add rcx, rbx
je 0x2a894
mov rax, qword [rcx]
test rax, rax
je 0x2a894
mov rcx, qword [rcx + 8]
call qword [rax + 0x58]
mov rax, qword [rsi + 0xe8]
mov rcx, qword [rsi + 0x138]
mov r9d, 0x650
mov rax, qword [rax + 0x28]
add rcx, qword [rsi + 0x118]
mov r8, r14
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rcx
lea rax, str.message__mac
mov edx, ebp
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044260
mov r11, qword [rsi + 0xe8]
mov r9d, 0x652
mov rax, qword [r11 + 0x28]
mov r8, r14
mov edx, ebp
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x78]
mov rcx, rsi
mov qword [rsp + 0x28], rax
lea rax, str.computed_mac
mov qword [rsp + 0x20], rax
call fcn.00044260
mov rbp, qword [rsi + 0x138]
mov rcx, qword [rsi + 0x118]
mov r8, qword [rsi + 0xe8]
xor r9b, r9b
add rcx, rbp
cmp qword [r8 + 0x28], 0
jbe 0x2a966
lea rdx, [rsp + 0x78]
mov rax, r8
mov r10, qword [rax + 0x28]
sub rdx, rcx
mov al, byte [rdx + rcx]
xor al, byte [rcx]
inc rcx
or r9b, al
sub r10, r13
jne 0x2a940
test r9b, r9b
je 0x2a966
lea rcx, str.message_mac_does_not_match
call fcn.00044148
jmp 0x2a63e
mov ebx, r13d
mov rcx, qword [r8 + 0x18]
xor edx, edx
mov rax, rbp
div rcx
test rdx, rdx
je 0x2a989
mov r8, rcx
lea rcx, str.msglen___d_____ivlen___d____0
jmp 0x2a636
cmp dword [rsi + 0x10], 2
jl 0x2a9c9
sub rbp, rcx
xor edx, edx
sub rdi, rcx
mov qword [rsi + 0x138], rbp
cmp qword [r8 + 0x18], rdx
jbe 0x2a9c9
mov rax, qword [rsi + 0x118]
mov rcx, qword [rsi + 0xe8]
mov al, byte [rdx + rax]
inc rdx
mov byte [rdx + rcx + 0x3f], al
mov rax, qword [rsi + 0xe8]
cmp rdx, qword [rax + 0x18]
jb 0x2a9a4
mov r8, qword [rsi + 0xe8]
lea rax, [rsp + 0x60]
mov r9, r12
mov qword [rsp + 0x30], rax
lea rdx, [r8 + 0x40]
lea rcx, [r8 + 0xf0]
mov r8, qword [r8 + 0x18]
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], rdi
call fcn.0004212c
mov ebp, eax
test eax, eax
je 0x2aa2c
lea r8, str.cipher_crypt
mov dword [rsp + 0x28], eax
mov r9d, 0x67d
mov qword [rsp + 0x20], r8
mov edx, r13d
mov rcx, rsi
mov r8, r14
call fcn.00044190
mov eax, ebp
jmp 0x2a6e2
cmp rdi, qword [rsp + 0x60]
jne 0x2a6d1
cmp dword [rsi + 0x10], 2
jge 0x2aa58
mov r8, qword [rsi + 0xe8]
lea rdx, [r8 + 0x128]
lea rcx, [r8 + 0x40]
mov r8, qword [r8 + 0x18]
call fcn.0005d130
mov r9, qword [rsi + 0x138]
mov rdi, qword [rsi + 0x120]
mov rcx, qword [rsi + 0xe8]
movzx eax, byte [rdi + r9 - 1]
mov rdx, qword [rcx + 0x28]
xor ebp, ebp
inc eax
movsxd r12, eax
lea rax, [rdx + r12]
cmp r9, rax
jae 0x2aa91
cmp ebx, ebp
jne 0x2aa91
mov r12, rbp
mov r13, rbp
mov eax, dword [rsi + 0x10]
cmp eax, ebp
jne 0x2aaaa
cmp r12, qword [rcx + 0x18]
jbe 0x2ab3b
mov r13, rbp
jmp 0x2ab3b
jle 0x2a6d1
lea rax, [rdx + 0x4000]
mov rdx, rbp
mov rcx, rbp
mov r8, r9
mov r11d, 1
mov r10, rbp
sub r8, r12
lea rbp, [r12 - 1]
dec r8
cmp r8, rax
lea rax, [r12 + 1]
setb dl
cmp r9, rax
setae cl
and rdx, rcx
and r13, rdx
mov rdx, r11
imul r8, r13
add r8, rdi
xor eax, eax
cmp rdx, r12
setbe al
xor ecx, ecx
and r11, rax
movzx eax, byte [rdx + r8]
cmp rax, rbp
sete cl
inc rdx
imul rcx, r11
add r10, rcx
cmp rdx, 0x100
jbe 0x2aaf5
xor ebp, ebp
cmp r10, r12
mov rax, rbp
sete al
and r13, rax
mov rax, r13
imul rax, rax, 0x1ff
and r12, rax
sub r9, r12
mov qword [rsi + 0x138], r9
jmp 0x2ad64
mov r9, qword [r8 + 0x28]
mov r8, rdx
lea rcx, str.msglen___d____max__ivlen__d___maclen___d___1______expl_IV__
mov rdx, rbp
call fcn.00044148
jmp 0x2a63e
mov rax, qword [r8]
mov cl, byte [rax + 0x2c]
and cl, 2
neg cl
mov cl, byte [r8 + 0x18]
sbb dl, dl
sub cl, byte [r8 + 0x20]
and dl, 0xf8
movzx r9d, cl
add dl, 0x10
movzx r8d, dl
mov qword [rsp + 0x60], r8
lea rax, [r8 + r9]
cmp rbp, rax
jae 0x2abb2
movzx r8d, cl
movzx r9d, dl
lea rcx, str.msglen___d____explicit_iv_len___d___taglen___d_
mov rdx, rbp
call fcn.00044148
jmp 0x2a63e
mov rax, qword [rsi + 0x108]
mov rdi, qword [rsi + 0x120]
sub rbp, r8
sub rbp, r9
mov qword [rsp + 0x30], 0xd
mov r8, r14
mov qword [rsi + 0x138], rbp
mov rcx, qword [rax]
mov al, byte [rsi + 0x130]
mov byte [rsp + 0x70], al
mov al, byte [rsi + 0xc]
mov qword [rsp + 0x68], rcx
mov byte [rsp + 0x71], al
mov al, byte [rsi + 0x10]
mov r9d, 0x5ea
mov byte [rsp + 0x72], al
mov al, byte [rsi + 0x139]
mov edx, 4
mov byte [rsp + 0x73], al
lea rax, [rsp + 0x68]
mov rcx, rsi
mov qword [rsp + 0x28], rax
lea rax, str.additional_data_used_for_AEAD
mov byte [rsp + 0x74], bpl
mov qword [rsp + 0x20], rax
call fcn.00044260
mov r11, qword [rsi + 0xe8]
mov rax, qword [r11 + 0x20]
mov r8, qword [r11 + 0x18]
mov rdx, qword [rsi + 0x118]
lea rcx, [rax + r11 + 0x40]
sub r8, rax
call fcn.0005d130
mov rax, qword [rsi + 0xe8]
mov r9d, 0x5f1
lea rcx, [rax + 0x40]
mov rax, qword [rax + 0x18]
mov r8, r14
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rcx
lea rax, str.IV_used
mov edx, 4
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044260
mov rax, qword [rsp + 0x60]
lea rbx, [rdi + rbp]
mov qword [rsp + 0x30], rax
lea rax, str.TAG_used
mov r9d, 0x5f2
mov r8, r14
mov edx, 4
mov rcx, rsi
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
call fcn.00044260
mov r8, qword [rsi + 0xe8]
mov rax, qword [rsp + 0x60]
lea r9, [rsp + 0x68]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], rbx
lea rax, [rsp + 0x60]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rdi
lea rdx, [r8 + 0x40]
lea rcx, [r8 + 0xf0]
mov r8, qword [r8 + 0x18]
mov qword [rsp + 0x30], rbp
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], 0xd
call fcn.000422cc
mov ebx, eax
test eax, eax
je 0x2ad54
mov dword [rsp + 0x28], eax
lea rax, str.cipher_auth_decrypt
mov r9d, 0x5ff
mov r8, r14
mov edx, r13d
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044190
mov eax, 0xffff8e80
cmp ebx, 0xffff9d00
cmove ebx, eax
mov eax, ebx
jmp 0x2a6e2
mov ebx, r13d
cmp qword [rsp + 0x60], rbp
jne 0x2a6d1
xor ebp, ebp
mov rax, qword [rsi + 0x138]
mov r9d, 0x6ec
mov r8, r14
mov qword [rsp + 0x30], rax
mov rax, qword [rsi + 0x120]
mov edx, 4
mov qword [rsp + 0x28], rax
lea rax, str.raw_buffer_after_decryption
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044260
cmp ebx, ebp
jne 0x2b002
mov rax, qword [rsi + 0xe8]
mov rcx, qword [rax + 0x28]
mov rax, qword [rsi + 0x110]
sub qword [rsi + 0x138], rcx
mov rcx, qword [rsi + 0x138]
shr rcx, 8
mov byte [rax + 3], cl
mov rcx, qword [rsi + 0x110]
mov al, byte [rsi + 0x138]
mov byte [rcx + 4], al
mov rdi, qword [rsi + 0xe8]
mov rbp, qword [rsi + 0x138]
mov rbx, qword [rsi + 0x120]
mov r8, qword [rdi + 0x28]
lea rcx, [rsp + 0x78]
lea rdx, [rbx + rbp]
call fcn.0005d130
mov r11d, dword [rsi + 0x10]
test r11d, r11d
jne 0x2ae40
mov eax, dword [rsi + 0x130]
lea rdx, [rdi + 0x64]
lea rcx, [rdi + 0x88]
mov dword [rsp + 0x28], eax
mov rax, qword [rsi + 0x108]
mov r9, rbp
mov r8, rbx
mov qword [rsp + 0x20], rax
call fcn.00029be8
xor ebp, ebp
jmp 0x2af2e
jle 0x2a6d1
lea rbx, [r12 + rbp + 0x15]
lea rax, [rbp + 0x15]
lea rcx, [rdi + 0x88]
shr rax, 6
shr rbx, 6
xor ebp, ebp
sub rbx, rax
mov rax, r13
imul rax, rax, 0xff
and rbx, rax
cmp rcx, rbp
je 0x2ae8f
mov rax, qword [rcx]
cmp rax, rbp
je 0x2ae8f
mov rdx, qword [rsi + 0x108]
mov rcx, qword [rcx + 8]
lea r8d, [rbp + 0xd]
call qword [rax + 0x48]
mov rcx, qword [rsi + 0xe8]
mov edi, 0x88
add rcx, rdi
je 0x2aebd
mov rax, qword [rcx]
cmp rax, rbp
je 0x2aebd
mov r8, qword [rsi + 0x138]
mov rdx, qword [rsi + 0x120]
mov rcx, qword [rcx + 8]
call qword [rax + 0x48]
mov rcx, qword [rsi + 0xe8]
add rcx, rdi
je 0x2aee6
mov rax, qword [rcx]
cmp rax, rbp
je 0x2aee6
mov rdx, qword [rsi + 0x138]
mov rcx, qword [rcx + 8]
add rdx, qword [rsi + 0x120]
call qword [rax + 0x50]
cmp rbx, rbp
jbe 0x2af13
mov rcx, qword [rsi + 0xe8]
add rcx, rdi
je 0x2af0d
mov rax, qword [rcx]
cmp rax, rbp
je 0x2af0d
mov rdx, qword [rsi + 0x120]
mov rcx, qword [rcx + 8]
call qword [rax + 0x78]
sub rbx, 1
jne 0x2aeeb
mov rcx, qword [rsi + 0xe8]
add rcx, rdi
je 0x2af2e
mov rax, qword [rcx]
cmp rax, rbp
je 0x2af2e
mov rcx, qword [rcx + 8]
call qword [rax + 0x58]
mov rax, qword [rsi + 0xe8]
mov ebx, 4
mov r9d, 0x731
mov rcx, qword [rax + 0x28]
lea rax, [rsp + 0x78]
mov r8, r14
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x28], rax
lea rax, str.message__mac
mov edx, ebx
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044260
mov rax, qword [rsi + 0xe8]
mov rcx, qword [rsi + 0x138]
mov rax, qword [rax + 0x28]
add rcx, qword [rsi + 0x120]
mov r9d, 0x733
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rcx
lea rax, str.computed_mac
mov r8, r14
mov edx, ebx
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.00044260
mov r11, qword [rsi + 0x138]
mov rax, qword [rsi + 0xe8]
add r11, qword [rsi + 0x120]
mov r8b, bpl
mov rdx, rbp
cmp qword [rax + 0x28], rbp
jbe 0x2aff8
mov r9, qword [rax + 0x28]
lea rax, [rsp + 0x78]
sub r11, rax
lea rax, [rsp + rdx + 0x78]
inc rdx
mov cl, byte [r11 + rax]
xor cl, byte [rax]
or r8b, cl
cmp rdx, r9
jb 0x2afdb
cmp r8b, bpl
cmovne r13, rbp
cmp r13, rbp
jne 0x2b00b
jmp 0x2a63e
cmp ebx, 1
jne 0x2a6d1
cmp qword [rsi + 0x138], rbp
jne 0x2b02f
inc dword [rsi + 0x150]
cmp dword [rsi + 0x150], 3
jle 0x2b035
lea rcx, str.received_four_consecutive_empty_messages__possible_DoS_attack
jmp 0x2a95c
mov dword [rsi + 0x150], ebp
mov rax, qword [rsi + 0x108]
inc byte [r15 + rax - 1]
mov rax, qword [rsi + 0x108]
cmp byte [r15 + rax - 1], bpl
jne 0x2b055
sub r15, 1
jne 0x2b03c
cmp r15, rbp
jne 0x2b070
lea rcx, str.incoming_message_counter_would_wrap
call fcn.00044148
mov eax, 0xffff9480
jmp 0x2a6e2
lea rcx, str.__decrypt_buf
call fcn.00044148
xor eax, eax
jmp 0x2a6e2