Function at 0x1400bbc30
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 0x1400bbc75
movzx r8d, byte [rax]
inc rax
mov qword [rcx + 0xb8], rax
jmp 0x1400bbc9a
cmp dword [rcx + 0x30], 0
je 0x1400bbc97
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx r8d, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbc9a
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 0x1400bbcce
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbcf4
cmp dword [rsi], 0
je 0x1400bbcf1
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ebp, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbcf4
xor bpl, bpl
mov byte [rsp + 0xf0], bpl
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbd14
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbd39
cmp dword [rsi], 0
je 0x1400bbd37
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbd39
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x38], eax
mov r15d, eax
call fcn.1400b1020
mov rcx, rbx
movsxd r13, eax
call fcn.1400b1020
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x1400bbd79
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x1400bbd9e
cmp dword [rsi], 0
je 0x1400bbd9c
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbd9e
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.1400b1020
mov rcx, rbx
call fcn.1400b1020
mov rcx, rbx
call fcn.1400b1020
mov rcx, rbx
mov dword [rsp + 0xd0], eax
call fcn.1400b1020
mov dword [rsp + 0x34], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbdeb
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbe10
cmp dword [rsi], 0
je 0x1400bbe0e
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbe10
xor cl, cl
movzx edx, cl
mov dword [rsp + 0x54], edx
cmp rax, qword [rbx + 0xc0]
jae 0x1400bbe2f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbe58
cmp dword [rsi], 0
je 0x1400bbe56
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
mov edx, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bbe58
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 0x1400bbe79
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 0x1400bbeb2
mov ecx, edi
sub ecx, 8
je 0x1400bbead
sub ecx, 7
je 0x1400bbefa
sub ecx, r12d
je 0x1400bbefa
sub ecx, 8
je 0x1400bbecf
cmp ecx, 8
jne 0x1400bbed6
jmp 0x1400bbecf
mov edi, r12d
jmp 0x1400bbed2
mov ecx, edx
sub ecx, 8
je 0x1400bbf04
sub ecx, 7
je 0x1400bbefa
sub ecx, r12d
je 0x1400bbeee
sub ecx, 8
je 0x1400bbecd
cmp ecx, 8
jne 0x1400bbed6
mov edi, edx
shr edi, 3
test edi, edi
jne 0x1400bbf07
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x1400bc69d
cmp r15d, 3
jne 0x1400bbefa
lea edi, [r15 - 1]
jmp 0x1400bbf07
mov ebp, r12d
mov edi, 3
jmp 0x1400bbf07
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 0x1400bc68a
test r15d, r15d
js 0x1400bc68a
je 0x1400bbf50
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400bc68a
mov ecx, r15d
imul ecx, r8d
test ecx, ecx
js 0x1400bc68a
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400bc68a
test r15d, r15d
je 0x1400bbf87
mov eax, 0x7fffffff
cdq
idiv r15d
cmp r8d, eax
jg 0x1400bc675
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 0x1400bc675
cmp qword [rbx + 0x10], r14
je 0x1400bbfde
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x30]
cmp ecx, edx
jge 0x1400bbfde
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x1400bbfed
movzx eax, byte [rsp + 0xe8]
add qword [rbx + 0xb8], rax
cmp byte [rsp + 0xf0], r14b
jne 0x1400bc0c1
mov edx, dword [rsp + 0x38]
mov r13d, edi
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
cmp edx, 8
jae 0x1400bc2f5
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
test ebp, ebp
jne 0x1400bc2f5
test r15d, r15d
jle 0x1400bc5fa
mov r15d, edi
imul r15d, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400bc091
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.1400b0e90
add rsi, r12
sub r14, 1
jne 0x1400bc070
mov r15d, dword [rsp + 0x34]
jmp 0x1400bc5f5
mov r14d, dword [rsp + 0x34]
movsxd r12, r15d
nop dword [rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.1400b0e90
add rsi, r12
sub r14, 1
jne 0x1400bc0a0
mov r15d, dword [rsp + 0x34]
jmp 0x1400bc5f5
test r13d, r13d
jns 0x1400bc0d6
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x1400bc111
cmp qword [rbx + 0x10], r14
je 0x1400bc10a
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, r13d
jge 0x1400bc10a
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 0x1400bc111
add qword [rbx + 0xb8], r13
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x1400bc66c
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x1400bc66c
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 0x1400bc667
test ebp, ebp
je 0x1400bc29a
mov rsi, rax
cmp edi, 3
je 0x1400bc174
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 0x1400bc2ed
mov r13d, edi
mov r15d, eax
mov dword [rsp + 0xe8], ebp
mov dword [rsp + 0x30], edi
nop
mov rcx, rbx
call fcn.1400b1020
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 0x1400bc1a0
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 0x1400bc567
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 0x1400bc343
test ebp, ebp
jne 0x1400bc335
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bc2fd
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bc323
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.1400b0e90
test eax, eax
jne 0x1400bc22b
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 0x1400bc69d
mov rdi, rsi
jmp 0x1400bc22b
mov rdi, r14
jmp 0x1400bc22f
cmp dword [rbx + 0x30], r14d
je 0x1400bc321
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bc323
xor cl, cl
movzx r15d, cl
mov ebp, r15d
and ebp, 0x7f
inc ebp
shr r15d, 7
jmp 0x1400bc343
test r15d, r15d
je 0x1400bc343
test r12d, r12d
je 0x1400bc501
cmp byte [rsp + 0xf0], r14b
je 0x1400bc3e2
cmp dword [rsp + 0x54], 8
jne 0x1400bc3a8
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bc37a
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400bc3b0
cmp dword [rbx + 0x30], r14d
je 0x1400bc3a1
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400bc3b0
xor cl, cl
movzx eax, cl
jmp 0x1400bc3b0
mov rcx, rbx
call fcn.1400b1020
test r13d, r13d
je 0x1400bc4f4
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 0x1400bc4f4
cmp dword [rsp + 0xe8], r14d
je 0x1400bc495
cmp r13d, 3
je 0x1400bc410
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.1400b1020
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 0x1400bc4f4
mov rdi, r14
test r13d, r13d
je 0x1400bc4f4
nop dword [rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400bc4bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bc4e5
cmp dword [rbx + 0x30], r14d
je 0x1400bc4e3
mov rcx, rbx
call fcn.1400b0e20
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400bc4e5
xor cl, cl
mov byte [rsp + rdi + 0xf8], cl
inc rdi
cmp rdi, rsi
jl 0x1400bc4a0
mov rcx, qword [rsp + 0x68]
mov r12d, r14d
mov rax, qword [rsp + 0x70]
mov rdi, r14
test r13d, r13d
je 0x1400bc536
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 0x1400bc524
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 0x1400bc267
mov r15d, dword [rsp + 0x34]
mov ecx, dword [rsp + 0xd0]
cmp dword [rsp + 0x58], r14d
je 0x1400bc5de
test r15d, r15d
jle 0x1400bc5de
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 0x1400bc5ca
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 0x1400bc5b0
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, r15d
jl 0x1400bc590
mov r13d, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x1400bc5ee
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 0x1400bc639
mov ecx, dword [rsp + 0xd0]
test ebp, ebp
jne 0x1400bc640
mov eax, r15d
mov r8, rsi
imul eax, ecx
test eax, eax
je 0x1400bc640
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 0x1400bc620
mov ecx, dword [rsp + 0xd0]
cmp r13d, 4
je 0x1400bc662
mov r9d, ecx
mov dword [rsp + 0x20], r15d
mov rcx, rsi
mov r8d, 4
mov edx, r13d
call fcn.1400b10e0
mov rsi, rax
mov rax, rsi
jmp 0x1400bc6a8
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 0x1400bc69d
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