Function at 0x140029f84
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, 0xcb8
mov rax, qword [0x14006c080]
xor rax, rsp
mov qword [rsp + 0xca0], rax
mov eax, dword [rcx + 0x8a0]
mov esi, r9d
mov ebp, dword [rsp + 0xd20]
mov r14d, r8d
mov r15d, edx
mov rdi, rcx
lea eax, [rax*8 + 0x100]
movsxd rbx, eax
cmp rbx, 0x320
jb 0x140029fdd
xor eax, eax
jmp 0x14002a244
add rbx, rbx
lea rcx, [rsp + 0x20]
mov r8, rbx
xor edx, edx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov r8, rbx
lea rcx, [rsp + 0x660]
xor edx, edx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov rbx, qword [rdi + 0x50]
mov r13d, 0x400
mov r10, qword [rdi + 0x48]
mov r11d, r13d
mov r12d, 1
mov r8d, r15d
mov ecx, r15d
and ecx, 7
mov edx, r12d
shl edx, cl
mov r9b, byte [r10 + r8]
shr r8, 3
test byte [r8 + rbx], dl
jne 0x14002a03d
movzx ecx, r9b
jmp 0x14002a0ca
mov rax, qword [rdi + 0x40]
mov ecx, esi
mov edx, dword [rax + rcx*4]
cmp r9b, 7
jae 0x14002a08c
cmp edx, r13d
jae 0x14002a05b
movzx ecx, byte [rdx + rdi + 0x47c]
jmp 0x14002a080
cmp edx, 0x80000
jae 0x14002a077
mov rax, rdx
shr rax, 9
movzx ecx, byte [rax + rdi + 0x47c]
add ecx, 0x12
jmp 0x14002a080
shr edx, 0x11
movzx ecx, dl
add ecx, 0x22
movzx eax, r9b
lea ecx, [rcx + 0x20]
lea ecx, [rax + rcx*8]
jmp 0x14002a0c7
cmp edx, r13d
jae 0x14002a09b
movzx ecx, byte [rdx + rdi + 0x47c]
jmp 0x14002a0c0
cmp edx, 0x80000
jae 0x14002a0b7
mov rax, rdx
shr rax, 9
movzx ecx, byte [rax + rdi + 0x47c]
add ecx, 0x12
jmp 0x14002a0c0
shr edx, 0x11
movzx ecx, dl
add ecx, 0x22
lea ecx, [rcx*8 + 0x107]
add esi, r12d
movsxd rax, ecx
mov edx, r12d
mov ecx, r14d
mov r9d, r14d
and ecx, 7
add r15d, r12d
shl edx, cl
add word [rsp + rax*2 + 0x20], r12w
mov r8b, byte [r10 + r9]
mov eax, r14d
shr rax, 3
test byte [rax + rbx], dl
jne 0x14002a0fd
movzx ecx, r8b
jmp 0x14002a18b
mov rax, qword [rdi + 0x40]
mov ecx, ebp
mov edx, dword [rax + rcx*4]
cmp r8b, 7
jae 0x14002a14d
cmp edx, r13d
jae 0x14002a11b
movzx ecx, byte [rdx + rdi + 0x47c]
jmp 0x14002a140
cmp edx, 0x80000
jae 0x14002a137
mov rax, rdx
shr rax, 9
movzx ecx, byte [rax + rdi + 0x47c]
add ecx, 0x12
jmp 0x14002a140
shr edx, 0x11
movzx ecx, dl
add ecx, 0x22
movzx eax, byte [r9 + r10]
lea ecx, [rcx + 0x20]
lea ecx, [rax + rcx*8]
jmp 0x14002a188
cmp edx, r13d
jae 0x14002a15c
movzx ecx, byte [rdx + rdi + 0x47c]
jmp 0x14002a181
cmp edx, 0x80000
jae 0x14002a178
mov rax, rdx
shr rax, 9
movzx ecx, byte [rax + rdi + 0x47c]
add ecx, 0x12
jmp 0x14002a181
shr edx, 0x11
movzx ecx, dl
add ecx, 0x22
lea ecx, [rcx*8 + 0x107]
add ebp, r12d
movsxd rax, ecx
add r14d, r12d
add word [rsp + rax*2 + 0x660], r12w
sub r11, r12
jne 0x14002a018
mov eax, dword [rdi + 0x8a0]
xor r8d, r8d
lea eax, [rax*8 + 0x100]
test eax, eax
je 0x14002a241
mov r9d, r8d
mov r10d, eax
mov ebx, 0x100
lea r11, [0x140000000]
movzx eax, word [rsp + r9 + 0x20]
cmp ax, bx
jae 0x14002a1e3
movzx edx, byte [rax + r11 + 0x60320]
jmp 0x14002a1f4
shr rax, 8
movzx edx, byte [rax + r11 + 0x60320]
add rdx, 8
movzx eax, word [rsp + r9 + 0x660]
cmp ax, bx
jae 0x14002a20d
movzx ecx, byte [rax + r11 + 0x60320]
jmp 0x14002a21e
shr rax, 8
movzx ecx, byte [rax + r11 + 0x60320]
add rcx, 8
mov eax, dword [r11 + rdx*4 + 0x602d0]
add r9, 2
mov ecx, dword [r11 + rcx*4 + 0x602d0]
sub eax, ecx
cdq
xor eax, edx
sub eax, edx
add r8d, eax
sub r10, r12
jne 0x14002a1cd
mov eax, r8d
mov rcx, qword [rsp + 0xca0]
xor rcx, rsp
call fcn.1400582e0
add rsp, 0xcb8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret