Function at 0x18021ca00
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rdi
sub rsp, 0x20
mov r8, qword [rcx + 0x38]
mov rdi, rcx
mov eax, dword [rcx + 0x60]
mov qword [rsp + 0x30], rbx
add rax, r8
mov rbx, qword [rcx + 8]
mov qword [rsp + 0x40], rsi
mov rsi, rdx
mov qword [rcx + 0x50], rax
cmp rbx, rdx
je 0x18021caf8
mov qword [rsp + 0x38], rbp
mov ebp, 8
nop dword [rax + rax]
movzx eax, byte [rbx]
sub al, 1
mov byte [rbx], al
jne 0x18021cac7
movzx eax, byte [rbx + 1]
xor ecx, ecx
mov edx, dword [rbx + 4]
add rdx, qword [rdi + 0x38]
cmp byte [rdx], 0x40
cmovae ecx, ebp
and al, 0x10
add cl, al
mov byte [rbx + 1], cl
mov eax, dword [rdx]
mov dword [rbx + 2], eax
movzx eax, word [rdx + 4]
mov word [rbx + 6], ax
mov rax, qword [rdi + 0x58]
cmp rdx, rax
je 0x18021cab0
mov dword [rdx], 0xffffffff
mov eax, dword [rdi + 0x128]
mov dword [rdx + 4], eax
movzx eax, byte [rdi + 0x80]
mov dword [rdx + 8], eax
sub edx, dword [rdi + 0x38]
inc dword [rdi + 0x1c0]
mov dword [rdi + 0x128], edx
movzx eax, byte [rbx + 3]
add eax, 0xb
shr eax, 3
mov byte [rbx + 3], al
jmp 0x18021cae0
add rax, 0xc
mov qword [rdi + 0x58], rax
movzx eax, byte [rbx + 3]
add eax, 0xb
shr eax, 3
mov byte [rbx + 3], al
jmp 0x18021cae0
movzx r8d, al
xor r9d, r9d
add r8d, 3
mov rdx, rbx
shr r8d, 1
mov rcx, rdi
call fcn.18021c2c0
mov r8, qword [rdi + 0x38]
mov ebx, dword [rbx + 8]
add rbx, r8
cmp rbx, rsi
jne 0x18021ca40
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
cmp rbx, qword [rdi]
je 0x18021cb57
movzx eax, byte [rbx]
test al, al
jne 0x18021cb19
movzx ecx, byte [rbx + 3]
movzx eax, cl
shr al, 1
sub cl, al
mov byte [rbx + 3], cl
jmp 0x18021cb48
add word [rbx + 2], 4
mov r8d, eax
movzx ecx, word [rbx + 2]
lea eax, [rax*4 + 0x80]
cmp ecx, eax
jbe 0x18021cb48
add r8d, 2
mov r9d, 1
shr r8d, 1
mov rdx, rbx
mov rcx, rdi
call fcn.18021c2c0
mov r8, qword [rdi + 0x38]
mov ebx, dword [rbx + 8]
add rbx, r8
cmp rbx, qword [rdi]
jne 0x18021cb02
cmp dword [rdi + 0x64], 0
mov rbx, qword [rsp + 0x30]
je 0x18021cbcf
mov rcx, rdi
call fcn.18021bb90
mov ecx, dword [rdi + 0x30]
shr ecx, 1
cmp eax, ecx
jb 0x18021cbcf
mov rax, qword [rdi + 8]
cmp dword [rax + 8], 0
je 0x18021cb90
nop dword [rax]
mov eax, dword [rax + 8]
add rax, r8
mov qword [rdi + 8], rax
cmp dword [rax + 8], 0
jne 0x18021cb80
mov rdx, qword [rdi + 8]
xor r8d, r8d
mov rcx, rdi
call fcn.18021b650
mov rcx, rdi
call fcn.18021b9e0
mov rcx, rdi
call fcn.18021bb90
mov ecx, dword [rdi + 0x30]
shr ecx, 2
lea ecx, [rcx + rcx*2]
cmp eax, ecx
ja 0x18021cb90
mov eax, dword [rdi + 0x24]
mov dword [rdi + 0x18], eax
mov dword [rdi + 0x34], 0
add rsp, 0x20
pop rdi
ret
mov rcx, rdi
add rsp, 0x20
pop rdi
jmp fcn.18021c650
push rbx
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x38
xor edi, edi
mov rbx, rcx
mov rcx, qword [rcx + 0x10]
mov r10d, edi
movzx r14d, byte [rcx + 1]
movzx r15d, word [rcx + 4]
movzx eax, word [rcx + 2]
movzx r12d, byte [rcx]
shl r15d, 0x10
or r15d, eax
mov dword [rsp + 0x88], r14d
cmp r14b, 0x1f
jae 0x18021ce83
mov rax, qword [rbx]
mov ecx, dword [rax + 8]
test ecx, ecx
je 0x18021ce83
mov rax, qword [rbx + 0x38]
cmp byte [rax + rcx], dil
lea r8, [rax + rcx]
jne 0x18021ce26
movzx eax, byte [r8 + 3]
lea r10, [r8 + 2]
cmp al, 0x20
jae 0x18021ce83
inc al
mov byte [r10 + 1], al
jmp 0x18021ce83
mov r10d, dword [r8 + 4]
add r10, rax
cmp byte [r10], r12b
je 0x18021ce6e
mov r9, r10
add r10, 6
cmp byte [r10], r12b
jne 0x18021ce32
movzx eax, byte [r10 - 5]
cmp byte [r10 + 1], al
jb 0x18021ce6e
mov eax, dword [r10 - 6]
mov ecx, dword [r10]
movzx edx, word [r10 + 4]
mov dword [r10], eax
movzx eax, word [r10 - 2]
mov word [r10 + 4], ax
mov dword [r10 - 6], ecx
mov word [r10 - 2], dx
mov r10, r9
movzx eax, byte [r10 + 1]
cmp al, 0x73
jae 0x18021ce83
add al, 2
mov byte [r10 + 1], al
add word [r8 + 2], 2
mov rsi, qword [rbx + 8]
cmp dword [rbx + 0x18], edi
jne 0x18021ceeb
test r15d, r15d
je 0x18021ceeb
mov r9, qword [rbx]
mov r8, r10
mov edx, 1
mov rcx, rbx
call fcn.18021b3d0
mov rcx, qword [rbx + 0x10]
mov rdx, rax
test rax, rax
jne 0x18021cecb
mov dword [rcx + 2], edi
mov rdx, rsi
mov rcx, rbx
add rsp, 0x38
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
jmp 0x18021ca00
sub eax, dword [rbx + 0x38]
mov word [rcx + 2], ax
shr eax, 0x10
mov word [rcx + 4], ax
mov qword [rbx + 8], rdx
add rsp, 0x38
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rax, qword [rbx + 0x10]
mov rcx, qword [rbx + 0x50]
movzx eax, byte [rax]
mov byte [rcx], al
inc qword [rbx + 0x50]
mov rax, qword [rbx + 0x50]
mov rcx, qword [rbx + 0x58]
mov r11d, eax
sub r11d, dword [rbx + 0x38]
mov dword [rsp + 0x70], r11d
cmp rax, rcx
jae 0x18021ceb3
test r15d, r15d
jne 0x18021cf36
mov r8, qword [rbx]
mov rdx, r10
mov rcx, rbx
call fcn.18021c130
mov r15, rax
test rax, rax
je 0x18021ceb3
sub r15d, dword [rbx + 0x38]
jmp 0x18021cf61
mov eax, r15d
add rax, qword [rbx + 0x38]
cmp rax, rcx
jae 0x18021cf66
mov r9, qword [rbx]
mov r8, r10
xor edx, edx
mov rcx, rbx
call fcn.18021b3d0
test rax, rax
je 0x18021ceb3
sub eax, dword [rbx + 0x38]
mov r15d, eax
mov r11d, dword [rsp + 0x70]
add dword [rbx + 0x18], 0xffffffff
mov rcx, qword [rbx]
mov qword [rsp + 0x28], r13
jne 0x18021cf8a
cmp qword [rbx + 8], rcx
mov rax, rdi
mov r11d, r15d
mov dword [rsp + 0x70], r15d
setne al
sub qword [rbx + 0x50], rax
movzx r13d, byte [rcx]
mov eax, 8
movzx r9d, word [rcx + 2]
sub r9d, r13d
mov qword [rsp + 0x30], rbp
sub r9d, r14d
cmp r12b, 0x40
mov dword [rsp + 0x78], r9d
cmovae edi, eax
mov dword [rsp + 0x80], edi
cmp rsi, rcx
je 0x18021d262
nop
movzx ebp, byte [rsi]
test ebp, ebp
je 0x18021d0fa
test bpl, 1
je 0x18021d0de
lea edi, [rbp + 1]
shr edi, 1
movzx ecx, byte [rdi + rbx + 0xa6]
lea eax, [rdi - 1]
movzx r14d, byte [rax + rbx + 0xa6]
cmp r14d, ecx
je 0x18021d0cf
lea edx, [r14 + 1]
mov eax, dword [rbx + rdx*4 + 0x128]
test eax, eax
je 0x18021d021
mov r8d, eax
add r8, qword [rbx + 0x38]
mov eax, dword [r8 + 4]
dec dword [rbx + rdx*4 + 0x1c0]
mov dword [rbx + rdx*4 + 0x128], eax
jmp 0x18021d058
movzx eax, byte [rdx + rbx + 0x80]
lea ecx, [rax + rax*2]
mov eax, dword [rbx + 0x48]
sub eax, dword [rbx + 0x40]
shl ecx, 2
cmp ecx, eax
ja 0x18021d048
mov r8, qword [rbx + 0x40]
mov eax, ecx
add rax, r8
mov qword [rbx + 0x40], rax
jmp 0x18021d058
mov rcx, rbx
call fcn.18021b2e0
mov r11d, dword [rsp + 0x70]
mov r8, rax
test r8, r8
je 0x18021d288
mov r9d, dword [rsi + 4]
lea rdx, [r8 + 8]
add r9, qword [rbx + 0x38]
mov rcx, r9
mov eax, dword [rcx]
lea rcx, [rcx + 0xc]
mov dword [rdx - 8], eax
lea rdx, [rdx + 0xc]
mov eax, dword [rcx - 8]
mov dword [rdx - 0x10], eax
mov eax, dword [rcx - 4]
mov dword [rdx - 0xc], eax
add edi, 0xffffffff
jne 0x18021d070
mov dword [r9], 0xffffffff
mov eax, dword [rbx + r14*4 + 0x128]
mov dword [r9 + 4], eax
movzx eax, byte [r14 + rbx + 0x80]
mov dword [r9 + 8], eax
sub r9d, dword [rbx + 0x38]
inc dword [rbx + r14*4 + 0x1c0]
mov dword [rbx + r14*4 + 0x128], r9d
sub r8d, dword [rbx + 0x38]
mov r9d, dword [rsp + 0x78]
mov dword [rsi + 4], r8d
mov r14d, dword [rsp + 0x88]
mov edi, dword [rsp + 0x80]
lea eax, [rbp*2 + 1]
add eax, ebp
cmp eax, r13d
adc word [rsi + 2], 0
movzx edx, word [rsi + 2]
xor ecx, ecx
jmp 0x18021d1a0
mov eax, dword [rbx + 0x128]
test eax, eax
je 0x18021d11b
mov edx, eax
add rdx, qword [rbx + 0x38]
mov eax, dword [rdx + 4]
dec dword [rbx + 0x1c0]
mov dword [rbx + 0x128], eax
jmp 0x18021d158
movzx eax, byte [rbx + 0x80]
lea ecx, [rax + rax*2]
mov eax, dword [rbx + 0x48]
sub eax, dword [rbx + 0x40]
shl ecx, 2
cmp ecx, eax
ja 0x18021d141
mov rdx, qword [rbx + 0x40]
mov eax, ecx
add rax, rdx
mov qword [rbx + 0x40], rax
jmp 0x18021d158
xor edx, edx
mov rcx, rbx
call fcn.18021b2e0
mov r9d, dword [rsp + 0x78]
mov rdx, rax
mov r11d, dword [rsp + 0x70]
test rdx, rdx
je 0x18021d288
mov ecx, dword [rsi + 2]
mov dword [rdx], ecx
movzx ecx, word [rsi + 6]
mov word [rdx + 4], cx
mov ecx, edx
sub ecx, dword [rbx + 0x38]
mov dword [rsi + 4], ecx
movzx eax, byte [rdx + 1]
cmp al, 0x1e
jae 0x18021d182
add al, al
jmp 0x18021d184
mov al, 0x78
mov byte [rdx + 1], al
xor ecx, ecx
cmp r13d, 2
movzx eax, al
mov edx, ecx
seta dl
add dx, word [rbx + 0x1c]
add dx, ax
mov word [rsi + 2], dx
movzx eax, dx
mov r10d, ecx
add r9d, eax
lea r8d, [rax + 6]
imul r8d, r14d
lea eax, [r9 + r9*2]
add eax, eax
add r8d, r8d
cmp r8d, eax
jae 0x18021d1e2
lea eax, [r9*4]
cmp r8d, eax
mov eax, ecx
setae r10b
cmp r8d, r9d
seta al
inc eax
add r10d, eax
mov eax, 4
jmp 0x18021d213
imul eax, r9d, 0xf
cmp r8d, eax
lea eax, [r9 + r9*8]
seta r10b
cmp r8d, eax
lea eax, [r9 + r9*2]
seta cl
shl eax, 2
add ecx, 4
add r10d, ecx
xor ecx, ecx
cmp r8d, eax
seta cl
add r10d, ecx
movzx eax, r10w
mov r9d, dword [rsp + 0x78]
add dx, ax
mov word [rsi + 2], dx
lea rax, [rbp + 1]
lea rcx, [rax + rax*2]
inc bpl
mov eax, dword [rsi + 4]
lea rdx, [rax + rcx*2]
mov eax, r11d
add rdx, qword [rbx + 0x38]
shr eax, 0x10
mov word [rdx + 2], r11w
mov word [rdx + 4], ax
mov byte [rdx], r12b
mov byte [rdx + 1], r10b
or byte [rsi + 1], dil
mov byte [rsi], bpl
mov esi, dword [rsi + 8]
add rsi, qword [rbx + 0x38]
cmp rsi, qword [rbx]
jne 0x18021cfc0
mov edx, r15d
add rdx, qword [rbx + 0x38]
mov qword [rbx], rdx
mov qword [rbx + 8], rdx
mov rbp, qword [rsp + 0x30]
mov r13, qword [rsp + 0x28]
add rsp, 0x38
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rdx, rsi
mov rcx, rbx
call 0x18021ca00
jmp 0x18021d270