Function at 0x140099ac0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
mov rax, qword [0x140102340]
xor rax, rsp
mov qword [rsp + 0x88], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x48], r8
mov qword [rsp + 0x68], rdx
cmp rax, qword [rcx + 0xc8]
jae 0x140099b15
movzx edx, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x140099b38
cmp dword [rcx + 0x30], 0
je 0x140099b36
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099b38
xor dl, dl
mov ecx, 0x30
mov r8, rbx
lea rdi, [rcx + rbx]
movzx ecx, dl
mov dword [rsp + 0x58], ecx
cmp rax, qword [rbx + 0xc8]
jae 0x140099b67
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x30], cl
jmp 0x140099b93
cmp dword [rdi], 0
je 0x140099b8e
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x30], cl
jmp 0x140099b93
mov byte [rsp + 0x30], 0
cmp rax, qword [rbx + 0xc8]
jae 0x140099bab
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099bd0
cmp dword [rdi], 0
je 0x140099bce
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099bd0
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x40], eax
mov r14d, eax
call fcn.14008e9c0
mov rcx, rbx
movsxd rsi, eax
call fcn.14008e9c0
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x60], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x140099c10
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x140099c35
cmp dword [rdi], 0
je 0x140099c33
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099c35
xor dl, dl
mov rcx, rbx
movzx r15d, dl
call fcn.14008e9c0
mov rcx, rbx
call fcn.14008e9c0
mov rcx, rbx
call fcn.14008e9c0
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.14008e9c0
mov dword [rsp + 0x38], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140099c80
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099ca5
cmp dword [rdi], 0
je 0x140099ca3
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099ca5
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x70], edx
cmp rax, qword [rbx + 0xc8]
jae 0x140099cc4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099ced
cmp dword [rdi], 0
je 0x140099ceb
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
mov edx, dword [rsp + 0x70]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140099ced
xor cl, cl
mov r8d, dword [rsp + 0x38]
xor ebp, ebp
movzx eax, cl
mov r12d, ebp
mov qword [rsp + 0x78], rbp
mov edi, ebp
mov dword [rsp + 0x80], ebp
mov r13d, 1
mov dword [rsp + 0x50], ebp
cmp r8d, 0x1000000
jg 0x14009a4d2
mov r9d, dword [rsp + 0x3c]
cmp r9d, 0x1000000
jg 0x14009a4d2
cmp r14d, 8
jb 0x140099d3b
sub r14d, 8
shr eax, 5
mov ecx, r13d
and eax, r13d
mov dword [rsp + 0x34], ebp
sub ecx, eax
mov dword [rsp + 0x74], ecx
cmp byte [rsp + 0x30], dil
je 0x140099d76
mov ecx, r15d
sub ecx, 8
je 0x140099dba
sub ecx, 7
je 0x140099dad
sub ecx, r13d
je 0x140099dad
sub ecx, 8
je 0x140099d99
cmp ecx, 8
je 0x140099d99
mov r15d, ebp
jmp 0x140099dbd
mov ecx, edx
sub ecx, 8
je 0x140099dba
sub ecx, 7
je 0x140099dad
sub ecx, r13d
je 0x140099d9f
sub ecx, 8
je 0x140099d96
cmp ecx, 8
je 0x140099d96
mov r15d, ebp
jmp 0x140099dbd
mov r15d, edx
shr r15d, 3
jmp 0x140099dbd
cmp r14d, 3
jne 0x140099dad
mov r15d, 2
jmp 0x140099dbd
mov r15d, 3
mov dword [rsp + 0x34], r13d
jmp 0x140099dbd
mov r15d, r13d
test r15d, r15d
jne 0x140099dda
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x14009a4e5
mov rax, qword [rsp + 0x68]
mov dword [rax], r9d
mov rax, qword [rsp + 0x48]
mov dword [rax], r8d
test r9d, r9d
js 0x14009a4d2
test r8d, r8d
js 0x14009a4d2
je 0x140099e10
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14009a4d2
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x14009a4d2
xor edx, edx
mov eax, 0x7fffffff
div r15d
cmp ecx, eax
jg 0x14009a4d2
test r8d, r8d
je 0x140099e48
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14009a4bd
mov eax, r8d
imul eax, r15d
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 r9, rax
test rax, rax
je 0x14009a4bd
movsxd rdx, dword [rsp + 0x58]
test edx, edx
je 0x140099eb1
cmp qword [rbx + 0x10], rdi
je 0x140099eaa
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x140099eaa
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r9, qword [rsp + 0x48]
jmp 0x140099eb1
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0x30], dil
jne 0x140099f70
mov edx, dword [rsp + 0x40]
mov r14, r9
mov qword [rsp + 0x58], r9
cmp edx, 8
jae 0x14009a0ee
mov eax, dword [rsp + 0x34]
mov qword [rsp + 0x58], r9
test eax, eax
jne 0x14009a0ee
mov esi, dword [rsp + 0x38]
mov r12, r9
mov r13d, dword [rsp + 0x3c]
test esi, esi
jle 0x14009a448
mov ebp, r13d
mov edi, esi
imul ebp, r15d
cmp dword [rsp + 0x74], eax
je 0x140099f40
mov eax, ebp
neg eax
movsxd r14, eax
lea eax, [rsi - 1]
imul eax, r15d
imul eax, r13d
movsxd rsi, eax
add rsi, r9
nop dword [rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.14008e830
add rsi, r14
sub rdi, 1
jne 0x140099f20
mov esi, dword [rsp + 0x38]
jmp 0x14009a43f
movsxd r14, ebp
mov rsi, r9
nop word [rax + rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.14008e830
add rsi, r14
sub rdi, 1
jne 0x140099f50
mov esi, dword [rsp + 0x38]
jmp 0x14009a43f
mov r8d, dword [rsp + 0x60]
test r8d, r8d
jne 0x140099f9b
mov rcx, r9
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 0x14009a4e5
test esi, esi
je 0x140099fee
jns 0x140099fb1
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x140099fee
cmp qword [rbx + 0x10], rdi
je 0x140099fe7
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, esi
jge 0x140099fe7
mov rax, qword [rbx + 0xc8]
sub esi, ecx
mov rcx, qword [rbx + 0x28]
mov edx, esi
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r8d, dword [rsp + 0x60]
jmp 0x140099fee
add qword [rbx + 0xc0], rsi
test r8d, r8d
js 0x14009a4af
xor edx, edx
mov eax, 0x7fffffff
div r15d
cmp r8d, eax
jg 0x14009a4af
mov rsi, qword [rsp + 0x48]
mov edi, r15d
imul edi, r8d
mov r14, rsi
mov qword [rsp + 0x58], rsi
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x14009a4b4
cmp dword [rsp + 0x34], ebp
je 0x14009a152
mov rdi, rax
mov eax, dword [rsp + 0x60]
test eax, eax
jle 0x14009a146
mov esi, eax
mov r14d, r15d
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x58], rax
mov rcx, rax
mov qword [rsp + 0x48], rax
mov rcx, rbx
call fcn.14008e9c0
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 [rdi], 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 [rdi + 1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rdi + 2], dl
add rdi, r14
sub rsi, r13
jne 0x14009a065
mov r14, qword [rsp + 0x58]
mov edx, dword [rsp + 0x40]
mov edi, ebp
mov eax, dword [rsp + 0x38]
imul eax, dword [rsp + 0x3c]
mov esi, r15d
test eax, eax
je 0x14009a3b3
lea r8, [rsp + 0x80]
mov ecx, r15d
mov qword [rsp + 0x68], rax
sub r14, r8
cmp edx, 8
jb 0x14009a1c8
test r12d, r12d
jne 0x14009a1bb
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14009a180
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14009a1a5
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x48], rsi
jmp 0x14009a0e8
mov r8d, edi
mov qword [rsp + 0x48], rsi
mov rdx, rax
mov rcx, rbx
call fcn.14008e830
test eax, eax
jne 0x14009a0e8
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x78]
jmp 0x140099f7d
cmp dword [rbx + 0x30], ebp
je 0x14009a1a3
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14009a1a5
xor cl, cl
movzx edi, cl
mov r12d, edi
and r12d, 0x7f
inc r12d
shr edi, 7
mov dword [rsp + 0x50], edi
jmp 0x14009a1c8
test edi, edi
je 0x14009a1c8
test r13d, r13d
je 0x14009a35e
cmp byte [rsp + 0x30], bpl
je 0x14009a264
cmp dword [rsp + 0x70], 8
jne 0x14009a229
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14009a1fc
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14009a231
cmp dword [rbx + 0x30], ebp
je 0x14009a222
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14009a231
xor cl, cl
movzx eax, cl
jmp 0x14009a231
mov rcx, rbx
call fcn.14008e9c0
test r15d, r15d
je 0x14009a353
cmp eax, dword [rsp + 0x60]
mov ecx, ebp
mov r8, rsi
cmovl ecx, eax
imul ecx, r15d
movsxd rdx, ecx
lea rcx, [rsp + 0x80]
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14009a353
cmp dword [rsp + 0x34], ebp
je 0x14009a2f3
mov rcx, rbx
call fcn.14008e9c0
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 + 0x80], 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 + 0x81], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x82], dl
jmp 0x14009a353
mov rdi, rbp
test r15d, r15d
je 0x14009a353
nop dword [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14009a31f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14009a344
cmp dword [rbx + 0x30], ebp
je 0x14009a342
mov rcx, rbx
call fcn.14008e7b0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14009a344
xor cl, cl
mov byte [rsp + rdi + 0x80], cl
inc rdi
cmp rdi, rsi
jl 0x14009a300
mov rax, qword [rsp + 0x68]
mov r13d, ebp
mov ecx, r15d
mov rdi, rbp
test r15d, r15d
je 0x14009a391
lea rcx, [rsp + 0x80]
mov r8, rsi
add rcx, r14
lea rdx, [rsp + 0x80]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x14009a381
mov rax, qword [rsp + 0x68]
mov ecx, r15d
mov edi, dword [rsp + 0x50]
dec r12d
mov edx, dword [rsp + 0x40]
add r14, rcx
sub rax, 1
mov qword [rsp + 0x68], rax
jne 0x14009a115
mov r14, qword [rsp + 0x58]
mov esi, dword [rsp + 0x38]
mov r13d, dword [rsp + 0x3c]
cmp dword [rsp + 0x74], ebp
je 0x14009a427
test esi, esi
jle 0x14009a427
lea r10d, [rsi - 1]
mov r11d, r15d
imul r10d, r15d
mov ebx, ebp
imul r11d, r13d
imul r10d, r13d
nop dword [rax + rax]
mov r8d, r11d
test r11d, r11d
jle 0x14009a41a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r14]
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 0x14009a400
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, esi
jl 0x14009a3e0
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x14009a43a
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r12, qword [rsp + 0x58]
mov eax, dword [rsp + 0x34]
mov r9, qword [rsp + 0x48]
cmp r15d, 3
jb 0x14009a489
test eax, eax
jne 0x14009a489
mov eax, esi
mov r8, r12
imul eax, r13d
test eax, eax
je 0x14009a489
mov r11d, r15d
mov r10d, eax
nop word [rax + rax]
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, r11
sub r10, 1
jne 0x14009a470
cmp r15d, 4
je 0x14009a4aa
mov r9d, r13d
mov dword [rsp + 0x20], esi
mov r8d, 4
mov edx, r15d
mov rcx, r12
call fcn.14008ea80
mov r9, rax
mov rax, r9
jmp 0x14009a4f0
mov r14, qword [rsp + 0x48]
mov rcx, r14
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 0x14009a4e5
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
mov edx, 0x28
mov qword [rdx + rcx], rax
xor eax, eax
mov rcx, qword [rsp + 0x88]
xor rcx, rsp
call fcn.1400d02b0
mov rbx, qword [rsp + 0xe8]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret