Function at 0x180022dac
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x38
mov edx, dword [rcx + 0x24]
mov r8d, dword [rcx + 0x54]
mov r10d, dword [rcx + 0x50]
mov ebp, dword [rcx + 0x28]
mov r12d, dword [rcx + 0x2c]
mov rsi, qword [rcx + 0x30]
mov r13, qword [rcx + 0x38]
mov r9d, edx
mov r15d, 0x7fff
and r9d, r15d
xor edi, edi
mov rbx, rcx
mov dword [rsp + 0x90], edx
mov dword [rsp + 0x80], r8d
mov dword [rsp + 0x88], r10d
lea r11d, [rdi + 1]
mov dword [rsp + 0x98], r9d
mov rcx, qword [rbx + 0xb8]
cmp rcx, rdi
jne 0x180022e2b
cmp dword [rbx + 0xa8], edi
je 0x1800232df
cmp ebp, edi
je 0x1800232df
lea r14d, [rbp + rdx]
and r14d, r15d
mov r15d, 0x1000
sub r15d, ebp
cmp rcx, r15
cmovb r15d, ecx
mov eax, r15d
add ebp, r15d
sub rcx, rax
mov qword [rbx + 0xb8], rcx
cmp r15d, edi
je 0x180022efe
mov rdx, qword [rbx + 0xb0]
mov eax, 0x8000
mov ecx, r15d
sub eax, r14d
cmp eax, r15d
cmovb ecx, eax
mov eax, ecx
mov dword [rsp + 0x20], ecx
lea rcx, [r14 + rbx + 0xc8]
mov r8, rax
mov qword [rsp + 0x28], rax
call sub.ntdll.dll_memcpy
mov eax, 0x101
cmp r14d, eax
jae 0x180022ebc
mov ecx, dword [rsp + 0x20]
mov rdx, qword [rbx + 0xb0]
sub eax, r14d
cmp ecx, eax
cmovb eax, ecx
lea rcx, [r14 + rbx + 0x80c8]
mov r8d, eax
call sub.ntdll.dll_memcpy
mov rax, qword [rsp + 0x28]
add qword [rbx + 0xb0], rax
mov eax, dword [rsp + 0x20]
add r14d, eax
and r14d, 0x7fff
sub r15d, eax
jne 0x180022e5c
mov r10d, dword [rsp + 0x88]
mov edx, dword [rsp + 0x90]
mov r9d, dword [rsp + 0x98]
mov r8d, dword [rsp + 0x80]
lea r11d, [r15 + 1]
mov eax, 0x8000
sub eax, ebp
cmp eax, r12d
cmovb r12d, eax
cmp dword [rbx + 0xa8], edi
jne 0x180022f20
cmp ebp, 0x1000
jb 0x1800232df
cmp ebp, 4
jb 0x1800231d4
mov r14d, dword [rsp + 0x80]
mov eax, r9d
mov r8d, r11d
lea r15, [rax + rbx + 0xc8]
mov qword [rsp + 0x88], r15
mov r11d, dword [r15]
and r11d, 0xffffff
mov eax, r11d
shr eax, 0x11
xor eax, r11d
and eax, 0xfff
movzx ecx, word [rbx + rax*2 + 0x292aa]
mov word [rbx + rax*2 + 0x292aa], dx
movzx eax, dx
sub ax, cx
movzx r9d, ax
mov dword [rsp + 0x80], r9d
cmp r9d, r12d
ja 0x1800230d9
and ecx, 0x7fff
lea r9, [rcx + rbx + 0xc8]
mov eax, dword [r9]
and eax, 0xffffff
cmp eax, r11d
jne 0x1800230d9
mov r8, r15
mov r15d, 0x20
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x180023000
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x180023000
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x180023000
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x180023000
add r15d, 0xffffffff
jne 0x180022fb2
mov al, byte [r9]
mov r9d, dword [rsp + 0x80]
mov ecx, edi
mov rdx, r8
sub rdx, qword [rsp + 0x88]
sar rdx, 1
cmp byte [r8], al
sete cl
lea eax, [rcx + rdx*2]
cmp r15d, edi
jne 0x180023035
mov eax, r9d
neg eax
sbb eax, eax
and eax, 0x102
cmp eax, 3
jb 0x1800230c7
jne 0x180023049
cmp r9d, 0x2000
jae 0x1800230c7
cmp eax, ebp
lea r11, [0x180000000]
mov r8d, ebp
cmovb r8d, eax
dec r9d
mov word [rsi + 1], r9w
lea eax, [r8 - 3]
mov edx, r9d
mov byte [rsi], al
mov al, byte [r13]
shr rdx, 8
shr al, 1
add rsi, 3
or al, 0x80
mov byte [r13], al
mov eax, r9d
and eax, 0x1ff
cmp r9d, 0x200
mov r9d, 1
movzx ecx, byte [rax + r11 + 0x33310]
movzx eax, byte [rdx + r11 + 0x33710]
mov edx, dword [rsp + 0x90]
cmovb eax, ecx
add word [rbx + rax*2 + 0x840a], r9w
lea eax, [r8 - 3]
movzx eax, word [r11 + rax*2 + 0x33010]
jmp 0x1800230ed
mov edx, dword [rsp + 0x90]
mov r9d, 1
mov r8d, r9d
jmp 0x1800230df
mov r9d, 1
mov byte [rsi], r11b
add rsi, r9
shr byte [r13], 1
movzx eax, r11b
add word [rbx + rax*2 + 0x81ca], r9w
add r10d, 0xffffffff
mov dword [rsp + 0x88], r10d
jne 0x180023118
mov r10d, 8
mov r13, rsi
add rsi, r9
mov dword [rsp + 0x88], r10d
mov r9d, dword [rsp + 0x98]
lea eax, [r8 + r12]
mov ecx, 0x8000
add r14d, r8d
add edx, r8d
cmp eax, ecx
mov r12d, ecx
lea r15d, [rcx - 1]
mov dword [rsp + 0x80], r14d
cmovb r12d, eax
add r9d, r8d
lea rax, [rbx + 0x192a2]
and r9d, r15d
sub ebp, r8d
mov dword [rsp + 0x90], edx
mov dword [rsp + 0x98], r9d
cmp rsi, rax
jbe 0x1800231c3
mov dword [rbx + 0x24], edx
mov rcx, rbx
xor edx, edx
mov dword [rbx + 0x28], ebp
mov dword [rbx + 0x2c], r12d
mov dword [rbx + 0x54], r14d
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], r13
mov dword [rbx + 0x50], r10d
call fcn.180022844
cmp eax, edi
jne 0x1800232fe
mov r14d, dword [rbx + 0x54]
mov r10d, dword [rbx + 0x50]
mov rsi, qword [rbx + 0x30]
mov r13, qword [rbx + 0x38]
mov edx, dword [rsp + 0x90]
mov r9d, dword [rsp + 0x98]
mov dword [rsp + 0x80], r14d
mov dword [rsp + 0x88], r10d
mov r11d, 1
cmp ebp, 4
jae 0x180022f31
jmp 0x1800231da
mov r15d, 0x7fff
mov r8d, dword [rsp + 0x80]
mov r11d, 1
cmp ebp, edi
je 0x180022e0b
lea r14, [rbx + 0x192a2]
add r8d, r11d
mov eax, r9d
mov cl, byte [rax + rbx + 0xc8]
mov dword [rsp + 0x80], r8d
mov byte [rsi], cl
shr byte [r13], 1
add rsi, r11
add r10d, 0xffffffff
mov dword [rsp + 0x88], r10d
jne 0x180023237
mov r10d, 8
mov r13, rsi
add rsi, r11
mov dword [rsp + 0x88], r10d
add edx, r11d
movzx eax, cl
mov ecx, 0x8000
add word [rbx + rax*2 + 0x81ca], r11w
lea eax, [r12 + 1]
mov r12d, ecx
cmp eax, ecx
inc r9d
mov dword [rsp + 0x90], edx
cmovb r12d, eax
and r9d, r15d
dec ebp
mov dword [rsp + 0x98], r9d
cmp rsi, r14
jbe 0x1800232d2
mov dword [rbx + 0x24], edx
mov rcx, rbx
xor edx, edx
mov dword [rbx + 0x28], ebp
mov dword [rbx + 0x2c], r12d
mov dword [rbx + 0x54], r8d
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], r13
mov dword [rbx + 0x50], r10d
call fcn.180022844
cmp eax, edi
jne 0x1800232fe
mov r8d, dword [rbx + 0x54]
mov r10d, dword [rbx + 0x50]
mov rsi, qword [rbx + 0x30]
mov r13, qword [rbx + 0x38]
mov edx, dword [rsp + 0x90]
mov r9d, dword [rsp + 0x98]
mov dword [rsp + 0x80], r8d
mov dword [rsp + 0x88], r10d
mov r11d, 1
cmp ebp, edi
jne 0x1800231f7
jmp 0x180022e0b
mov dword [rbx + 0x24], edx
mov dword [rbx + 0x28], ebp
mov dword [rbx + 0x2c], r12d
mov dword [rbx + 0x54], r8d
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], r13
mov dword [rbx + 0x50], r10d
mov eax, r11d
jmp 0x180023304
setge dil
mov eax, edi
add rsp, 0x38
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret