Function at 0x14008f190
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r15
sub rsp, 0xb0
mov rax, qword [0x1402b3030]
xor rax, rsp
mov qword [rsp + 0x90], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x48], r9
mov qword [rsp + 0x70], r8
mov qword [rsp + 0x58], rdx
cmp rax, qword [rcx + 0xc8]
jae 0x14008f1e5
movzx edx, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x14008f208
cmp dword [rcx + 0x30], 0
je 0x14008f206
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f208
xor dl, dl
mov ecx, 0x30
mov r8, rbx
mov qword [rsp + 0xa8], r14
lea rsi, [rcx + rbx]
movzx ecx, dl
mov dword [rsp + 0x38], ecx
mov qword [rsp + 0x80], rsi
cmp rax, qword [rbx + 0xc8]
jae 0x14008f244
movzx r14d, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f26b
cmp dword [rsi], 0
je 0x14008f268
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx r14d, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f26b
xor r14b, r14b
mov byte [rsp + 0x30], r14b
cmp rax, qword [rbx + 0xc8]
jae 0x14008f288
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f2ad
cmp dword [rsi], 0
je 0x14008f2ab
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f2ad
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x40], eax
call fcn.140084470
mov rcx, rbx
movsxd r15, eax
call fcn.140084470
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x14008f2ea
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x14008f30f
cmp dword [rsi], 0
je 0x14008f30d
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f30f
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.140084470
mov rcx, rbx
call fcn.140084470
mov rcx, rbx
call fcn.140084470
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.140084470
mov dword [rsp + 0x44], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14008f359
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f37e
cmp dword [rsi], 0
je 0x14008f37c
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f37e
xor cl, cl
movzx r10d, cl
mov dword [rsp + 0x64], r10d
cmp rax, qword [rbx + 0xc8]
jae 0x14008f39f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f3c9
cmp dword [rsi], 0
je 0x14008f3c7
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
mov r10d, dword [rsp + 0x64]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f3c9
xor cl, cl
mov r8d, dword [rsp + 0x44]
xor ebp, ebp
movzx eax, cl
mov r12d, ebp
mov qword [rsp + 0x78], rbp
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x60], ebp
lea r13d, [rbp + 1]
cmp r8d, 0x1000000
jg 0x14008fbaf
mov r9d, dword [rsp + 0x3c]
cmp r9d, 0x1000000
jg 0x14008fbaf
mov ecx, dword [rsp + 0x40]
cmp ecx, 8
lea edx, [rcx - 8]
cmovb edx, ecx
shr eax, 5
and eax, r13d
mov ecx, r13d
sub ecx, eax
test r14b, r14b
mov dword [rsp + 0x68], ecx
mov r14d, ebp
je 0x14008f44f
mov ecx, edi
sub ecx, 8
je 0x14008f44a
sub ecx, 7
je 0x14008f49d
sub ecx, r13d
je 0x14008f49d
sub ecx, 8
je 0x14008f46e
cmp ecx, 8
jne 0x14008f477
jmp 0x14008f46e
mov edi, r13d
jmp 0x14008f471
mov ecx, r10d
sub ecx, 8
je 0x14008f4a9
sub ecx, 7
je 0x14008f49d
sub ecx, r13d
je 0x14008f48f
sub ecx, 8
je 0x14008f46b
cmp ecx, 8
jne 0x14008f477
mov edi, r10d
shr edi, 3
mov esi, edi
test edi, edi
jne 0x14008f4af
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x14008fbc2
cmp edx, 3
jne 0x14008f49d
mov edi, 2
mov esi, edi
jmp 0x14008f4af
mov edi, 3
mov r14d, r13d
mov esi, edi
jmp 0x14008f4af
mov edi, r13d
mov esi, r13d
mov rax, qword [rsp + 0x58]
mov dword [rax], r9d
mov rax, qword [rsp + 0x70]
mov dword [rax], r8d
mov rax, qword [rsp + 0x48]
test rax, rax
je 0x14008f4cb
mov dword [rax], edi
test r9d, r9d
js 0x14008fbaf
test r8d, r8d
js 0x14008fbaf
je 0x14008f4f1
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14008fbaf
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x14008fbaf
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x14008fbaf
test r8d, r8d
je 0x14008f528
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14008fb9a
mov eax, r8d
imul eax, edi
imul eax, r9d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x48], rax
mov r8, rax
test rax, rax
je 0x14008fb9a
movsxd rdx, dword [rsp + 0x38]
test edx, edx
je 0x14008f590
cmp qword [rbx + 0x10], rbp
je 0x14008f589
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x14008f589
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
mov r8, qword [rsp + 0x48]
jmp 0x14008f590
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0x30], bpl
jne 0x14008f64d
mov edx, dword [rsp + 0x40]
mov r15d, edi
mov dword [rsp + 0x34], r14d
cmp edx, 8
jae 0x14008f7ad
mov dword [rsp + 0x34], r14d
test r14d, r14d
jne 0x14008f7ad
mov r13d, dword [rsp + 0x44]
mov dword [rsp + 0x34], r14d
test r13d, r13d
jle 0x14008f63a
imul r15d, dword [rsp + 0x3c]
cmp dword [rsp + 0x68], ebp
mov ebp, r13d
mov dword [rsp + 0x34], r14d
je 0x14008f619
mov eax, r15d
neg eax
movsxd r12, eax
lea eax, [r13 - 1]
imul eax, edi
imul eax, dword [rsp + 0x3c]
movsxd rsi, eax
add rsi, r8
nop dword [rax + rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400842e0
add rsi, r12
sub rbp, 1
jne 0x14008f600
jmp 0x14008f637
movsxd r12, r15d
mov rsi, r8
nop
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400842e0
add rsi, r12
sub rbp, 1
jne 0x14008f620
mov r15d, edi
mov edx, dword [rsp + 0x3c]
mov r14d, r13d
imul r14d, edx
mov esi, r15d
jmp 0x14008fb2f
cmp dword [rsp + 0x50], ebp
jne 0x14008f674
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_palette
jmp 0x14008fbc2
test r15d, r15d
je 0x14008f6c6
jns 0x14008f68b
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x14008f6c6
cmp qword [rbx + 0x10], rbp
je 0x14008f6bf
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x14008f6bf
mov rax, qword [rbx + 0xc8]
sub r15d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r15d
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
jmp 0x14008f6c6
add qword [rbx + 0xc0], r15
mov r15d, dword [rsp + 0x50]
test r15d, r15d
js 0x14008fb8f
xor edx, edx
imul esi, r15d
mov eax, 0x7fffffff
div edi
cmp r15d, eax
jg 0x14008fb8f
movsxd rcx, esi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x14008fb8f
mov dword [rsp + 0x34], r14d
test r14d, r14d
je 0x14008f826
mov rsi, rax
test r15d, r15d
jle 0x14008f821
mov eax, edi
mov qword [rsp + 0x58], rax
mov dword [rsp + 0x38], edi
mov rcx, rbx
call fcn.140084470
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [rsi], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [rsi + 1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsi + 2], dl
add rsi, rdi
sub r15, r13
jne 0x14008f726
mov r15d, dword [rsp + 0x38]
mov edx, dword [rsp + 0x40]
mov r14d, dword [rsp + 0x44]
mov eax, dword [rsp + 0x3c]
imul r14d, eax
mov esi, r15d
mov dword [rsp + 0x38], r14d
test r14d, r14d
je 0x14008fa9f
mov rax, qword [rsp + 0x48]
lea rcx, [rsp + 0x88]
sub rax, rcx
mov ecx, r14d
mov r14, qword [rsp + 0x80]
mov qword [rsp + 0x58], rcx
mov qword [rsp + 0x70], rax
cmp edx, 8
jb 0x14008f89e
test r12d, r12d
jne 0x14008f88f
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14008f854
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f879
mov r15d, edi
jmp 0x14008f7a9
mov r8d, esi
mov rdx, rax
mov rcx, rbx
mov r15d, edi
call fcn.1400842e0
test eax, eax
jne 0x14008f7a9
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x78]
jmp 0x14008f656
cmp dword [r14], ebp
je 0x14008f877
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008f879
xor cl, cl
movzx eax, cl
mov r12d, eax
and r12d, 0x7f
inc r12d
shr eax, 7
mov dword [rsp + 0x60], eax
jmp 0x14008f89e
cmp dword [rsp + 0x60], ebp
je 0x14008f89e
test r13d, r13d
je 0x14008fa40
cmp byte [rsp + 0x30], bpl
je 0x14008f93a
cmp dword [rsp + 0x64], 8
jne 0x14008f8ff
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14008f8d2
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14008f907
cmp dword [r14], ebp
je 0x14008f8f8
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14008f907
xor cl, cl
movzx eax, cl
jmp 0x14008f907
mov rcx, rbx
call fcn.140084470
test r15d, r15d
je 0x14008fa33
cmp eax, dword [rsp + 0x50]
mov ecx, ebp
mov r8, rsi
cmovl ecx, eax
imul ecx, r15d
movsxd rdx, ecx
lea rcx, [rsp + 0x88]
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14008fa33
cmp dword [rsp + 0x34], ebp
je 0x14008f9c9
mov rcx, rbx
call fcn.140084470
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [rsp + 0x88], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [rsp + 0x89], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x8a], dl
jmp 0x14008fa33
mov rdi, rbp
test r15d, r15d
je 0x14008fa33
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14008f9ff
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008fa24
cmp dword [r14], ebp
je 0x14008fa22
mov rcx, rbx
call fcn.140084260
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14008fa24
xor cl, cl
mov byte [rsp + rdi + 0x88], cl
inc rdi
cmp rdi, rsi
jl 0x14008f9e0
mov rax, qword [rsp + 0x70]
mov r13d, ebp
mov rcx, qword [rsp + 0x58]
mov rdi, rbp
test r15d, r15d
je 0x14008fa75
lea rcx, [rsp + 0x88]
mov r8, rsi
add rcx, rax
lea rdx, [rsp + 0x88]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x14008fa63
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x58]
movsxd rdx, r15d
dec r12d
add rax, rdx
mov edx, dword [rsp + 0x40]
sub rcx, 1
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x58], rcx
jne 0x14008f7f0
mov r14d, dword [rsp + 0x38]
mov eax, dword [rsp + 0x3c]
mov r13d, dword [rsp + 0x44]
cmp dword [rsp + 0x68], ebp
je 0x14008fb18
test r13d, r13d
jle 0x14008fb18
mov rdi, qword [rsp + 0x48]
lea r10d, [r13 - 1]
imul r10d, r15d
mov r11d, r15d
imul r11d, eax
mov ebx, ebp
imul r10d, eax
nop dword [rax]
mov r8d, r11d
test r11d, r11d
jle 0x14008fb0a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + rdi]
nop word [rax + rax]
movzx eax, byte [rdx + r9]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [rdx + r9], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x14008faf0
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, r13d
jl 0x14008fad0
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x14008fb2b
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [rsp + 0x3c]
mov rax, qword [rsp + 0x48]
cmp r15d, 3
jb 0x14008fb6e
cmp dword [rsp + 0x34], 0
jne 0x14008fb6e
mov r8, rax
test r14d, r14d
je 0x14008fb6e
mov r10d, r14d
nop dword [rax]
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, rsi
sub r10, 1
jne 0x14008fb50
mov rax, qword [rsp + 0x48]
cmp r15d, 4
je 0x14008fbcd
mov r9d, edx
mov dword [rsp + 0x20], r13d
mov edx, r15d
mov r8d, 4
mov rcx, rax
call fcn.140084530
jmp 0x14008fbcd
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
jmp 0x14008fbc2
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
mov edx, 0x20
mov qword [rdx + rcx], rax
xor eax, eax
mov r14, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x90]
xor rcx, rsp
call fcn.14014d450
add rsp, 0xb0
pop r15
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret