Function at 0x140054de0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbp
sub rsp, 0x30
mov qword [rsp + 0x50], rbx
mov rbp, rdx
mov rbx, rcx
mov qword [rsp + 0x58], rsi
mov rcx, qword [rdx + 0x448]
mov qword [rsp + 0x28], rdi
movzx edi, r8b
test rcx, rcx
je 0x140054e13
xor r8d, r8d
call fcn.140055220
mov r8d, dword [rbx + 0x28]
mov ecx, dword [rbx + 0x2c]
cmp r8d, ecx
jne 0x140054e49
inc r8d
test ecx, ecx
je 0x140054e31
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
jmp 0x140054e36
mov eax, 8
cmp eax, r8d
lea rcx, [rbx + 0x28]
cmovg r8d, eax
mov edx, r8d
call fcn.1400585a0
movsxd rcx, dword [rbx + 0x28]
mov rax, qword [rbx + 0x30]
mov qword [rax + rcx*8], rbp
inc dword [rbx + 0x28]
or byte [rbx + 0xb5], 1
mov qword [rbp + 0x448], rbx
mov eax, dword [rbx]
mov dword [rbp + 0x458], eax
cmp dword [rbx + 0x28], 1
movzx eax, byte [rbp + 0x472]
setg cl
and al, 0xfe
or cl, al
and cl, 0xfb
mov byte [rbp + 0x472], cl
cmp qword [rbx + 0x78], 0
jne 0x140054f15
cmp dword [rbx + 0x28], 2
jne 0x140054ec2
mov rax, qword [rbx + 0x30]
mov rcx, qword [rax]
cmp byte [rcx + 0xc0], 0
jne 0x140054ec2
mov byte [rcx + 0xc6], 1
mov rax, qword [rbx + 0x30]
mov rcx, qword [rax]
mov dword [rcx + 0xdc], 1
cmp qword [rbx + 0x78], 0
jne 0x140054f15
cmp qword [rbx + 0x10], 0
jne 0x140054f15
test dword [rbx + 8], 0x400
jne 0x140054f15
mov eax, dword [rbx + 0xb0]
test al, 7
jne 0x140054eef
and eax, 0xfffffffa
or eax, 2
mov dword [rbx + 0xb0], eax
test al, 0x38
jne 0x140054eff
and eax, 0xffffffd7
or eax, 0x10
mov dword [rbx + 0xb0], eax
test eax, 0x1c0
jne 0x140054f15
and eax, 0xfffffebf
bts eax, 7
mov dword [rbx + 0xb0], eax
test dil, dil
je 0x140054f98
cmp qword [rbx + 0x38], 0
jne 0x140054f87
mov rcx, rbx
call fcn.140054d70
mov rcx, qword [rbx + 0x38]
xor edi, edi
mov eax, dword [rbx + 0xa8]
mov dword [rcx + 0x1c], eax
mov rcx, qword [rbx + 0x38]
mov eax, dword [rcx + 0x1c]
mov dword [rcx + 0x18], eax
mov eax, dword [rbx + 0x28]
dec eax
test eax, eax
jle 0x140054f87
mov qword [rsp + 0x20], r14
mov r14d, edi
nop dword [rax]
nop word [rax + rax]
mov r8, qword [rbx + 0x30]
xor edx, edx
mov rcx, qword [rbx + 0x38]
mov r8, qword [r14 + r8]
call fcn.14005d210
mov eax, dword [rbx + 0x28]
lea r14, [r14 + 8]
dec eax
inc edi
cmp edi, eax
jl 0x140054f60
mov r14, qword [rsp + 0x20]
mov rcx, qword [rbx + 0x38]
mov r8, rbp
mov edx, 0x400000
call fcn.14005d210
mov ecx, dword [rbx + 8]
mov eax, ecx
mov rdi, qword [rsp + 0x28]
mov rsi, qword [rsp + 0x58]
shr eax, 0xb
shr ecx, 0xa
cmp qword [rbx + 0x10], 0
movzx eax, al
movzx edx, cl
cmovne edx, eax
cmp dword [rbx + 0x28], 0
setg al
or dl, al
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x140054fd8
test byte [rax + 0xb4], 1
je 0x140054fd8
mov dl, 1
mov rax, qword [rbx + 0x20]
test rax, rax
je 0x140054fee
test byte [rax + 0xb4], 1
je 0x140054fee
mov cl, 1
jmp 0x140054ff0
xor cl, cl
movzx eax, byte [rbx + 0xb4]
or cl, dl
mov r8, qword [rbx + 0x78]
and cl, 1
and al, 0xfe
xor cl, al
mov byte [rbx + 0xb4], cl
mov rbx, qword [rsp + 0x50]
test r8, r8
je 0x140055028
mov edx, dword [rbp + 0xc]
mov rcx, rbp
bts edx, 0x18
add rsp, 0x30
pop rbp
jmp 0x1400578c0
add rsp, 0x30
pop rbp
ret
mov qword [rcx + 0x3e0], r8
lea r9, [rcx + 0x400]
mov qword [r9], rcx
mov qword [rcx + 0x3f8], rcx
mov qword [rcx + 0x3f0], rcx
mov qword [rcx + 0x3e8], rcx
test r8, r8
je 0x140057944
mov eax, edx
and eax, 0x3000000
cmp eax, 0x1000000
jne 0x140057928
test byte [rcx + 0x472], 1
mov rax, qword [r8 + 0x3e8]
mov qword [rcx + 0x3e8], rax
jne 0x140057928
test dword [r8 + 0xc], 0x20000000
jne 0x140057928
mov rax, qword [r8 + 0x3f0]
mov qword [rcx + 0x3f0], rax
bt edx, 0x1b
jb 0x140057944
test edx, 0x5000000
je 0x140057944
mov rax, qword [r8 + 0x3f8]
mov qword [rcx + 0x3f8], rax
test dword [rcx + 0xc], 0x800000
je 0x140057966
nop dword [rax]
mov rax, qword [rcx + 0x3e0]
mov qword [r9], rax
mov rcx, rax
test dword [rax + 0xc], 0x800000
jne 0x140057950
ret