Function at 0x140155249
Capabilities:
Encrypt data using rc4 prga

Disassembly:
test rcx, rcx
je 0x140155530
mov r11, rsp
push rbp
push rdi
push r14
lea rbp, [r11 - 0xb88]
sub rsp, 0xc70
mov rax, qword [0x14043b698]
xor rax, rsp
mov qword [rbp + 0xb40], rax
mov qword [r11 + 0x18], rbx
mov r14, rdx
movsxd rbx, dword [rcx + 0x24]
mov rdi, rcx
mov qword [r11 - 0x20], rsi
mov qword [r11 - 0x28], r12
mov qword [r11 - 0x30], r13
mov qword [r11 - 0x38], r15
cmp ebx, 1
je 0x1401552bb
cmp ebx, 2
jne 0x1401552a5
mov eax, dword [rdx]
test eax, eax
jne 0x1401552a5
movzx ecx, byte [rdx + 8]
cmp cl, bl
jb 0x1401552c1
mov ebx, dword [rdx]
xor r12d, r12d
movzx r15d, byte [rdx + 8]
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], rbx
jmp 0x140155327
mov eax, dword [rdx]
movzx ecx, byte [rdx + 8]
movzx r15d, cl
mov r12d, 1
mov esi, eax
lea rcx, [rbp + 0x740]
xor edx, edx
mov qword [rsp + 0x20], rsi
mov r8d, 0x400
mov qword [rsp + 0x28], r12
call fcn.1402d9f70
xor edx, edx
lea rcx, [rsp + 0x70]
mov r8d, 0x3d0
call fcn.1402d9f70
mov eax, dword [r14 + 4]
mov qword [rsp + 0x48], rax
mov eax, dword [rdi + 0x10]
mov qword [rsp + 0x58], rax
mov eax, dword [rdi + 0xc]
mov qword [rsp + 0x68], rbx
mov ebx, esi
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x50], r15
xor esi, esi
test ebx, ebx
jne 0x140155377
test r15b, r15b
jne 0x140155377
lea esi, [rbx + 2]
test r12d, r12d
je 0x140155377
inc qword [rsp + 0x70]
lea r8, [rbp + 0x340]
xor r9d, r9d
lea rdx, [rsp + 0x40]
lea rcx, [rbp + 0x740]
call fcn.140150f00
xor r9d, r9d
lea r8, [rbp + 0x340]
lea rdx, [rbp + 0x340]
lea rcx, [rbp + 0x740]
call fcn.140150f00
mov ecx, dword [rdi + 0x18]
xor edx, edx
mov r8d, dword [rdi + 0x14]
mov r13d, ecx
mov r9d, dword [r14 + 4]
imul r13d, r9d
movzx eax, r15b
imul eax, r8d
add eax, esi
add r13d, eax
mov eax, r13d
div ecx
test edx, edx
jne 0x1401553a8
dec ecx
add ecx, r13d
jmp 0x1401553ac
lea ecx, [r13 - 1]
cmp esi, r8d
jae 0x1401554ee
mov r10, r9
mov qword [rsp + 0x38], r9
nop dword [rax]
mov r15d, dword [rdi + 0x18]
lea r12d, [r13 - 1]
xor edx, edx
mov eax, r13d
div r15d
cmp edx, 1
cmovne r12d, ecx
cmp qword [rsp + 0x28], 0
je 0x14015543a
test sil, 0x7f
jne 0x14015542b
inc qword [rsp + 0x70]
lea r8, [rbp + 0x340]
xor r9d, r9d
lea rdx, [rsp + 0x40]
lea rcx, [rbp + 0x740]
call fcn.140150f00
xor r9d, r9d
lea r8, [rbp + 0x340]
lea rdx, [rbp + 0x340]
lea rcx, [rbp + 0x740]
call fcn.140150f00
mov r10, qword [rsp + 0x38]
mov r15d, dword [rdi + 0x18]
mov eax, esi
and eax, 0x7f
mov r8, qword [rbp + rax*8 + 0x340]
jmp 0x140155448
mov rax, qword [rdi]
mov ecx, r12d
shl rcx, 0xa
mov r8, qword [rcx + rax]
mov ecx, dword [rdi + 0x1c]
xor edx, edx
mov rax, r8
shr rax, 0x20
div rcx
mov qword [rsp + 0x30], rdx
mov rax, rdx
test ebx, ebx
jne 0x140155472
cmp byte [r14 + 8], bl
jne 0x140155472
mov eax, dword [r14 + 4]
mov qword [rsp + 0x30], rax
mov rbx, qword [rdi]
xor r9d, r9d
cmp rax, r10
mov dword [r14 + 0xc], esi
mov rdx, r14
mov rcx, rdi
sete r9b
call fcn.140150270
mov edx, eax
mov eax, r15d
imul rax, qword [rsp + 0x30]
mov r8d, r13d
add rdx, rax
shl r8, 0xa
shl rdx, 0xa
add r8, rbx
add rdx, rbx
mov ecx, r12d
shl rcx, 0xa
add rcx, rbx
mov rbx, qword [rsp + 0x20]
test ebx, ebx
je 0x1401554ce
cmp dword [rdi + 8], 0x10
je 0x1401554ce
mov r9d, 1
jmp 0x1401554d1
xor r9d, r9d
call fcn.140150f00
mov r10, qword [rsp + 0x38]
lea ecx, [r12 + 1]
inc esi
inc r13d
cmp esi, dword [rdi + 0x14]
jb 0x1401553c0
mov r13, qword [rsp + 0xc58]
mov r12, qword [rsp + 0xc60]
mov rsi, qword [rsp + 0xc68]
mov rbx, qword [rsp + 0xca0]
mov r15, qword [rsp + 0xc50]
mov rcx, qword [rbp + 0xb40]
xor rcx, rsp
call fcn.1402bb220
add rsp, 0xc70
pop r14
pop rdi
pop rbp
ret