Function at 0x140055250
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 0x140055283
xor r8d, r8d
call fcn.140055690
mov r8d, dword [rbx + 0x28]
mov ecx, dword [rbx + 0x2c]
cmp r8d, ecx
jne 0x1400552b9
inc r8d
test ecx, ecx
je 0x1400552a1
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
add eax, ecx
jmp 0x1400552a6
mov eax, 8
cmp eax, r8d
lea rcx, [rbx + 0x28]
cmovg r8d, eax
mov edx, r8d
call fcn.140058a10
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 0x140055385
cmp dword [rbx + 0x28], 2
jne 0x140055332
mov rax, qword [rbx + 0x30]
mov rcx, qword [rax]
cmp byte [rcx + 0xc0], 0
jne 0x140055332
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 0x140055385
cmp qword [rbx + 0x10], 0
jne 0x140055385
test dword [rbx + 8], 0x400
jne 0x140055385
mov eax, dword [rbx + 0xb0]
test al, 7
jne 0x14005535f
and eax, 0xfffffffa
or eax, 2
mov dword [rbx + 0xb0], eax
test al, 0x38
jne 0x14005536f
and eax, 0xffffffd7
or eax, 0x10
mov dword [rbx + 0xb0], eax
test eax, 0x1c0
jne 0x140055385
and eax, 0xfffffebf
bts eax, 7
mov dword [rbx + 0xb0], eax
test dil, dil
je 0x140055408
cmp qword [rbx + 0x38], 0
jne 0x1400553f7
mov rcx, rbx
call fcn.1400551e0
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 0x1400553f7
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.14005d680
mov eax, dword [rbx + 0x28]
lea r14, [r14 + 8]
dec eax
inc edi
cmp edi, eax
jl 0x1400553d0
mov r14, qword [rsp + 0x20]
mov rcx, qword [rbx + 0x38]
mov r8, rbp
mov edx, 0x400000
call fcn.14005d680
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 0x140055448
test byte [rax + 0xb4], 1
je 0x140055448
mov dl, 1
mov rax, qword [rbx + 0x20]
test rax, rax
je 0x14005545e
test byte [rax + 0xb4], 1
je 0x14005545e
mov cl, 1
jmp 0x140055460
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 0x140055498
mov edx, dword [rbp + 0xc]
mov rcx, rbp
bts edx, 0x18
add rsp, 0x30
pop rbp
jmp 0x140057d30
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 0x140057db4
mov eax, edx
and eax, 0x3000000
cmp eax, 0x1000000
jne 0x140057d98
test byte [rcx + 0x472], 1
mov rax, qword [r8 + 0x3e8]
mov qword [rcx + 0x3e8], rax
jne 0x140057d98
test dword [r8 + 0xc], 0x20000000
jne 0x140057d98
mov rax, qword [r8 + 0x3f0]
mov qword [rcx + 0x3f0], rax
bt edx, 0x1b
jb 0x140057db4
test edx, 0x5000000
je 0x140057db4
mov rax, qword [r8 + 0x3f8]
mov qword [rcx + 0x3f8], rax
test dword [rcx + 0xc], 0x800000
je 0x140057dd6
nop dword [rax]
mov rax, qword [rcx + 0x3e0]
mov qword [r9], rax
mov rcx, rax
test dword [rax + 0xc], 0x800000
jne 0x140057dc0
ret