Function at 0x14000ec70
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x98
mov rax, qword [0x1400c8280]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x70], r8
mov qword [rsp + 0x60], rdx
cmp rax, qword [rcx + 0xc8]
jae 0x14000ecc7
movzx edx, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x14000ecea
cmp dword [rcx + 0x30], 0
je 0x14000ece8
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ecea
xor dl, dl
mov ecx, 0x30
mov r8, rbx
lea rdi, [rcx + rbx]
movzx ecx, dl
mov dword [rsp + 0x38], ecx
cmp rax, qword [rbx + 0xc8]
jae 0x14000ed19
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x20], cl
jmp 0x14000ed45
cmp dword [rdi], 0
je 0x14000ed40
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x20], cl
jmp 0x14000ed45
mov byte [rsp + 0x20], 0
cmp rax, qword [rbx + 0xc8]
jae 0x14000ed5d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ed82
cmp dword [rdi], 0
je 0x14000ed80
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ed82
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x2c], eax
mov esi, eax
call fcn.140003ca0
mov rcx, rbx
movsxd r15, eax
call fcn.140003ca0
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x40], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x14000edc1
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x14000ede6
cmp dword [rdi], 0
je 0x14000ede4
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ede6
xor dl, dl
mov rcx, rbx
movzx r12d, dl
call fcn.140003ca0
mov rcx, rbx
call fcn.140003ca0
mov rcx, rbx
call fcn.140003ca0
mov rcx, rbx
mov dword [rsp + 0x30], eax
call fcn.140003ca0
mov dword [rsp + 0x28], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000ee31
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee56
cmp dword [rdi], 0
je 0x14000ee54
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee56
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x54], edx
cmp rax, qword [rbx + 0xc8]
jae 0x14000ee75
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee9e
cmp dword [rdi], 0
je 0x14000ee9c
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
mov edx, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee9e
xor cl, cl
xor ebp, ebp
movzx eax, cl
cmp dword [rsp + 0x28], 0x1000000
mov r14d, ebp
mov qword [rsp + 0x48], rbp
mov r13d, 1
mov dword [rsp + 0x78], ebp
mov dword [rsp + 0x50], ebp
jg 0x14000f60b
mov r8d, dword [rsp + 0x30]
cmp r8d, 0x1000000
jg 0x14000f60b
cmp esi, 8
jb 0x14000eee1
sub esi, 8
shr eax, 5
mov ecx, r13d
and eax, r13d
mov dword [rsp + 0x24], ebp
sub ecx, eax
mov dword [rsp + 0x58], ecx
cmp byte [rsp + 0x20], bpl
je 0x14000ef1c
mov ecx, r12d
sub ecx, 8
je 0x14000ef5f
sub ecx, 7
je 0x14000ef52
sub ecx, r13d
je 0x14000ef52
sub ecx, 8
je 0x14000ef3f
cmp ecx, 8
je 0x14000ef3f
mov r12d, ebp
jmp 0x14000ef62
mov ecx, edx
sub ecx, 8
je 0x14000ef5f
sub ecx, 7
je 0x14000ef52
sub ecx, r13d
je 0x14000ef45
sub ecx, 8
je 0x14000ef3c
cmp ecx, 8
je 0x14000ef3c
mov r12d, ebp
jmp 0x14000ef62
mov r12d, edx
shr r12d, 3
jmp 0x14000ef62
cmp esi, 3
jne 0x14000ef52
mov r12d, 2
jmp 0x14000ef62
mov r12d, 3
mov dword [rsp + 0x24], r13d
jmp 0x14000ef62
mov r12d, r13d
test r12d, r12d
jne 0x14000ef7f
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x14000f61e
mov rax, qword [rsp + 0x60]
mov esi, dword [rsp + 0x28]
mov dword [rax], r8d
mov rax, qword [rsp + 0x70]
mov dword [rax], esi
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x14000ef9f
mov dword [rax], r12d
test r8d, r8d
js 0x14000f60b
test esi, esi
js 0x14000f60b
je 0x14000efc3
mov eax, 0x7fffffff
cdq
idiv esi
cmp r8d, eax
jg 0x14000f60b
mov ecx, esi
imul ecx, r8d
test ecx, ecx
js 0x14000f60b
xor edx, edx
mov eax, 0x7fffffff
div r12d
cmp ecx, eax
jg 0x14000f60b
test esi, esi
je 0x14000eff8
mov eax, 0x7fffffff
cdq
idiv esi
cmp r8d, eax
jg 0x14000f5f6
mov eax, esi
imul eax, r12d
imul eax, r8d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rdi, rax
test rax, rax
je 0x14000f5f6
movsxd rdx, dword [rsp + 0x38]
test edx, edx
je 0x14000f056
cmp qword [rbx + 0x10], rbp
je 0x14000f04f
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x14000f04f
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x14000f056
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0x20], bpl
jne 0x14000f110
mov edx, dword [rsp + 0x2c]
mov r15, rdi
mov qword [rsp + 0x38], rdi
cmp edx, 8
jae 0x14000f30b
mov eax, dword [rsp + 0x24]
mov qword [rsp + 0x38], rdi
test eax, eax
jne 0x14000f30b
mov r13, rdi
test esi, esi
jle 0x14000f5b0
mov edx, dword [rsp + 0x30]
mov r14d, edx
imul r14d, r12d
cmp dword [rsp + 0x58], ebp
je 0x14000f0e0
mov eax, r14d
neg eax
movsxd r15, eax
mov eax, dword [rsp + 0x28]
dec eax
imul eax, r12d
imul eax, edx
movsxd rbp, eax
add rbp, rdi
nop
mov r8d, r14d
mov rdx, rbp
mov rcx, rbx
call fcn.140003b10
add rbp, r15
sub rsi, 1
jne 0x14000f0c0
mov esi, dword [rsp + 0x28]
jmp 0x14000f5ac
movsxd rbp, r14d
nop dword [rax]
nop word [rax + rax]
mov r8d, r14d
mov rdx, rdi
mov rcx, rbx
call fcn.140003b10
add rdi, rbp
sub rsi, 1
jne 0x14000f0f0
mov esi, dword [rsp + 0x28]
jmp 0x14000f5ac
mov r8d, dword [rsp + 0x40]
test r8d, r8d
je 0x14000f2ea
test r15d, r15d
je 0x14000f175
jns 0x14000f135
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x14000f175
cmp qword [rbx + 0x10], rbp
je 0x14000f16e
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x14000f16e
mov rax, qword [rbx + 0xc8]
sub r15d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r15d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r8d, dword [rsp + 0x40]
jmp 0x14000f175
add qword [rbx + 0xc0], r15
test r8d, r8d
js 0x14000f5ea
xor edx, edx
mov eax, 0x7fffffff
div r12d
cmp r8d, eax
jg 0x14000f5ea
mov r15, rdi
mov qword [rsp + 0x38], rdi
mov edi, r12d
imul edi, r8d
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x48], rax
test rax, rax
je 0x14000f5ed
cmp dword [rsp + 0x24], ebp
je 0x14000f2cc
mov rdi, rax
mov eax, dword [rsp + 0x40]
test eax, eax
jle 0x14000f2c5
mov esi, eax
mov r15d, r12d
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x38], rax
nop
mov rcx, rbx
call fcn.140003ca0
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, r15
sub rsi, r13
jne 0x14000f1e0
mov r15, qword [rsp + 0x38]
mov esi, dword [rsp + 0x28]
mov rdi, qword [rsp + 0x48]
mov edx, dword [rsp + 0x2c]
mov ecx, dword [rsp + 0x30]
mov eax, esi
imul eax, ecx
mov esi, r12d
test eax, eax
je 0x14000f52f
lea r8, [rsp + 0x78]
mov ecx, r12d
sub r15, r8
mov qword [rsp + 0x60], rax
cmp edx, 8
jb 0x14000f35d
test r14d, r14d
jne 0x14000f34e
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f313
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f338
mov qword [rsp + 0x38], r15
jmp 0x14000f26c
mov r8d, edi
mov rdx, rax
mov rcx, rbx
mov rdi, rax
call fcn.140003b10
test eax, eax
jne 0x14000f26c
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rdi
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 0x14000f61e
mov rdi, rbp
jmp 0x14000f270
cmp dword [rbx + 0x30], ebp
je 0x14000f336
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f338
xor cl, cl
movzx eax, cl
mov r14d, eax
and r14d, 0x7f
inc r14d
shr eax, 7
mov dword [rsp + 0x50], eax
jmp 0x14000f35d
cmp dword [rsp + 0x50], ebp
je 0x14000f35d
test r13d, r13d
je 0x14000f4db
cmp byte [rsp + 0x20], bpl
je 0x14000f3f4
cmp dword [rsp + 0x54], 8
jne 0x14000f3be
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f391
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14000f3c6
cmp dword [rbx + 0x30], ebp
je 0x14000f3b7
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14000f3c6
xor cl, cl
movzx eax, cl
jmp 0x14000f3c6
mov rcx, rbx
call fcn.140003ca0
test r12d, r12d
je 0x14000f4d0
cmp eax, dword [rsp + 0x40]
mov ecx, ebp
mov r8, rsi
cmovl ecx, eax
imul ecx, r12d
movsxd rdx, ecx
lea rcx, [rsp + 0x78]
add rdx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14000f4d0
cmp dword [rsp + 0x24], ebp
je 0x14000f476
mov rcx, rbx
call fcn.140003ca0
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 + 0x78], 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 + 0x79], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x7a], dl
jmp 0x14000f4d0
mov rdi, rbp
test r12d, r12d
je 0x14000f4d0
nop
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f49f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f4c4
cmp dword [rbx + 0x30], ebp
je 0x14000f4c2
mov rcx, rbx
call fcn.140003a90
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f4c4
xor cl, cl
mov byte [rsp + rdi + 0x78], cl
inc rdi
cmp rdi, rsi
jl 0x14000f480
mov rax, qword [rsp + 0x60]
mov r13d, ebp
mov ecx, r12d
mov rdi, rbp
test r12d, r12d
je 0x14000f508
lea rcx, [rsp + 0x78]
mov r8, rsi
add rcx, r15
lea rdx, [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x14000f4f8
mov rax, qword [rsp + 0x60]
mov ecx, r12d
mov rdi, qword [rsp + 0x48]
dec r14d
mov edx, dword [rsp + 0x2c]
add r15, rcx
sub rax, 1
mov qword [rsp + 0x60], rax
jne 0x14000f294
mov r15, qword [rsp + 0x38]
mov ecx, dword [rsp + 0x30]
mov esi, dword [rsp + 0x28]
cmp dword [rsp + 0x58], ebp
je 0x14000f597
test esi, esi
jle 0x14000f597
lea r10d, [rsi - 1]
mov r11d, r12d
imul r10d, r12d
mov ebx, ebp
imul r11d, ecx
imul r10d, ecx
mov r8d, r11d
test r11d, r11d
jle 0x14000f58a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r15]
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 0x14000f570
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, esi
jl 0x14000f552
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x14000f5a7
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r13, qword [rsp + 0x38]
mov eax, dword [rsp + 0x24]
cmp r12d, 3
jb 0x14000f5e5
test eax, eax
jne 0x14000f5e5
imul esi, dword [rsp + 0x30]
mov rdx, r13
test esi, esi
je 0x14000f5e5
mov r9d, r12d
mov r8d, esi
nop dword [rax]
movzx ecx, byte [rdx]
movzx eax, byte [rdx + 2]
mov byte [rdx], al
mov byte [rdx + 2], cl
add rdx, r9
sub r8, 1
jne 0x14000f5d0
mov rax, r13
jmp 0x14000f629
mov r15, rdi
mov rcx, r15
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 0x14000f61e
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 + 0x80]
xor rcx, rsp
call fcn.140081650
add rsp, 0x98
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret