Function at 0x1400bb420
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 0x1400bb465
movzx r8d, byte [rax]
inc rax
mov qword [rcx + 0xb8], rax
jmp 0x1400bb48a
cmp dword [rcx + 0x30], 0
je 0x1400bb487
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx r8d, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb48a
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 0x1400bb4be
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb4e4
cmp dword [rsi], 0
je 0x1400bb4e1
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb4e4
xor bpl, bpl
mov byte [rsp + 0xf0], bpl
cmp rax, qword [rbx + 0xc0]
jae 0x1400bb504
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb529
cmp dword [rsi], 0
je 0x1400bb527
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb529
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x38], eax
mov r15d, eax
call fcn.1400b0810
mov rcx, rbx
movsxd r13, eax
call fcn.1400b0810
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x1400bb569
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x1400bb58e
cmp dword [rsi], 0
je 0x1400bb58c
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb58e
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.1400b0810
mov rcx, rbx
call fcn.1400b0810
mov rcx, rbx
call fcn.1400b0810
mov rcx, rbx
mov dword [rsp + 0xd0], eax
call fcn.1400b0810
mov dword [rsp + 0x34], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bb5db
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb600
cmp dword [rsi], 0
je 0x1400bb5fe
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb600
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x54], edx
cmp rax, qword [rbx + 0xc0]
jae 0x1400bb61f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb648
cmp dword [rsi], 0
je 0x1400bb646
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
mov edx, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bb648
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 0x1400bb669
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 0x1400bb6a2
mov ecx, edi
sub ecx, 8
je 0x1400bb69d
sub ecx, 7
je 0x1400bb6ea
sub ecx, r12d
je 0x1400bb6ea
sub ecx, 8
je 0x1400bb6bf
cmp ecx, 8
jne 0x1400bb6c6
jmp 0x1400bb6bf
mov edi, r12d
jmp 0x1400bb6c2
mov ecx, edx
sub ecx, 8
je 0x1400bb6f4
sub ecx, 7
je 0x1400bb6ea
sub ecx, r12d
je 0x1400bb6de
sub ecx, 8
je 0x1400bb6bd
cmp ecx, 8
jne 0x1400bb6c6
mov edi, edx
shr edi, 3
test edi, edi
jne 0x1400bb6f7
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x1400bbe8d
cmp r15d, 3
jne 0x1400bb6ea
lea edi, [r15 - 1]
jmp 0x1400bb6f7
mov ebp, r12d
mov edi, 3
jmp 0x1400bb6f7
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 0x1400bbe7a
test r15d, r15d
js 0x1400bbe7a
je 0x1400bb740
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400bbe7a
mov ecx, r15d
imul ecx, r8d
test ecx, ecx
js 0x1400bbe7a
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400bbe7a
test r15d, r15d
je 0x1400bb777
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400bbe65
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 0x1400bbe65
cmp qword [rbx + 0x10], r14
je 0x1400bb7ce
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x30]
cmp ecx, edx
jge 0x1400bb7ce
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x1400bb7dd
movzx eax, byte [rsp + 0xe8]
add qword [rbx + 0xb8], rax
cmp byte [rsp + 0xf0], r14b
jne 0x1400bb8b1
mov edx, dword [rsp + 0x38]
mov r13d, edi
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
cmp edx, 8
jae 0x1400bbae5
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
test ebp, ebp
jne 0x1400bbae5
test r15d, r15d
jle 0x1400bbdea
mov r15d, edi
imul r15d, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400bb881
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.1400b0680
add rsi, r12
sub r14, 1
jne 0x1400bb860
mov r15d, dword [rsp + 0x34]
jmp 0x1400bbde5
mov r14d, dword [rsp + 0x34]
movsxd r12, r15d
nop dword [rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400b0680
add rsi, r12
sub r14, 1
jne 0x1400bb890
mov r15d, dword [rsp + 0x34]
jmp 0x1400bbde5
test r13d, r13d
jns 0x1400bb8c6
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x1400bb901
cmp qword [rbx + 0x10], r14
je 0x1400bb8fa
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r13d
jge 0x1400bb8fa
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 0x1400bb901
add qword [rbx + 0xb8], r13
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x1400bbe5c
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400bbe5c
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 0x1400bbe57
test ebp, ebp
je 0x1400bba8a
mov rsi, rax
cmp edi, 3
je 0x1400bb964
mov r8d, 0x1687
lea rdx, str.E:ReposDCRealisticlibsimgui_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 0x1400bbadd
mov r13d, edi
mov r15d, eax
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
nop
mov rcx, rbx
call fcn.1400b0810
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 0x1400bb990
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 0x1400bbd57
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 0x1400bbb33
test ebp, ebp
jne 0x1400bbb25
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbaed
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbb13
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.1400b0680
test eax, eax
jne 0x1400bba1b
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 0x1400bbe8d
mov rdi, rsi
jmp 0x1400bba1b
mov rdi, r14
jmp 0x1400bba1f
cmp dword [rbx + 0x30], r14d
je 0x1400bbb11
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbb13
xor cl, cl
movzx r15d, cl
mov ebp, r15d
and ebp, 0x7f
inc ebp
shr r15d, 7
jmp 0x1400bbb33
test r15d, r15d
je 0x1400bbb33
test r12d, r12d
je 0x1400bbcf1
cmp byte [rsp + 0xf0], r14b
je 0x1400bbbd2
cmp dword [rsp + 0x54], 8
jne 0x1400bbb98
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbb6a
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400bbba0
cmp dword [rbx + 0x30], r14d
je 0x1400bbb91
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400bbba0
xor cl, cl
movzx eax, cl
jmp 0x1400bbba0
mov rcx, rbx
call fcn.1400b0810
test r13d, r13d
je 0x1400bbce4
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 0x1400bbce4
cmp dword [rsp + 0xe8], r14d
je 0x1400bbc85
cmp r13d, 3
je 0x1400bbc00
mov r8d, 0x16bc
lea rdx, str.E:ReposDCRealisticlibsimgui_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.1400b0810
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 0x1400bbce4
mov rdi, r14
test r13d, r13d
je 0x1400bbce4
nop dword [rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbcaf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbcd5
cmp dword [rbx + 0x30], r14d
je 0x1400bbcd3
mov rcx, rbx
call fcn.1400b0610
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbcd5
xor cl, cl
mov byte [rsp + rdi + 0xf8], cl
inc rdi
cmp rdi, rsi
jl 0x1400bbc90
mov rcx, qword [rsp + 0x68]
mov r12d, r14d
mov rax, qword [rsp + 0x70]
mov rdi, r14
test r13d, r13d
je 0x1400bbd26
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 0x1400bbd14
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 0x1400bba57
mov r15d, dword [rsp + 0x34]
mov ecx, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400bbdce
test r15d, r15d
jle 0x1400bbdce
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 0x1400bbdba
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 0x1400bbda0
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, r15d
jl 0x1400bbd80
mov r13d, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x1400bbdde
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 0x1400bbe29
mov ecx, dword [rsp + 0xd0]
test ebp, ebp
jne 0x1400bbe30
mov eax, r15d
mov r8, rsi
imul eax, ecx
test eax, eax
je 0x1400bbe30
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 0x1400bbe10
mov ecx, dword [rsp + 0xd0]
cmp r13d, 4
je 0x1400bbe52
mov r9d, ecx
mov dword [rsp + 0x20], r15d
mov rcx, rsi
mov r8d, 4
mov edx, r13d
call fcn.1400b08d0
mov rsi, rax
mov rax, rsi
jmp 0x1400bbe98
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 0x1400bbe8d
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