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 [0x140205040]
xor rax, rsp
mov qword [rsp + 0x88], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x48], r9
mov qword [rsp + 0x58], r8
mov qword [rsp + 0x68], 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.140003730
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
movzx r13d, dl
lea rdi, [rcx + rbx]
cmp rax, qword [rbx + 0xc8]
jae 0x14000ed16
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x30], cl
jmp 0x14000ed42
cmp dword [rdi], 0
je 0x14000ed3d
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rsp + 0x30], cl
jmp 0x14000ed42
mov byte [rsp + 0x30], 0
cmp rax, qword [rbx + 0xc8]
jae 0x14000ed5a
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ed7f
cmp dword [rdi], 0
je 0x14000ed7d
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ed7f
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x44], eax
mov esi, eax
call fcn.140003940
mov rcx, rbx
movsxd r15, eax
call fcn.140003940
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x14000edbe
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x14000ede3
cmp dword [rdi], 0
je 0x14000ede1
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ede3
xor dl, dl
mov rcx, rbx
movzx r14d, dl
call fcn.140003940
mov rcx, rbx
call fcn.140003940
mov rcx, rbx
call fcn.140003940
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.140003940
mov dword [rsp + 0x38], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000ee2e
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee53
cmp dword [rdi], 0
je 0x14000ee51
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee53
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x60], edx
cmp rax, qword [rbx + 0xc8]
jae 0x14000ee72
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee9b
cmp dword [rdi], 0
je 0x14000ee99
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
mov edx, dword [rsp + 0x60]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000ee9b
xor cl, cl
mov r8d, dword [rsp + 0x38]
xor ebp, ebp
movzx eax, cl
mov edi, ebp
mov qword [rsp + 0x78], rbp
mov r12d, 1
mov dword [rsp + 0x80], ebp
mov dword [rsp + 0x40], ebp
cmp r8d, 0x1000000
jg 0x14000f6c1
mov r9d, dword [rsp + 0x3c]
cmp r9d, 0x1000000
jg 0x14000f6c1
cmp esi, 8
jb 0x14000eee4
sub esi, 8
shr eax, 5
mov ecx, r12d
and eax, r12d
mov dword [rsp + 0x34], ebp
sub ecx, eax
mov dword [rsp + 0x64], ecx
cmp byte [rsp + 0x30], dil
je 0x14000ef1f
mov ecx, r14d
sub ecx, 8
je 0x14000ef62
sub ecx, 7
je 0x14000ef55
sub ecx, r12d
je 0x14000ef55
sub ecx, 8
je 0x14000ef42
cmp ecx, 8
je 0x14000ef42
mov r14d, ebp
jmp 0x14000ef65
mov ecx, edx
sub ecx, 8
je 0x14000ef62
sub ecx, 7
je 0x14000ef55
sub ecx, r12d
je 0x14000ef48
sub ecx, 8
je 0x14000ef3f
cmp ecx, 8
je 0x14000ef3f
mov r14d, ebp
jmp 0x14000ef65
mov r14d, edx
shr r14d, 3
jmp 0x14000ef65
cmp esi, 3
jne 0x14000ef55
mov r14d, 2
jmp 0x14000ef65
mov r14d, 3
mov dword [rsp + 0x34], r12d
jmp 0x14000ef65
mov r14d, r12d
test r14d, r14d
jne 0x14000ef82
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x14000f6d4
mov rax, qword [rsp + 0x68]
mov dword [rax], r9d
mov rax, qword [rsp + 0x58]
mov dword [rax], r8d
mov rax, qword [rsp + 0x48]
test rax, rax
je 0x14000ef9f
mov dword [rax], r14d
test r9d, r9d
js 0x14000f6c1
test r8d, r8d
js 0x14000f6c1
je 0x14000efc5
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14000f6c1
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x14000f6c1
xor edx, edx
mov eax, 0x7fffffff
div r14d
cmp ecx, eax
jg 0x14000f6c1
test r8d, r8d
je 0x14000effd
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x14000f6ac
mov eax, r8d
imul eax, r14d
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 rsi, rax
test rax, rax
je 0x14000f6ac
test r13d, r13d
je 0x14000f062
cmp qword [rbx + 0x10], rdi
je 0x14000f05b
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r13d
jge 0x14000f05b
mov rax, qword [rbx + 0xc8]
sub r13d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r13d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x14000f062
add qword [rbx + 0xc0], r13
cmp byte [rsp + 0x30], dil
jne 0x14000f124
mov edx, dword [rsp + 0x44]
mov r13, rsi
mov qword [rsp + 0x58], rsi
cmp edx, 8
jae 0x14000f2b7
mov eax, dword [rsp + 0x34]
mov qword [rsp + 0x58], rsi
test eax, eax
jne 0x14000f2b7
mov r15d, dword [rsp + 0x38]
mov r12d, dword [rsp + 0x3c]
test r15d, r15d
jle 0x14000f634
mov ebp, r12d
mov edi, r15d
imul ebp, r14d
cmp dword [rsp + 0x64], eax
je 0x14000f0f5
mov eax, ebp
neg eax
movsxd r15, eax
mov eax, dword [rsp + 0x38]
dec eax
imul eax, r14d
imul eax, r12d
movsxd rsi, eax
add rsi, r13
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.1400037b0
add rsi, r15
sub rdi, 1
jne 0x14000f0d1
mov r15d, dword [rsp + 0x38]
mov rsi, r13
jmp 0x14000f630
movsxd r15, ebp
mov r13, rsi
nop dword [rax + rax]
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.1400037b0
add rsi, r15
sub rdi, 1
jne 0x14000f100
mov r15d, dword [rsp + 0x38]
mov rsi, r13
jmp 0x14000f630
mov r8d, dword [rsp + 0x50]
test r8d, r8d
jne 0x14000f14f
mov rcx, rsi
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 0x14000f6d4
test r15d, r15d
je 0x14000f1a6
jns 0x14000f166
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x14000f1a6
cmp qword [rbx + 0x10], rdi
je 0x14000f19f
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x14000f19f
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 + 0x50]
jmp 0x14000f1a6
add qword [rbx + 0xc0], r15
test r8d, r8d
js 0x14000f6a0
xor edx, edx
mov eax, 0x7fffffff
div r14d
cmp r8d, eax
jg 0x14000f6a0
mov edi, r14d
mov qword [rsp + 0x58], rsi
imul edi, r8d
mov r13, rsi
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
mov r15, rax
test rax, rax
je 0x14000f6a3
cmp dword [rsp + 0x34], ebp
je 0x14000f327
mov rdi, rax
cmp r14d, 3
je 0x14000f218
mov r8d, 0x1791
lea rdx, [0x1401ddd70]
lea rcx, str.tga_comp__STBI_rgb
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov eax, dword [rsp + 0x50]
mov qword [rsp + 0x58], r13
test eax, eax
jle 0x14000f320
mov r15d, r14d
mov esi, eax
mov qword [rsp + 0x48], r13
mov rcx, rbx
call fcn.140003940
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, r12
jne 0x14000f233
mov edx, dword [rsp + 0x44]
mov edi, ebp
mov r15d, dword [rsp + 0x38]
mov eax, r15d
imul eax, dword [rsp + 0x3c]
mov esi, r14d
test eax, eax
je 0x14000f5ab
mov r15, r13
mov ecx, r14d
lea r8, [rsp + 0x80]
mov qword [rsp + 0x68], rax
sub r15, r8
mov r13d, ebp
nop dword [rax + rax]
cmp edx, 8
jb 0x14000f39c
test edi, edi
jne 0x14000f38e
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f353
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f378
mov qword [rsp + 0x48], rsi
jmp 0x14000f2b1
mov r8d, edi
mov qword [rsp + 0x48], rsi
mov rdx, r15
mov rcx, rbx
call fcn.1400037b0
test eax, eax
jne 0x14000f2b1
mov rcx, r13
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, r15
jmp 0x14000f131
cmp dword [rbx + 0x30], ebp
je 0x14000f376
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f378
xor cl, cl
movzx r13d, cl
mov edi, r13d
and edi, 0x7f
inc edi
mov dword [rsp + 0x40], edi
shr r13d, 7
jmp 0x14000f39c
test r13d, r13d
je 0x14000f39c
test r12d, r12d
je 0x14000f54e
cmp byte [rsp + 0x30], bpl
je 0x14000f438
cmp dword [rsp + 0x60], 8
jne 0x14000f3fd
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f3d0
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14000f405
cmp dword [rbx + 0x30], ebp
je 0x14000f3f6
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x14000f405
xor cl, cl
movzx eax, cl
jmp 0x14000f405
mov rcx, rbx
call fcn.140003940
test r14d, r14d
je 0x14000f543
cmp eax, dword [rsp + 0x50]
mov ecx, ebp
mov r8, rsi
cmovl ecx, eax
imul ecx, r14d
movsxd rdx, ecx
lea rcx, [rsp + 0x80]
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x14000f543
cmp dword [rsp + 0x34], ebp
je 0x14000f4e7
cmp r14d, 3
je 0x14000f462
mov r8d, 0x17c6
lea rdx, [0x1401ddd70]
lea rcx, str.tga_comp__STBI_rgb
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__wassert]
mov rcx, rbx
call fcn.140003940
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 0x14000f543
mov rdi, rbp
test r14d, r14d
je 0x14000f543
nop
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14000f50f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f534
cmp dword [rbx + 0x30], ebp
je 0x14000f532
mov rcx, rbx
call fcn.140003730
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14000f534
xor cl, cl
mov byte [rsp + rdi + 0x80], cl
inc rdi
cmp rdi, rsi
jl 0x14000f4f0
mov rax, qword [rsp + 0x68]
mov r12d, ebp
mov ecx, r14d
mov rdi, rbp
test r14d, r14d
je 0x14000f581
lea rcx, [rsp + 0x80]
mov r8, rsi
add rcx, r15
lea rdx, [rsp + 0x80]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x14000f571
mov rax, qword [rsp + 0x68]
mov ecx, r14d
mov edi, dword [rsp + 0x40]
add r15, rcx
mov edx, dword [rsp + 0x44]
dec edi
sub rax, 1
mov dword [rsp + 0x40], edi
mov qword [rsp + 0x68], rax
jne 0x14000f2f0
mov r13, qword [rsp + 0x58]
mov r15d, dword [rsp + 0x38]
mov r12d, dword [rsp + 0x3c]
cmp dword [rsp + 0x64], ebp
je 0x14000f618
test r15d, r15d
jle 0x14000f618
lea r10d, [r15 - 1]
mov r11d, r14d
imul r10d, r14d
mov ebx, ebp
imul r11d, r12d
imul r10d, r12d
mov r8d, r11d
test r11d, r11d
jle 0x14000f60a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r13]
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 0x14000f5f0
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, r15d
jl 0x14000f5d0
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x14000f62b
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rsi, qword [rsp + 0x48]
mov eax, dword [rsp + 0x34]
cmp r14d, 3
jb 0x14000f679
test eax, eax
jne 0x14000f679
mov eax, r15d
mov r8, r13
imul eax, r12d
test eax, eax
je 0x14000f679
mov edx, r14d
mov r10d, eax
nop dword [rax]
nop word [rax + rax]
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, rdx
sub r10, 1
jne 0x14000f660
cmp r14d, 4
je 0x14000f69b
mov r9d, r12d
mov dword [rsp + 0x20], r15d
mov r8d, 4
mov edx, r14d
mov rcx, r13
call fcn.140003a00
mov rsi, rax
mov rax, rsi
jmp 0x14000f6df
mov r13, rsi
mov rcx, r13
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 0x14000f6d4
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.1400c4480
add rsp, 0x98
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret