Function at 0x1400353f0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
mov rax, qword [0x140207010]
xor rax, rsp
mov qword [rsp + 0x90], rax
mov rax, qword [rcx + 0xb8]
mov rbx, rcx
mov qword [rsp + 0x70], r8
mov qword [rsp + 0x58], rdx
cmp rax, qword [rcx + 0xc0]
jae 0x140035446
movzx r8d, byte [rax]
inc rax
mov qword [rcx + 0xb8], rax
jmp 0x14003546b
cmp dword [rcx + 0x30], 0
je 0x140035468
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx r8d, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x14003546b
xor r8b, r8b
mov ecx, 0x30
mov byte [rsp + 0x31], r8b
mov rdx, rbx
lea r12, [rcx + rbx]
movzx ecx, r8b
mov dword [rsp + 0x38], ecx
mov qword [rsp + 0x80], r12
cmp rax, qword [rbx + 0xc0]
jae 0x1400354a4
movzx esi, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400354cc
cmp dword [r12], 0
je 0x1400354c9
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx esi, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400354cc
xor sil, sil
mov byte [rsp + 0x30], sil
cmp rax, qword [rbx + 0xc0]
jae 0x1400354e9
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035510
cmp dword [r12], 0
je 0x14003550e
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035510
xor cl, cl
movzx ebp, cl
mov rcx, rbx
mov dword [rsp + 0x40], ebp
call fcn.14002a740
mov rcx, rbx
mov dword [rsp + 0x34], eax
call fcn.14002a740
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x14003554e
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x140035575
cmp dword [r12], 0
je 0x140035573
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035575
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.14002a740
mov rcx, rbx
call fcn.14002a740
mov rcx, rbx
call fcn.14002a740
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.14002a740
mov dword [rsp + 0x44], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400355bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400355e6
cmp dword [r12], 0
je 0x1400355e4
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400355e6
xor cl, cl
movzx r8d, cl
mov dword [rsp + 0x64], r8d
cmp rax, qword [rbx + 0xc0]
jae 0x140035607
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035633
cmp dword [r12], 0
je 0x140035631
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
mov r8d, dword [rsp + 0x64]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035633
xor cl, cl
xor r14d, r14d
movzx eax, cl
cmp ebp, 8
mov qword [rsp + 0x78], r14
lea edx, [rbp - 8]
mov dword [rsp + 0x88], r14d
cmovb edx, ebp
mov dword [rsp + 0x60], r14d
shr eax, 5
lea r13d, [r14 + 1]
and eax, r13d
mov ecx, r13d
sub ecx, eax
mov r15d, r14d
mov dword [rsp + 0x68], ecx
mov ebp, r14d
test sil, sil
je 0x140035694
mov ecx, edi
sub ecx, 8
je 0x14003568f
sub ecx, 7
je 0x1400356e2
sub ecx, r13d
je 0x1400356e2
sub ecx, 8
je 0x1400356b3
cmp ecx, 8
jne 0x1400356bc
jmp 0x1400356b3
mov edi, r13d
jmp 0x1400356b6
mov ecx, r8d
sub ecx, 8
je 0x1400356ee
sub ecx, 7
je 0x1400356e2
sub ecx, r13d
je 0x1400356d4
sub ecx, 8
je 0x1400356b0
cmp ecx, 8
jne 0x1400356bc
mov edi, r8d
shr edi, 3
mov esi, edi
test edi, edi
jne 0x1400356f4
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x140035df0
cmp edx, 3
jne 0x1400356e2
mov edi, 2
mov esi, edi
jmp 0x1400356f4
mov edi, 3
mov ebp, r13d
mov esi, edi
jmp 0x1400356f4
mov edi, r13d
mov esi, r13d
mov rax, qword [rsp + 0x58]
mov r9d, dword [rsp + 0x3c]
mov r8d, dword [rsp + 0x44]
mov dword [rax], r9d
mov rax, qword [rsp + 0x70]
mov dword [rax], r8d
test r9d, r9d
js 0x140035ddd
test r8d, r8d
js 0x140035ddd
je 0x140035734
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140035ddd
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x140035ddd
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x140035ddd
test r8d, r8d
je 0x14003576b
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x140035dc8
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 + 0x48], rax
mov r8, rax
test rax, rax
je 0x140035dc8
cmp qword [rbx + 0x10], r14
je 0x1400357c7
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
mov edx, dword [rsp + 0x38]
cmp ecx, edx
jge 0x1400357c7
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
mov r8, qword [rsp + 0x48]
jmp 0x1400357d3
movzx eax, byte [rsp + 0x31]
add qword [rbx + 0xb8], rax
cmp byte [rsp + 0x30], r14b
jne 0x1400358ab
mov edx, dword [rsp + 0x40]
mov dword [rsp + 0x34], ebp
cmp edx, 8
jae 0x140035a88
mov dword [rsp + 0x34], ebp
test ebp, ebp
jne 0x140035a88
mov r13d, dword [rsp + 0x44]
mov dword [rsp + 0x34], ebp
test r13d, r13d
jle 0x140035898
mov r15d, edi
mov dword [rsp + 0x34], ebp
imul r15d, dword [rsp + 0x3c]
mov ebp, edi
cmp dword [rsp + 0x68], r14d
mov r14d, r13d
je 0x140035868
mov eax, r15d
neg eax
movsxd r12, eax
lea eax, [r13 - 1]
imul eax, edi
imul eax, dword [rsp + 0x3c]
movsxd rsi, eax
add rsi, r8
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.14002a5b0
add rsi, r12
sub r14, 1
jne 0x140035840
mov edx, dword [rsp + 0x3c]
mov edi, r13d
imul edi, edx
mov esi, ebp
jmp 0x140035d60
movsxd r12, r15d
mov rsi, r8
nop
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.14002a5b0
add rsi, r12
sub r14, 1
jne 0x140035870
mov edx, dword [rsp + 0x3c]
mov edi, r13d
imul edi, edx
mov esi, ebp
jmp 0x140035d60
mov edx, dword [rsp + 0x3c]
mov ebp, edi
mov edi, r13d
mov esi, ebp
imul edi, edx
jmp 0x140035d60
movsxd rdx, dword [rsp + 0x34]
test edx, edx
jns 0x1400358c4
mov rax, qword [rbx + 0xc0]
mov qword [rbx + 0xb8], rax
jmp 0x1400358fa
cmp qword [rbx + 0x10], r14
je 0x1400358f3
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xb8]
cmp ecx, edx
jge 0x1400358f3
mov rax, qword [rbx + 0xc0]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xb8], rax
call qword [rbx + 0x18]
jmp 0x1400358fa
add qword [rbx + 0xb8], rdx
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x140035dbd
xor edx, edx
imul esi, ecx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x140035dbd
movsxd rcx, esi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x140035dbd
mov dword [rsp + 0x34], ebp
test ebp, ebp
mov ebp, edi
je 0x140035a48
mov ecx, dword [rsp + 0x50]
mov rsi, rax
test ecx, ecx
jle 0x1400359de
mov eax, edi
mov r12d, ecx
mov qword [rsp + 0x58], rax
mov rcx, rbx
call fcn.14002a740
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 r12, r13
jne 0x140035958
mov r12, qword [rsp + 0x80]
mov edx, dword [rsp + 0x40]
mov edi, dword [rsp + 0x44]
mov eax, dword [rsp + 0x3c]
imul edi, eax
mov esi, ebp
mov dword [rsp + 0x38], edi
test edi, edi
je 0x140035cce
mov rax, qword [rsp + 0x48]
lea rcx, [rsp + 0x88]
sub rax, rcx
mov ecx, edi
mov qword [rsp + 0x58], rcx
mov qword [rsp + 0x70], rax
cmp edx, 8
jb 0x140035adb
test r15d, r15d
jne 0x140035acb
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140035a8f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035ab5
mov r8d, esi
mov rdx, rax
mov rcx, rbx
call fcn.14002a5b0
test eax, eax
jne 0x1400359de
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x78]
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 0x140035df0
mov ebp, edi
jmp 0x1400359e2
cmp dword [r12], r14d
je 0x140035ab3
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035ab5
xor cl, cl
movzx eax, cl
mov r15d, eax
and r15d, 0x7f
inc r15d
shr eax, 7
mov dword [rsp + 0x60], eax
jmp 0x140035adb
cmp dword [rsp + 0x60], r14d
je 0x140035adb
test r13d, r13d
je 0x140035c71
cmp byte [rsp + 0x30], r14b
je 0x140035b77
cmp dword [rsp + 0x64], 8
jne 0x140035b3d
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140035b0f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x140035b45
cmp dword [r12], r14d
je 0x140035b36
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x140035b45
xor cl, cl
movzx eax, cl
jmp 0x140035b45
mov rcx, rbx
call fcn.14002a740
test ebp, ebp
je 0x140035c64
cmp eax, dword [rsp + 0x50]
mov ecx, r14d
mov r8, rsi
cmovl ecx, eax
imul ecx, ebp
movsxd rdx, ecx
lea rcx, [rsp + 0x88]
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140035c64
cmp dword [rsp + 0x34], r14d
je 0x140035c07
mov rcx, rbx
call fcn.14002a740
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 + 0x88], 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 + 0x89], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x8a], dl
jmp 0x140035c64
mov rdi, r14
test ebp, ebp
je 0x140035c64
nop
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x140035c2f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035c55
cmp dword [r12], r14d
je 0x140035c53
mov rcx, rbx
call fcn.14002a540
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x140035c55
xor cl, cl
mov byte [rsp + rdi + 0x88], cl
inc rdi
cmp rdi, rsi
jl 0x140035c10
mov rax, qword [rsp + 0x70]
mov r13d, r14d
mov rcx, qword [rsp + 0x58]
mov rdi, r14
test ebp, ebp
je 0x140035ca5
lea rcx, [rsp + 0x88]
mov r8, rsi
add rcx, rax
lea rdx, [rsp + 0x88]
call sub.VCRUNTIME140.dll_memcpy
inc rdi
cmp rdi, rsi
jl 0x140035c93
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x58]
movsxd rdx, ebp
dec r15d
add rax, rdx
mov edx, dword [rsp + 0x40]
sub rcx, 1
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x58], rcx
jne 0x140035a17
mov edi, dword [rsp + 0x38]
mov eax, dword [rsp + 0x3c]
mov r13d, dword [rsp + 0x44]
cmp dword [rsp + 0x68], r14d
je 0x140035d49
test r13d, r13d
jle 0x140035d49
mov r15, qword [rsp + 0x48]
lea r10d, [r13 - 1]
imul r10d, ebp
mov r11d, ebp
imul r11d, eax
mov ebx, r14d
imul r10d, eax
nop word [rax + rax]
mov r8d, r11d
test r11d, r11d
jle 0x140035d3a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r15]
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 0x140035d20
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, r13d
jl 0x140035d00
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x140035d5c
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [rsp + 0x3c]
mov rax, qword [rsp + 0x48]
cmp ebp, 3
jb 0x140035d9e
cmp dword [rsp + 0x34], 0
jne 0x140035d9e
mov r8, rax
test edi, edi
je 0x140035d9e
mov r10d, edi
nop dword [rax + rax]
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, rsi
sub r10, 1
jne 0x140035d80
mov rax, qword [rsp + 0x48]
cmp ebp, 4
je 0x140035dfb
mov r9d, edx
mov dword [rsp + 0x20], r13d
mov edx, ebp
mov r8d, 4
mov rcx, rax
call fcn.14002a800
jmp 0x140035dfb
mov rcx, qword [rsp + 0x48]
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 0x140035df0
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
mov rcx, qword [rsp + 0x90]
xor rcx, rsp
call fcn.1400762e0
mov rbx, qword [rsp + 0xf8]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret