Function at 0x1400f0100
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, 0x88
mov rax, qword [rcx + 0xb8]
mov rbx, rcx
cmp rax, qword [rcx + 0xc0]
jae 0x1400f0145
movzx r8d, byte [rax]
inc rax
mov qword [rcx + 0xb8], rax
jmp 0x1400f016a
cmp dword [rcx + 0x30], 0
je 0x1400f0167
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx r8d, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f016a
xor r8b, r8b
mov ecx, 0x30
mov byte [rsp + 0xe8], r8b
mov rdx, rbx
lea rsi, [rcx + rbx]
movzx ecx, r8b
mov dword [rsp + 0x30], ecx
cmp rax, qword [rbx + 0xc0]
jae 0x1400f019e
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f01c4
cmp dword [rsi], 0
je 0x1400f01c1
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f01c4
xor bpl, bpl
mov byte [rsp + 0xf0], bpl
cmp rax, qword [rbx + 0xc0]
jae 0x1400f01e4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f0209
cmp dword [rsi], 0
je 0x1400f0207
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f0209
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x38], eax
mov r15d, eax
call fcn.1400e54f0
mov rcx, rbx
movsxd r13, eax
call fcn.1400e54f0
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x1400f0249
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x1400f026e
cmp dword [rsi], 0
je 0x1400f026c
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f026e
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.1400e54f0
mov rcx, rbx
call fcn.1400e54f0
mov rcx, rbx
call fcn.1400e54f0
mov rcx, rbx
mov dword [rsp + 0xd0], eax
call fcn.1400e54f0
mov dword [rsp + 0x34], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400f02bb
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f02e0
cmp dword [rsi], 0
je 0x1400f02de
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f02e0
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x54], edx
cmp rax, qword [rbx + 0xc0]
jae 0x1400f02ff
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f0328
cmp dword [rsi], 0
je 0x1400f0326
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
mov edx, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f0328
xor cl, cl
xor r14d, r14d
movzx eax, cl
mov qword [rsp + 0x48], r14
mov dword [rsp + 0xf8], r14d
lea r12d, [r14 + 1]
cmp r15d, 8
jb 0x1400f0349
sub r15d, 8
shr eax, 5
mov ecx, r12d
and eax, r12d
sub ecx, eax
test bpl, bpl
mov dword [rsp + 0x58], ecx
mov ebp, r14d
je 0x1400f0382
mov ecx, edi
sub ecx, 8
je 0x1400f037d
sub ecx, 7
je 0x1400f03ca
sub ecx, r12d
je 0x1400f03ca
sub ecx, 8
je 0x1400f039f
cmp ecx, 8
jne 0x1400f03a6
jmp 0x1400f039f
mov edi, r12d
jmp 0x1400f03a2
mov ecx, edx
sub ecx, 8
je 0x1400f03d4
sub ecx, 7
je 0x1400f03ca
sub ecx, r12d
je 0x1400f03be
sub ecx, 8
je 0x1400f039d
cmp ecx, 8
jne 0x1400f03a6
mov edi, edx
shr edi, 3
test edi, edi
jne 0x1400f03d7
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x1400f0b6d
cmp r15d, 3
jne 0x1400f03ca
lea edi, [r15 - 1]
jmp 0x1400f03d7
mov ebp, r12d
mov edi, 3
jmp 0x1400f03d7
mov edi, r12d
mov rax, qword [rsp + 0xd8]
mov r8d, dword [rsp + 0xd0]
mov r15d, dword [rsp + 0x34]
mov dword [rax], r8d
mov rax, qword [rsp + 0xe0]
mov dword [rax], r15d
test r8d, r8d
js 0x1400f0b5a
test r15d, r15d
js 0x1400f0b5a
je 0x1400f0420
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400f0b5a
mov ecx, r15d
imul ecx, r8d
test ecx, ecx
js 0x1400f0b5a
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400f0b5a
test r15d, r15d
je 0x1400f0457
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400f0b45
mov eax, r15d
imul eax, edi
imul eax, r8d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x40], rax
mov rsi, rax
test rax, rax
je 0x1400f0b45
cmp qword [rbx + 0x10], r14
je 0x1400f04ae
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x30]
cmp ecx, edx
jge 0x1400f04ae
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x1400f04bd
movzx eax, byte [rsp + 0xe8]
add qword [rbx + 0xb8], rax
cmp byte [rsp + 0xf0], r14b
jne 0x1400f0591
mov edx, dword [rsp + 0x38]
mov r13d, edi
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
cmp edx, 8
jae 0x1400f07c5
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
test ebp, ebp
jne 0x1400f07c5
test r15d, r15d
jle 0x1400f0aca
mov r15d, edi
imul r15d, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400f0561
mov ecx, dword [rsp + 0x34]
mov eax, r15d
neg eax
mov r14d, ecx
movsxd r12, eax
lea eax, [rcx - 1]
imul eax, edi
imul eax, dword [rsp + 0xd0]
movsxd rsi, eax
add rsi, qword [rsp + 0x40]
nop word [rax + rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400e5360
add rsi, r12
sub r14, 1
jne 0x1400f0540
mov r15d, dword [rsp + 0x34]
jmp 0x1400f0ac5
mov r14d, dword [rsp + 0x34]
movsxd r12, r15d
nop dword [rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400e5360
add rsi, r12
sub r14, 1
jne 0x1400f0570
mov r15d, dword [rsp + 0x34]
jmp 0x1400f0ac5
test r13d, r13d
jns 0x1400f05a6
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x1400f05e1
cmp qword [rbx + 0x10], r14
je 0x1400f05da
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r13d
jge 0x1400f05da
mov rax, qword [rbx + 0xc0]
sub r13d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r13d
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x1400f05e1
add qword [rbx + 0xb8], r13
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x1400f0b3c
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400f0b3c
mov esi, edi
imul esi, ecx
movsxd rcx, esi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x48], rax
test rax, rax
je 0x1400f0b37
test ebp, ebp
je 0x1400f076a
mov rsi, rax
cmp edi, 3
je 0x1400f0644
mov r8d, 0x1687
lea rdx, str.E:ReposSimHapticlibsimgui_stb_image.h
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 r13d, edi
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
test eax, eax
jle 0x1400f07bd
mov r13d, edi
mov r15d, eax
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
nop
mov rcx, rbx
call fcn.1400e54f0
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, r13
sub r15, r12
jne 0x1400f0670
mov r15d, dword [rsp + 0x34]
mov r13d, edi
mov rdi, qword [rsp + 0x48]
mov edx, dword [rsp + 0x38]
mov ecx, dword [rsp + 0xd0]
mov eax, r15d
imul eax, ecx
mov esi, r13d
test eax, eax
je 0x1400f0a37
mov rcx, qword [rsp + 0x40]
lea r8, [rsp + 0xf8]
sub rcx, r8
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x68], rcx
mov ebp, r14d
mov r15d, r14d
cmp edx, 8
jb 0x1400f0813
test ebp, ebp
jne 0x1400f0805
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400f07cd
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f07f3
mov r13d, edi
mov dword [rsp + 0x30], edi
mov r8d, esi
mov dword [rsp + 0xe8], ebp
mov rdx, rax
mov rcx, rbx
mov rdi, rax
call fcn.1400e5360
test eax, eax
jne 0x1400f06fb
mov rcx, qword [rsp + 0x40]
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 0x1400f0b6d
mov rdi, rsi
jmp 0x1400f06fb
mov rdi, r14
jmp 0x1400f06ff
cmp dword [rbx + 0x30], r14d
je 0x1400f07f1
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f07f3
xor cl, cl
movzx r15d, cl
mov ebp, r15d
and ebp, 0x7f
inc ebp
shr r15d, 7
jmp 0x1400f0813
test r15d, r15d
je 0x1400f0813
test r12d, r12d
je 0x1400f09d1
cmp byte [rsp + 0xf0], r14b
je 0x1400f08b2
cmp dword [rsp + 0x54], 8
jne 0x1400f0878
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400f084a
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400f0880
cmp dword [rbx + 0x30], r14d
je 0x1400f0871
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400f0880
xor cl, cl
movzx eax, cl
jmp 0x1400f0880
mov rcx, rbx
call fcn.1400e54f0
test r13d, r13d
je 0x1400f09c4
cmp eax, dword [rsp + 0x50]
mov ecx, r14d
mov r8, rsi
cmovl ecx, eax
imul ecx, r13d
movsxd rdx, ecx
lea rcx, [rsp + 0xf8]
add rdx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400f09c4
cmp dword [rsp + 0xe8], r14d
je 0x1400f0965
cmp r13d, 3
je 0x1400f08e0
mov r8d, 0x16bc
lea rdx, str.E:ReposSimHapticlibsimgui_stb_image.h
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.1400e54f0
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 + 0xf8], 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 + 0xf9], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0xfa], dl
jmp 0x1400f09c4
mov rdi, r14
test r13d, r13d
je 0x1400f09c4
nop dword [rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400f098f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f09b5
cmp dword [rbx + 0x30], r14d
je 0x1400f09b3
mov rcx, rbx
call fcn.1400e52f0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400f09b5
xor cl, cl
mov byte [rsp + rdi + 0xf8], cl
inc rdi
cmp rdi, rsi
jl 0x1400f0970
mov rcx, qword [rsp + 0x68]
mov r12d, r14d
mov rax, qword [rsp + 0x70]
mov rdi, r14
test r13d, r13d
je 0x1400f0a06
lea rax, [rsp + 0xf8]
mov r8, rsi
add rcx, rax
lea rdx, [rsp + 0xf8]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x1400f09f4
mov rcx, qword [rsp + 0x68]
mov rax, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x48]
dec ebp
movsxd rdx, r13d
add rcx, rdx
mov edx, dword [rsp + 0x38]
sub rax, 1
mov qword [rsp + 0x68], rcx
mov qword [rsp + 0x70], rax
jne 0x1400f0737
mov r15d, dword [rsp + 0x34]
mov ecx, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400f0aae
test r15d, r15d
jle 0x1400f0aae
mov r11d, r13d
lea r10d, [r15 - 1]
imul r10d, r13d
mov ebx, r14d
mov r13, qword [rsp + 0x40]
imul r11d, ecx
imul r10d, ecx
nop
mov r8d, r11d
test r11d, r11d
jle 0x1400f0a9a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r13]
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 0x1400f0a80
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, r15d
jl 0x1400f0a60
mov r13d, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x1400f0abe
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ebp, dword [rsp + 0xe8]
mov rsi, qword [rsp + 0x40]
cmp r13d, 3
jb 0x1400f0b09
mov ecx, dword [rsp + 0xd0]
test ebp, ebp
jne 0x1400f0b10
mov eax, r15d
mov r8, rsi
imul eax, ecx
test eax, eax
je 0x1400f0b10
mov r11d, r13d
mov r10d, eax
nop
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 0x1400f0af0
mov ecx, dword [rsp + 0xd0]
cmp r13d, 4
je 0x1400f0b32
mov r9d, ecx
mov dword [rsp + 0x20], r15d
mov rcx, rsi
mov r8d, 4
mov edx, r13d
call fcn.1400e55b0
mov rsi, rax
mov rax, rsi
jmp 0x1400f0b78
mov rsi, qword [rsp + 0x40]
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.outofmem
jmp 0x1400f0b6d
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
mov edx, 0x18
mov qword [rdx + rcx], rax
xor eax, eax
add rsp, 0x88
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret