Function at 0x1400613c0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x78
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
cmp rax, qword [rcx + 0xc8]
jae 0x140061402
movzx r10d, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x140061427
cmp dword [rcx + 0x30], 0
je 0x140061424
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx r10d, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140061427
xor r10b, r10b
mov ecx, 0x30
mov rdx, rbx
lea rdi, [rcx + rbx]
movzx ecx, r10b
mov dword [rsp + 0x40], ecx
cmp rax, qword [rbx + 0xc8]
jae 0x14006145a
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0xe0], cl
jmp 0x14006148c
cmp dword [rdi], 0
je 0x140061484
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0xe0], cl
jmp 0x14006148c
mov byte [rsp + 0xe0], 0
cmp rax, qword [rbx + 0xc8]
jae 0x1400614a4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400614c9
cmp dword [rdi], 0
je 0x1400614c7
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400614c9
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x34], eax
mov esi, eax
call fcn.1400561f0
mov rcx, rbx
movsxd r14, eax
call fcn.1400561f0
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x140061508
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x14006152d
cmp dword [rdi], 0
je 0x14006152b
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14006152d
xor dl, dl
mov rcx, rbx
movzx r15d, dl
call fcn.1400561f0
mov rcx, rbx
call fcn.1400561f0
mov rcx, rbx
call fcn.1400561f0
mov rcx, rbx
mov dword [rsp + 0x30], eax
call fcn.1400561f0
mov dword [rsp + 0x3c], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140061578
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14006159d
cmp dword [rdi], 0
je 0x14006159b
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14006159d
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x54], edx
cmp rax, qword [rbx + 0xc8]
jae 0x1400615bc
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400615e5
cmp dword [rdi], 0
je 0x1400615e3
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
mov edx, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400615e5
xor cl, cl
mov r8d, dword [rsp + 0x3c]
xor ebp, ebp
movzx eax, cl
mov r12d, ebp
mov qword [rsp + 0x68], rbp
mov edi, ebp
mov dword [rsp + 0xe8], ebp
mov r13d, 1
mov dword [rsp + 0x38], ebp
cmp r8d, 0x1000000
jg 0x140061de4
mov r9d, dword [rsp + 0x30]
cmp r9d, 0x1000000
jg 0x140061de4
cmp esi, 8
jb 0x140061631
sub esi, 8
shr eax, 5
mov ecx, r13d
and eax, r13d
mov dword [rsp + 0xc0], ebp
sub ecx, eax
mov dword [rsp + 0x58], ecx
cmp byte [rsp + 0xe0], dil
je 0x140061672
mov ecx, r15d
sub ecx, 8
je 0x1400616b8
sub ecx, 7
je 0x1400616a8
sub ecx, r13d
je 0x1400616a8
sub ecx, 8
je 0x140061695
cmp ecx, 8
je 0x140061695
mov r15d, ebp
jmp 0x1400616bb
mov ecx, edx
sub ecx, 8
je 0x1400616b8
sub ecx, 7
je 0x1400616a8
sub ecx, r13d
je 0x14006169b
sub ecx, 8
je 0x140061692
cmp ecx, 8
je 0x140061692
mov r15d, ebp
jmp 0x1400616bb
mov r15d, edx
shr r15d, 3
jmp 0x1400616bb
cmp esi, 3
jne 0x1400616a8
mov r15d, 2
jmp 0x1400616bb
mov r15d, 3
mov dword [rsp + 0xc0], r13d
jmp 0x1400616bb
mov r15d, r13d
test r15d, r15d
jne 0x1400616d8
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x140061df7
mov rax, qword [rsp + 0xc8]
mov dword [rax], r9d
mov rax, qword [rsp + 0xd0]
mov dword [rax], r8d
mov rax, qword [rsp + 0xd8]
test rax, rax
je 0x1400616fe
mov dword [rax], r15d
test r9d, r9d
js 0x140061de4
test r8d, r8d
js 0x140061de4
je 0x140061724
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140061de4
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x140061de4
xor edx, edx
mov eax, 0x7fffffff
div r15d
cmp ecx, eax
jg 0x140061de4
test r8d, r8d
je 0x14006175c
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140061dcf
mov eax, r8d
imul eax, r15d
imul eax, r9d
movsxd rcx, eax
call fcn.14008cc00
mov qword [rsp + 0x48], rax
mov rsi, rax
test rax, rax
je 0x140061dcf
movsxd rdx, dword [rsp + 0x40]
test edx, edx
je 0x1400617bf
cmp qword [rbx + 0x10], rdi
je 0x1400617b8
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x1400617b8
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x1400617bf
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0xe0], dil
jne 0x14006187f
mov edx, dword [rsp + 0x34]
mov r14, rsi
mov qword [rsp + 0x40], rsi
cmp edx, 8
jae 0x1400619fa
mov eax, dword [rsp + 0xc0]
mov qword [rsp + 0x40], rsi
test eax, eax
jne 0x1400619fa
mov r13d, dword [rsp + 0x3c]
mov r12, rsi
test r13d, r13d
jle 0x140061d5b
mov ecx, dword [rsp + 0x30]
mov edi, r13d
mov ebp, ecx
imul ebp, r15d
cmp dword [rsp + 0x58], eax
je 0x140061851
mov eax, ebp
neg eax
movsxd r14, eax
lea eax, [r13 - 1]
imul eax, r15d
imul eax, ecx
movsxd rsi, eax
add rsi, r12
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.140056060
add rsi, r14
sub rdi, 1
jne 0x140061832
mov rsi, r12
jmp 0x140061d54
movsxd r14, ebp
mov r12, rsi
nop word [rax + rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.140056060
add rsi, r14
sub rdi, 1
jne 0x140061860
mov rsi, r12
jmp 0x140061d54
mov r8d, dword [rsp + 0x50]
test r8d, r8d
jne 0x1400618a9
mov rcx, rsi
call fcn.14008a3f0
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_palette
jmp 0x140061df7
test r14d, r14d
je 0x140061900
jns 0x1400618c0
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x140061900
cmp qword [rbx + 0x10], rdi
je 0x1400618f9
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r14d
jge 0x1400618f9
mov rax, qword [rbx + 0xc8]
sub r14d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r14d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r8d, dword [rsp + 0x50]
jmp 0x140061900
add qword [rbx + 0xc0], r14
test r8d, r8d
js 0x140061dc4
xor edx, edx
mov eax, 0x7fffffff
div r15d
cmp r8d, eax
jg 0x140061dc4
mov edi, r15d
mov qword [rsp + 0x40], rsi
imul edi, r8d
mov r14, rsi
movsxd rcx, edi
call fcn.14008cc00
mov qword [rsp + 0x68], rax
test rax, rax
je 0x140061dc7
cmp dword [rsp + 0xc0], ebp
je 0x140061a60
mov rdi, rax
mov eax, dword [rsp + 0x50]
test eax, eax
jle 0x140061a54
mov esi, eax
mov r14d, r15d
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rax
mov rcx, rbx
call fcn.1400561f0
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 0x140061971
mov r14, qword [rsp + 0x40]
mov edx, dword [rsp + 0x34]
mov edi, ebp
mov eax, dword [rsp + 0x3c]
mov ecx, dword [rsp + 0x30]
imul eax, ecx
mov esi, r15d
test eax, eax
je 0x140061cc7
lea r8, [rsp + 0xe8]
mov ecx, r15d
mov qword [rsp + 0x60], rax
sub r14, r8
cmp edx, 8
jb 0x140061ad5
test r12d, r12d
jne 0x140061ac8
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140061a8d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140061ab2
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], rsi
jmp 0x1400619f4
mov r8d, edi
mov qword [rsp + 0x48], rsi
mov rdx, rax
mov rcx, rbx
call fcn.140056060
test eax, eax
jne 0x1400619f4
mov rcx, rsi
call fcn.14008a3f0
mov rcx, qword [rsp + 0x68]
jmp 0x14006188c
cmp dword [rbx + 0x30], ebp
je 0x140061ab0
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140061ab2
xor cl, cl
movzx edi, cl
mov r12d, edi
and r12d, 0x7f
inc r12d
shr edi, 7
mov dword [rsp + 0x38], edi
jmp 0x140061ad5
test edi, edi
je 0x140061ad5
test r13d, r13d
je 0x140061c6e
cmp byte [rsp + 0xe0], bpl
je 0x140061b74
cmp dword [rsp + 0x54], 8
jne 0x140061b39
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140061b0c
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x140061b41
cmp dword [rbx + 0x30], ebp
je 0x140061b32
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x140061b41
xor cl, cl
movzx eax, cl
jmp 0x140061b41
mov rcx, rbx
call fcn.1400561f0
test r15d, r15d
je 0x140061c63
cmp eax, dword [rsp + 0x50]
mov ecx, ebp
mov r8, rsi
cmovl ecx, eax
imul ecx, r15d
movsxd rdx, ecx
lea rcx, [rsp + 0xe8]
add rdx, qword [rsp + 0x68]
call fcn.1400abed0
jmp 0x140061c63
cmp dword [rsp + 0xc0], ebp
je 0x140061c06
mov rcx, rbx
call fcn.1400561f0
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 + 0xe8], 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 + 0xe9], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0xea], dl
jmp 0x140061c63
mov rdi, rbp
test r15d, r15d
je 0x140061c63
nop
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140061c2f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140061c54
cmp dword [rbx + 0x30], ebp
je 0x140061c52
mov rcx, rbx
call fcn.140055fe0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140061c54
xor cl, cl
mov byte [rsp + rdi + 0xe8], cl
inc rdi
cmp rdi, rsi
jl 0x140061c10
mov rax, qword [rsp + 0x60]
mov r13d, ebp
mov ecx, r15d
mov rdi, rbp
test r15d, r15d
je 0x140061ca1
lea rcx, [rsp + 0xe8]
mov r8, rsi
add rcx, r14
lea rdx, [rsp + 0xe8]
call fcn.1400abed0
inc rdi
cmp rdi, rsi
jl 0x140061c91
mov rax, qword [rsp + 0x60]
mov ecx, r15d
mov edi, dword [rsp + 0x38]
dec r12d
mov edx, dword [rsp + 0x34]
add r14, rcx
sub rax, 1
mov qword [rsp + 0x60], rax
jne 0x140061a23
mov r14, qword [rsp + 0x40]
mov ecx, dword [rsp + 0x30]
mov r13d, dword [rsp + 0x3c]
cmp dword [rsp + 0x58], ebp
je 0x140061d38
test r13d, r13d
jle 0x140061d38
lea r10d, [r13 - 1]
mov r11d, r15d
imul r10d, r15d
mov ebx, ebp
imul r11d, ecx
imul r10d, ecx
nop dword [rax]
mov r8d, r11d
test r11d, r11d
jle 0x140061d2a
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 0x140061d10
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, r13d
jl 0x140061cf0
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x140061d4a
mov rcx, rax
call fcn.14008a3f0
mov rsi, qword [rsp + 0x48]
mov r12, qword [rsp + 0x40]
mov eax, dword [rsp + 0xc0]
cmp r15d, 3
jb 0x140061d99
mov ecx, dword [rsp + 0x30]
test eax, eax
jne 0x140061d9d
mov eax, r13d
mov r8, r12
imul eax, ecx
test eax, eax
je 0x140061d9d
mov r11d, r15d
mov r10d, eax
nop dword [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 0x140061d80
mov ecx, dword [rsp + 0x30]
cmp r15d, 4
je 0x140061dbf
mov r9d, ecx
mov dword [rsp + 0x20], r13d
mov rcx, r12
mov r8d, 4
mov edx, r15d
call fcn.1400562b0
mov rsi, rax
mov rax, rsi
jmp 0x140061e02
mov r14, rsi
mov rcx, r14
call fcn.14008a3f0
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
jmp 0x140061df7
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
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret