Function at 0x140020af0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rdi
push r12
push r15
sub rsp, 0x180
mov rax, qword [0x1400ed0c0]
xor rax, rsp
mov qword [rsp + 0x150], rax
mov rax, qword [rcx]
xor r15d, r15d
mov qword [rsp + 0x68], r8
mov rdi, rcx
mov qword [rsp + 0x60], rdx
mov qword [rsp + 0x50], rcx
mov dword [rax + 8], r15d
call fcn.14001ff60
test eax, eax
je 0x14002102e
mov rax, qword [rdi]
mov ecx, dword [rax + 8]
cmp ecx, 3
jne 0x140020b6a
cmp dword [rdi + 0x4850], ecx
je 0x140020b5d
cmp dword [rdi + 0x484c], r15d
jne 0x140020b6a
cmp dword [rdi + 0x4848], r15d
jne 0x140020b6a
mov r12d, 1
mov qword [rsp + 0x38], r12
jmp 0x140020b7a
mov qword [rsp + 0x38], r15
mov r12, r15
test ecx, ecx
jle 0x14002102e
mov qword [rsp + 0x1b8], rbx
xorps xmm0, xmm0
mov qword [rsp + 0x178], rbp
xorps xmm1, xmm1
mov qword [rsp + 0x170], rsi
mov qword [rsp + 0x160], r14
mov r14, rcx
mov qword [rsp + 0x40], rcx
movdqu xmmword [rsp + 0x70], xmm0
movdqu xmmword [rsp + 0x80], xmm1
test ecx, ecx
je 0x140020c98
mov rbp, r15
lea rbx, [rsp + 0xac]
lea rsi, [rdi + 0x46a4]
mov rax, qword [rdi]
mov ecx, dword [rax]
add ecx, 3
call fcn.14001b7a0
mov qword [rsi + 0x44], rax
test rax, rax
je 0x140020cbe
mov eax, dword [rdi + 0x4688]
cdq
mov dword [rbx + 0xc], r15d
idiv dword [rsi]
mov r9d, eax
mov dword [rbx - 4], eax
mov eax, dword [rdi + 0x468c]
cdq
idiv dword [rsi + 4]
xor edx, edx
mov ecx, eax
mov dword [rbx], eax
sar ecx, 1
mov r8d, eax
mov dword [rbx + 8], ecx
mov rcx, qword [rdi]
mov eax, dword [rcx]
mov rcx, qword [rsi + 0x2c]
dec eax
add eax, r9d
mov qword [rbx - 0xc], rcx
div r9d
mov qword [rbx - 0x14], rcx
mov dword [rbx + 4], eax
cmp r9d, 1
jne 0x140020c55
cmp r8d, r9d
jne 0x140020c46
lea rax, [fcn.140001ef0]
jmp 0x140020c80
cmp r8d, 2
jne 0x140020c55
lea rax, [0x1400200d0]
jmp 0x140020c80
cmp r9d, 2
jne 0x140020c79
cmp r8d, 1
jne 0x140020c6a
lea rax, [0x1400202a0]
jmp 0x140020c80
cmp r8d, 2
jne 0x140020c79
mov rax, qword [rdi + 0x4880]
jmp 0x140020c80
lea rax, [0x140020650]
mov qword [rbx - 0x1c], rax
inc rbp
add rbx, 0x30
add rsi, 0x60
cmp rbp, r14
jl 0x140020bd1
mov rdx, qword [rdi]
mov r9d, 1
mov ecx, 4
mov r8d, dword [rdx + 4]
mov edx, dword [rdx]
call fcn.14001b970
mov qword [rsp + 0x48], rax
mov rdx, rax
test rax, rax
jne 0x140020d11
mov rcx, rdi
call fcn.140020ac0
lea rcx, str.outofmem
call fcn.14001b780
xor eax, eax
mov rsi, qword [rsp + 0x170]
mov rbp, qword [rsp + 0x178]
mov rbx, qword [rsp + 0x1b8]
mov r14, qword [rsp + 0x160]
mov rcx, qword [rsp + 0x150]
xor rcx, rsp
call fcn.14006ca90
add rsp, 0x180
pop r15
pop r12
pop rdi
ret
mov rcx, qword [rdi]
xor eax, eax
mov dword [rsp + 0x30], eax
cmp dword [rcx + 4], eax
jbe 0x140021003
mov r15, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x80]
mov r14, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x70]
mov qword [rsp + 0x168], r13
nop word [rax + rax]
imul eax, dword [rcx]
xor ebp, ebp
shl eax, 2
mov r13d, eax
add r13, rdx
mov qword [rsp + 0x58], r13
cmp qword [rsp + 0x40], rbp
jbe 0x140020e38
mov r13, qword [rsp + 0x40]
lea rsi, [rdi + 0x46c0]
mov rdi, qword [rsp + 0x38]
lea rbx, [rsp + 0xb4]
nop word [rax + rax]
mov eax, dword [rbx - 8]
lea r14, [rbx - 0x14]
mov r9d, dword [rbx - 0xc]
lea r15, [rbx - 0x1c]
sar eax, 1
mov r12, r14
cmp dword [rbx], eax
jl 0x140020db0
mov r8, qword [r15]
mov rdx, r14
jmp 0x140020db6
mov r8, qword [r14]
mov rdx, r15
mov rdx, qword [rdx]
mov rcx, qword [rsi + 0x28]
mov dword [rsp + 0x20], r9d
mov r9d, dword [rbx - 4]
call qword [rbx - 0x24]
mov qword [rsp + rbp*8 + 0x70], rax
mov eax, dword [rbx]
inc eax
mov dword [rbx], eax
cmp eax, dword [rbx - 8]
jl 0x140020dfa
inc dword [rbx + 4]
mov eax, dword [rbx + 4]
mov rcx, qword [r12]
mov dword [rbx], 0
mov qword [r15], rcx
cmp eax, dword [rsi]
jge 0x140020dfa
movsxd rax, dword [rsi + 4]
add rax, rcx
mov qword [r14], rax
inc rbp
add rbx, 0x30
add rsi, 0x60
cmp rbp, r13
jl 0x140020d90
mov r15, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x80]
mov r14, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x70]
mov r13, qword [rsp + 0x58]
mov qword [rsp + 0x38], rdi
mov r12, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x50]
mov rax, qword [rdi]
mov ecx, dword [rax + 8]
cmp ecx, 3
jne 0x140020eb5
test r12, r12
je 0x140020e90
xor r8d, r8d
cmp dword [rax], r8d
jbe 0x140020fe0
lea rdx, [r13 + 2]
nop dword [rax + rax]
movzx eax, byte [r8 + rbx]
mov byte [rdx - 2], al
lea rdx, [rdx + 4]
movzx eax, byte [r8 + r14]
mov byte [rdx - 5], al
movzx eax, byte [r8 + rsi]
inc r8d
mov byte [rdx - 4], al
mov byte [rdx - 3], 0xff
mov rax, qword [rdi]
cmp r8d, dword [rax]
jb 0x140020e60
jmp 0x140020fe0
mov eax, dword [rax]
mov r9, rsi
mov dword [rsp + 0x28], 4
mov r8, r14
mov rdx, rbx
mov dword [rsp + 0x20], eax
mov rcx, r13
call qword [rdi + 0x4878]
jmp 0x140020fe0
cmp ecx, 4
jne 0x140020faa
mov ecx, dword [rdi + 0x484c]
test ecx, ecx
jne 0x140020f27
xor r11d, r11d
cmp dword [rax], r11d
jbe 0x140020fe0
lea r10, [r13 + 2]
nop dword [rax + rax]
movzx edx, byte [r11 + r15]
movzx ecx, byte [r11 + rbx]
call fcn.140020ad0
mov byte [r10 - 2], al
movzx ecx, byte [r11 + r14]
call fcn.140020ad0
mov byte [r10 - 1], al
movzx ecx, byte [r11 + rsi]
call fcn.140020ad0
mov byte [r10], al
inc r11d
mov byte [r10 + 1], 0xff
lea r10, [r10 + 4]
mov rax, qword [rdi]
cmp r11d, dword [rax]
jb 0x140020ee0
jmp 0x140020fe0
mov edx, dword [rax]
cmp ecx, 2
mov rax, qword [rdi + 0x4878]
mov r9, rsi
mov dword [rsp + 0x28], 4
mov r8, r14
mov dword [rsp + 0x20], edx
mov rcx, r13
mov rdx, rbx
jne 0x140020fa6
call rax
mov rax, qword [rdi]
xor r10d, r10d
cmp dword [rax], r10d
jbe 0x140020fe0
lea r9, [r13 + 2]
movzx ecx, byte [r9 - 2]
movzx edx, byte [r10 + r15]
not cl
call fcn.140020ad0
movzx ecx, byte [r9 - 1]
not cl
mov byte [r9 - 2], al
call fcn.140020ad0
movzx ecx, byte [r9]
not cl
mov byte [r9 - 1], al
call fcn.140020ad0
mov byte [r9], al
lea r9, [r9 + 4]
mov rax, qword [rdi]
inc r10d
cmp r10d, dword [rax]
jb 0x140020f62
jmp 0x140020fe0
call rax
jmp 0x140020fe0
xor r8d, r8d
cmp dword [rax], r8d
jbe 0x140020fe0
lea rdx, [r13 + 1]
nop word [rax + rax]
movzx ecx, byte [r8 + rbx]
inc r8d
mov byte [rdx + 1], cl
mov byte [rdx], cl
mov byte [rdx - 1], cl
mov byte [rdx + 2], 0xff
lea rdx, [rdx + 4]
mov rax, qword [rdi]
cmp r8d, dword [rax]
jb 0x140020fc0
mov eax, dword [rsp + 0x30]
mov rcx, qword [rdi]
inc eax
mov rdx, qword [rsp + 0x48]
mov dword [rsp + 0x30], eax
cmp eax, dword [rcx + 4]
jb 0x140020d50
mov r13, qword [rsp + 0x168]
mov rcx, rdi
call fcn.140020ac0
mov rax, qword [rdi]
mov ecx, dword [rax]
mov rax, qword [rsp + 0x60]
mov dword [rax], ecx
mov rax, qword [rdi]
mov ecx, dword [rax + 4]
mov rax, qword [rsp + 0x68]
mov dword [rax], ecx
mov rax, qword [rsp + 0x48]
jmp 0x140020cd4
mov rcx, rdi
call fcn.140020ac0
xor eax, eax
jmp 0x140020cf4