Function at 0x140005290
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r12
push rsi
push rdi
push rbx
sub rsp, 0x88
test rcx, rcx
sete byte [rsp + 0x22]
cmp byte [rsp + 0x22], 0
je 0x1400052c0
add rsp, 0x88
pop rbx
pop rdi
pop rsi
pop r12
pop r14
pop r15
ret
mov r14, rcx
lea rax, [rcx + 0x1c]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x48]
mov edi, dword [rax]
movzx eax, byte [rsp + 0x22]
mov ecx, 0xffffffff
call fcn.1400058b0
mov ecx, 0xffffffff
call fcn.1400058b0
mov ecx, 0xfffffffd
mov r8d, 0xa8
mov edx, edi
call fcn.1400058b0
mov ecx, 0xffffffff
mov edx, 0x40
call fcn.1400058b0
mov ecx, 2
mov edx, edi
call fcn.1400058b0
xor ecx, ecx
call fcn.1400058b0
cmp edi, eax
je 0x14000539c
mov rax, qword [r14]
mov rdi, qword [r14 + 8]
mov edx, dword [rax + 0x28]
mov rsi, rdx
add rsi, rdi
xor ecx, ecx
mov r8d, edx
call fcn.1400058b0
mov rcx, rdi
mov edx, eax
xor r8d, r8d
call rsi
mov ecx, 0xffffffff
mov edx, 0xeaa2b3
call fcn.1400058b0
mov ecx, 0xffffffff
mov edx, 0x64
call fcn.1400058b0
mov ecx, 0xfffffffd
call fcn.1400058b0
mov ecx, 0xffffffff
mov edx, 0x22
call fcn.1400058b0
mov ecx, 2
mov edx, 0x44
call fcn.1400058b0
xor ecx, ecx
call fcn.1400058b0
mov rcx, qword [rsp + 0x48]
mov dword [rcx], eax
lea rax, [r14 + 0x10]
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x30]
mov rax, qword [rax]
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x50], 0
sete byte [rsp + 0x23]
cmp byte [rsp + 0x23], 0
jne 0x1400055c8
lea rax, [r14 + 0x18]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x58]
mov eax, dword [rax]
mov dword [rsp + 0x24], eax
movzx esi, byte [rsp + 0x23]
mov ecx, 0x95
mov edx, 0x40
call fcn.1400058b0
mov rdi, rax
or edi, dword [rsp + 0x24]
mov edx, dword [rsp + 0x24]
mov ecx, 0xff
call fcn.1400058b0
mov rbx, rax
and ebx, edi
imul ebx, ebx
mov ecx, 0x5e1b
call fcn.1400058b0
mov rdi, rax
imul edi, ebx
mov ecx, 0xe8
call fcn.1400058b0
mov rbx, rax
or ebx, esi
mov edx, dword [rsp + 0x24]
mov ecx, 0xff
call fcn.1400058b0
mov rsi, rax
and esi, ebx
imul esi, esi
mov edx, dword [rsp + 0x24]
mov ecx, 0x6221
call fcn.1400058b0
imul eax, esi
xor ecx, ecx
cmp edi, eax
sete cl
neg ecx
mov eax, dword [rsp + 0x24]
mov rdx, qword [rsp + 0x50]
mov qword [rsp + 0x38], rdx
cmp eax, ecx
jle 0x140005555
lea rax, [r14 + 0x38]
mov qword [rsp + 0x78], rax
lea rax, [r14 + 0x40]
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0x24]
mov dword [rsp + 0x2c], eax
mov qword [rsp + 0x40], 0
movabs r15, 0x7401e7ce6c8e2d39
movabs r12, 0x8bfe18319371d2c8
jmp 0x1400054f1
movsxd rsi, dword [rsp + 0x28]
mov rcx, r15
call fcn.1400058b0
mov rbx, rax
xor ecx, ecx
mov edx, esi
call fcn.1400058b0
mov rdi, rax
add rdi, rbx
xor ecx, ecx
mov edx, esi
call fcn.1400058b0
add rax, rdi
add rax, qword [rsp + 0x70]
add rax, r12
mov dword [rsp + 0x2c], esi
mov qword [rsp + 0x40], rax
cmp rax, rsi
jge 0x140005548
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x2c]
mov rcx, qword [rsp + 0x30]
mov rcx, qword [rcx]
mov rdx, qword [rsp + 0x70]
mov rcx, qword [rcx + rdx*8]
mov qword [rsp + 0x60], rcx
cmp qword [rsp + 0x60], 0
mov dword [rsp + 0x28], eax
je 0x1400054b0
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x80]
mov rdx, qword [rcx]
mov rcx, qword [rsp + 0x60]
call qword [rax]
mov rax, qword [rsp + 0x58]
mov eax, dword [rax]
mov dword [rsp + 0x28], eax
jmp 0x1400054b0
mov rax, qword [rsp + 0x30]
mov rax, qword [rax]
mov qword [rsp + 0x38], rax
mov rdi, qword [rsp + 0x38]
movabs rcx, 0x9827bb2396363ad7
call fcn.1400058b0
mov rsi, rax
mov edx, 0x8fc650
mov r8d, 0x1b
xor ecx, ecx
call fcn.1400058b0
xor rsi, rax
movabs rcx, 0xad0ead00ac738000
mov rdx, rsi
call fcn.1400058b0
mov edx, 0xd2
xor ecx, ecx
mov r8, rsi
call fcn.1400058b0
xor ecx, ecx
mov rdx, rsi
call fcn.1400058b0
mov rsi, rax
mov ecx, 0x8000
call fcn.1400058b0
mov rcx, rdi
mov rdx, rsi
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rax, qword [r14 + 8]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
sete byte [rsp + 0x21]
cmp byte [rsp + 0x21], 0
jne case.default.0x1400056e2
movzx edi, byte [rsp + 0x21]
mov ecx, 0xffffffff
mov edx, 0xd2
call fcn.1400058b0
mov ecx, 0x7afafa69
mov r8d, 0xf6
mov edx, edi
call fcn.1400058b0
mov ecx, 0xa061440
mov edx, edi
mov r8d, edi
call fcn.1400058b0
mov ecx, 0x1050504
mov edx, edi
call fcn.1400058b0
mov ecx, 0x1010104
mov edx, 0xd9
call fcn.1400058b0
mov ecx, 0xb071544
mov edx, edi
call fcn.1400058b0
movabs rcx, 0x6cddcb78c51c7847
mov edx, 0xff
mov r8d, 0x4df3bb
call fcn.1400058b0
xor ecx, ecx
call fcn.1400058b0
movzx eax, byte [rsp + 0x21]
mov ecx, 1
call fcn.1400058b0
movabs rcx, 0xd850a186d8bb8000
mov edx, 0xf6
mov r8d, edi
call fcn.1400058b0
xor ecx, ecx
mov edx, edi
call fcn.1400058b0
xor ecx, ecx
mov edx, edi
call fcn.1400058b0
mov rsi, rax
mov ecx, 0x8000
call fcn.1400058b0
mov rcx, qword [rsp + 0x68]
mov rdx, rsi
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_VirtualFree]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rsi, rax
xor ecx, ecx
call fcn.1400058b0
mov rcx, rsi
mov edx, eax
mov r8, r14
add rsp, 0x88
pop rbx
pop rdi
pop rsi
pop r12
pop r14
pop r15
jmp qword [sym.imp.KERNEL32.dll_HeapFree]