Function at 0x1800ec150
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
mov rax, qword [0x180350010]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x38], r9
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x48], rdx
cmp rax, qword [rcx + 0xc8]
jae 0x1800ec1a6
movzx edx, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x1800ec1c9
cmp dword [rcx + 0x30], 0
je 0x1800ec1c7
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec1c9
xor dl, dl
mov ecx, 0x30
mov r8, rbx
mov qword [rsp + 0x98], rbp
lea rsi, [rcx + rbx]
movzx ecx, dl
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x70], rsi
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec201
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec227
cmp dword [rsi], 0
je 0x1800ec224
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec227
xor bpl, bpl
mov byte [rsp + 0x20], bpl
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec244
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec269
cmp dword [rsi], 0
je 0x1800ec267
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec269
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x2c], eax
call fcn.1800e1400
mov rcx, rbx
movsxd r15, eax
call fcn.1800e1400
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x44], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x1800ec2a6
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x1800ec2cb
cmp dword [rsi], 0
je 0x1800ec2c9
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec2cb
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.1800e1400
mov rcx, rbx
call fcn.1800e1400
mov rcx, rbx
call fcn.1800e1400
mov rcx, rbx
mov dword [rsp + 0x30], eax
call fcn.1800e1400
mov dword [rsp + 0x40], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec315
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec33a
cmp dword [rsi], 0
je 0x1800ec338
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec33a
xor cl, cl
movzx r10d, cl
mov dword [rsp + 0x54], r10d
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec35b
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec385
cmp dword [rsi], 0
je 0x1800ec383
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
mov r10d, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec385
xor cl, cl
mov r8d, dword [rsp + 0x40]
xor r14d, r14d
movzx eax, cl
mov r13d, r14d
mov qword [rsp + 0x68], r14
mov dword [rsp + 0x78], r14d
mov dword [rsp + 0x50], r14d
lea r12d, [r14 + 1]
cmp r8d, 0x1000000
jg 0x1800ecb41
mov r9d, dword [rsp + 0x30]
cmp r9d, 0x1000000
jg 0x1800ecb41
mov ecx, dword [rsp + 0x2c]
cmp ecx, 8
lea edx, [rcx - 8]
cmovb edx, ecx
shr eax, 5
and eax, r12d
mov ecx, r12d
sub ecx, eax
test bpl, bpl
mov dword [rsp + 0x58], ecx
mov ebp, r14d
je 0x1800ec40b
mov ecx, edi
sub ecx, 8
je 0x1800ec406
sub ecx, 7
je 0x1800ec460
sub ecx, r12d
je 0x1800ec460
sub ecx, 8
je 0x1800ec42a
cmp ecx, 8
jne 0x1800ec433
jmp 0x1800ec42a
mov edi, r12d
jmp 0x1800ec42d
mov ecx, r10d
sub ecx, 8
je 0x1800ec46c
sub ecx, 7
je 0x1800ec460
sub ecx, r12d
je 0x1800ec452
sub ecx, 8
je 0x1800ec427
cmp ecx, 8
jne 0x1800ec433
mov edi, r10d
shr edi, 3
mov esi, edi
test edi, edi
jne 0x1800ec472
mov edx, dword [0x180357864]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_format
jmp 0x1800ecb5b
cmp edx, 3
jne 0x1800ec460
mov edi, 2
mov esi, edi
jmp 0x1800ec472
mov edi, 3
mov ebp, r12d
mov esi, edi
jmp 0x1800ec472
mov edi, r12d
mov esi, r12d
mov rax, qword [rsp + 0x48]
mov dword [rax], r9d
mov rax, qword [rsp + 0x60]
mov dword [rax], r8d
mov rax, qword [rsp + 0x38]
test rax, rax
je 0x1800ec48e
mov dword [rax], edi
test r9d, r9d
js 0x1800ecb41
test r8d, r8d
js 0x1800ecb41
je 0x1800ec4b4
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x1800ecb41
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x1800ecb41
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1800ecb41
test r8d, r8d
je 0x1800ec4eb
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x1800ecb25
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 + 0x38], rax
mov r8, rax
test rax, rax
je 0x1800ecb25
movsxd rdx, dword [rsp + 0x28]
test edx, edx
je 0x1800ec553
cmp qword [rbx + 0x10], r13
je 0x1800ec54c
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x1800ec54c
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r8, qword [rsp + 0x38]
jmp 0x1800ec553
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0x20], r13b
jne 0x1800ec61f
mov edx, dword [rsp + 0x2c]
mov r15d, edi
mov dword [rsp + 0x24], ebp
cmp edx, 8
jae 0x1800ec787
mov dword [rsp + 0x24], ebp
test ebp, ebp
jne 0x1800ec787
mov r13d, dword [rsp + 0x40]
mov dword [rsp + 0x24], ebp
test r13d, r13d
jle 0x1800ec60c
imul r15d, dword [rsp + 0x30]
cmp dword [rsp + 0x58], r14d
mov r14d, r13d
mov dword [rsp + 0x24], ebp
je 0x1800ec5ec
mov eax, r15d
neg eax
movsxd r12, eax
lea eax, [r13 - 1]
imul eax, edi
imul eax, dword [rsp + 0x30]
movsxd rsi, eax
add rsi, r8
nop
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1800e1270
add rsi, r12
sub r14, 1
jne 0x1800ec5c0
imul r13d, dword [rsp + 0x30]
mov r15d, edi
mov rbp, qword [rsp + 0x38]
mov esi, edi
jmp 0x1800ecae3
movsxd r12, r15d
mov rsi, r8
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1800e1270
add rsi, r12
sub r14, 1
jne 0x1800ec5f2
mov r15d, edi
imul r13d, dword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov esi, r15d
jmp 0x1800ecae3
cmp dword [rsp + 0x44], r13d
jne 0x1800ec64e
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x180357864]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_palette
jmp 0x1800ecb5b
test r15d, r15d
je 0x1800ec6a0
jns 0x1800ec665
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1800ec6a0
cmp qword [rbx + 0x10], r13
je 0x1800ec699
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x1800ec699
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]
jmp 0x1800ec6a0
add qword [rbx + 0xc0], r15
mov r15d, dword [rsp + 0x44]
test r15d, r15d
js 0x1800ecb1a
xor edx, edx
imul esi, r15d
mov eax, 0x7fffffff
div edi
cmp r15d, eax
jg 0x1800ecb1a
movsxd rcx, esi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x68], rax
test rax, rax
je 0x1800ecb1a
mov dword [rsp + 0x24], ebp
test ebp, ebp
je 0x1800ec7f6
mov rsi, rax
test r15d, r15d
jle 0x1800ec7f1
mov eax, edi
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x28], edi
nop
mov rcx, rbx
call fcn.1800e1400
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, r12
jne 0x1800ec700
mov r15d, dword [rsp + 0x28]
mov edx, dword [rsp + 0x2c]
mov edi, dword [rsp + 0x40]
mov ecx, edi
mov eax, dword [rsp + 0x30]
imul ecx, eax
mov esi, r15d
mov dword [rsp + 0x28], ecx
test ecx, ecx
je 0x1800eca5b
mov rax, qword [rsp + 0x38]
lea r8, [rsp + 0x78]
mov rbp, qword [rsp + 0x70]
sub rax, r8
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x48], rcx
nop
cmp edx, 8
jb 0x1800ec870
test r13d, r13d
jne 0x1800ec860
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec824
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec84a
mov r15d, edi
jmp 0x1800ec783
mov r8d, esi
mov rdx, rax
mov rcx, rbx
mov r15d, edi
call fcn.1800e1270
test eax, eax
jne 0x1800ec783
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x68]
jmp 0x1800ec629
cmp dword [rbp], r14d
je 0x1800ec848
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec84a
xor cl, cl
movzx eax, cl
mov r13d, eax
and r13d, 0x7f
inc r13d
shr eax, 7
mov dword [rsp + 0x50], eax
jmp 0x1800ec870
cmp dword [rsp + 0x50], r14d
je 0x1800ec870
test r12d, r12d
je 0x1800ec9fe
cmp byte [rsp + 0x20], r14b
je 0x1800ec90b
cmp dword [rsp + 0x54], 8
jne 0x1800ec8d2
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec8a4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x1800ec8da
cmp dword [rbp], r14d
je 0x1800ec8cb
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x1800ec8da
xor cl, cl
movzx eax, cl
jmp 0x1800ec8da
mov rcx, rbx
call fcn.1800e1400
test r15d, r15d
je 0x1800ec9f1
cmp eax, dword [rsp + 0x44]
mov ecx, r14d
mov r8, rsi
cmovl ecx, eax
imul ecx, r15d
movsxd rdx, ecx
lea rcx, [rsp + 0x78]
add rdx, qword [rsp + 0x68]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1800ec9f1
cmp dword [rsp + 0x24], r14d
je 0x1800ec98e
mov rcx, rbx
call fcn.1800e1400
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 0x1800ec9f1
mov rdi, r14
test r15d, r15d
je 0x1800ec9f1
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800ec9bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec9e5
cmp dword [rbp], r14d
je 0x1800ec9e3
mov rcx, rbx
call fcn.1800e11f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800ec9e5
xor cl, cl
mov byte [rsp + rdi + 0x78], cl
inc rdi
cmp rdi, rsi
jl 0x1800ec9a0
mov rax, qword [rsp + 0x60]
mov r12d, r14d
mov rcx, qword [rsp + 0x48]
mov rdi, r14
test r15d, r15d
je 0x1800eca32
lea rcx, [rsp + 0x78]
mov r8, rsi
add rcx, rax
lea rdx, [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
nop dword [rax + rax]
inc rdi
cmp rdi, rsi
jl 0x1800eca20
mov rax, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x48]
movsxd rdx, r15d
dec r13d
add rax, rdx
mov edx, dword [rsp + 0x2c]
sub rcx, 1
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x48], rcx
jne 0x1800ec7c0
mov edi, dword [rsp + 0x40]
mov eax, dword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
cmp dword [rsp + 0x58], r14d
je 0x1800ecac9
test edi, edi
jle 0x1800ecac9
lea r10d, [rdi - 1]
mov r11d, r15d
imul r10d, r15d
mov ebx, r14d
imul r11d, eax
imul r10d, eax
mov r8d, r11d
test r11d, r11d
jle 0x1800ecaba
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + rbp]
nop word [rax + rax]
movzx eax, byte [r9 + rdx]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [r9 + rdx], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x1800ecaa0
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, edi
jl 0x1800eca81
mov rax, qword [rsp + 0x68]
mov ebx, dword [rsp + 0x28]
mov r13d, ebx
test rax, rax
je 0x1800ecae3
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp r15d, 3
jb 0x1800ecb15
cmp dword [rsp + 0x24], 0
jne 0x1800ecb15
mov rdx, rbp
test r13d, r13d
je 0x1800ecb15
mov r8d, r13d
nop dword [rax + rax]
movzx ecx, byte [rdx]
movzx eax, byte [rdx + 2]
mov byte [rdx], al
mov byte [rdx + 2], cl
add rdx, rsi
sub r8, 1
jne 0x1800ecb00
mov rax, rbp
jmp 0x1800ecb66
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x180357864]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
jmp 0x1800ecb5b
mov edx, dword [0x180357864]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov ecx, 0x28
mov qword [rcx + rax], rdx
xor eax, eax
mov rbp, qword [rsp + 0x98]
mov rcx, qword [rsp + 0x80]
xor rcx, rsp
call fcn.18012c2e0
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret