Function at 0x18000d400
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x80
mov rax, qword [0x180159870]
xor rax, rsp
mov qword [rsp + 0x78], rax
mov rax, qword [rcx + 0xc0]
mov rbx, rcx
mov qword [rsp + 0x38], r8
mov qword [rsp + 0x48], rdx
cmp rax, qword [rcx + 0xc8]
jae 0x18000d44e
movzx edx, byte [rax]
inc rax
mov qword [rcx + 0xc0], rax
jmp 0x18000d471
cmp dword [rcx + 0x30], 0
je 0x18000d46f
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d471
xor dl, dl
mov ecx, 0x30
mov r8, rbx
mov qword [rsp + 0xd8], rsi
lea r13, [rcx + rbx]
movzx ecx, dl
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x68], r13
cmp rax, qword [rbx + 0xc8]
jae 0x18000d4a9
movzx esi, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d4d1
cmp dword [r13], 0
je 0x18000d4ce
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx esi, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d4d1
xor sil, sil
mov byte [rsp + 0x20], sil
cmp rax, qword [rbx + 0xc8]
jae 0x18000d4ee
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d515
cmp dword [r13], 0
je 0x18000d513
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d515
xor cl, cl
movzx ebp, cl
mov rcx, rbx
mov dword [rsp + 0x30], ebp
call fcn.180002ae0
mov rcx, rbx
mov dword [rsp + 0x24], eax
call fcn.180002ae0
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x40], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x18000d553
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x18000d57a
cmp dword [r13], 0
je 0x18000d578
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d57a
xor dl, dl
mov rcx, rbx
movzx edi, dl
call fcn.180002ae0
mov rcx, rbx
call fcn.180002ae0
mov rcx, rbx
call fcn.180002ae0
mov rcx, rbx
mov dword [rsp + 0x2c], eax
call fcn.180002ae0
mov dword [rsp + 0x44], eax
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18000d5c4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d5eb
cmp dword [r13], 0
je 0x18000d5e9
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d5eb
xor cl, cl
movzx r10d, cl
mov dword [rsp + 0x54], r10d
cmp rax, qword [rbx + 0xc8]
jae 0x18000d60c
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d638
cmp dword [r13], 0
je 0x18000d636
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
mov r10d, dword [rsp + 0x54]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000d638
xor cl, cl
mov r8d, dword [rsp + 0x44]
xor r14d, r14d
movzx eax, cl
mov r15d, r14d
mov qword [rsp + 0x60], r14
mov dword [rsp + 0x70], r14d
mov dword [rsp + 0x50], r14d
lea r12d, [r14 + 1]
cmp r8d, 0x1000000
jg 0x18000ddf1
mov r9d, dword [rsp + 0x2c]
cmp r9d, 0x1000000
jg 0x18000ddf1
cmp ebp, 8
lea edx, [rbp - 8]
mov ecx, r12d
cmovb edx, ebp
shr eax, 5
and eax, r12d
mov ebp, r14d
sub ecx, eax
mov dword [rsp + 0x58], ecx
test sil, sil
je 0x18000d6ba
mov ecx, edi
sub ecx, 8
je 0x18000d6b5
sub ecx, 7
je 0x18000d70f
sub ecx, r12d
je 0x18000d70f
sub ecx, 8
je 0x18000d6d9
cmp ecx, 8
jne 0x18000d6e2
jmp 0x18000d6d9
mov edi, r12d
jmp 0x18000d6dc
mov ecx, r10d
sub ecx, 8
je 0x18000d71b
sub ecx, 7
je 0x18000d70f
sub ecx, r12d
je 0x18000d701
sub ecx, 8
je 0x18000d6d6
cmp ecx, 8
jne 0x18000d6e2
mov edi, r10d
shr edi, 3
mov esi, edi
test edi, edi
jne 0x18000d721
mov edx, dword [0x1801e5294]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_format
jmp 0x18000de0b
cmp edx, 3
jne 0x18000d70f
mov edi, 2
mov esi, edi
jmp 0x18000d721
mov edi, 3
mov ebp, r12d
mov esi, edi
jmp 0x18000d721
mov edi, r12d
mov esi, r12d
mov rax, qword [rsp + 0x48]
mov dword [rax], r9d
mov rax, qword [rsp + 0x38]
mov dword [rax], r8d
test r9d, r9d
js 0x18000ddf1
test r8d, r8d
js 0x18000ddf1
je 0x18000d75f
mov eax, 0x7fffffff
mov ecx, r14d
cdq
idiv r8d
cmp r9d, eax
setle cl
test ecx, ecx
je 0x18000ddf1
mov ecx, r8d
imul ecx, r9d
test ecx, ecx
js 0x18000ddf1
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x18000ddf1
test r8d, r8d
je 0x18000d79e
mov eax, 0x7fffffff
mov ecx, r14d
cdq
idiv r8d
cmp r9d, eax
setle cl
test ecx, ecx
je 0x18000ddd5
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 + 0x38], rax
mov r8, rax
test rax, rax
je 0x18000ddd5
movsxd rdx, dword [rsp + 0x28]
test edx, edx
je 0x18000d806
cmp qword [rbx + 0x10], r14
je 0x18000d7ff
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x18000d7ff
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov r8, qword [rsp + 0x38]
jmp 0x18000d806
add qword [rbx + 0xc0], rdx
cmp byte [rsp + 0x20], r14b
jne 0x18000d8dc
mov r10d, dword [rsp + 0x30]
mov eax, edi
mov dword [rsp + 0x24], eax
mov dword [rsp + 0x28], ebp
cmp r10d, 8
jae 0x18000da8b
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x24], eax
test ebp, ebp
jne 0x18000da8b
mov r13d, dword [rsp + 0x44]
mov dword [rsp + 0x28], ebp
test r13d, r13d
jle 0x18000d8ca
mov r15d, edi
mov dword [rsp + 0x28], ebp
imul r15d, dword [rsp + 0x2c]
cmp dword [rsp + 0x58], r14d
mov r14d, r13d
je 0x18000d8ab
mov eax, r15d
neg eax
movsxd r12, eax
lea eax, [r13 - 1]
imul eax, edi
imul eax, dword [rsp + 0x2c]
movsxd rsi, eax
add rsi, r8
nop dword [rax]
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.180002950
add rsi, r12
sub r14, 1
jne 0x18000d880
imul r13d, dword [rsp + 0x2c]
mov eax, edi
mov rbp, qword [rsp + 0x38]
mov esi, eax
jmp 0x18000dd97
movsxd r12, r15d
mov rsi, r8
mov r8d, r15d
mov rdx, rsi
mov rcx, rbx
call fcn.180002950
add rsi, r12
sub r14, 1
jne 0x18000d8b1
mov eax, edi
imul r13d, dword [rsp + 0x2c]
mov rbp, qword [rsp + 0x38]
mov esi, eax
jmp 0x18000dd97
cmp dword [rsp + 0x40], r14d
jne 0x18000d90b
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x1801e5294]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_palette
jmp 0x18000de0b
movsxd rdx, dword [rsp + 0x24]
test edx, edx
je 0x18000d95c
jns 0x18000d926
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x18000d95c
cmp qword [rbx + 0x10], r14
je 0x18000d955
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x18000d955
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x18000d95c
add qword [rbx + 0xc0], rdx
mov r8d, dword [rsp + 0x40]
test r8d, r8d
js 0x18000ddca
xor edx, edx
mov eax, 0x7fffffff
div edi
mov ecx, r14d
cmp r8d, eax
setle cl
imul esi, r8d
test ecx, ecx
je 0x18000ddca
movsxd rcx, esi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x60], rax
test rax, rax
je 0x18000ddca
mov dword [rsp + 0x28], ebp
test ebp, ebp
je 0x18000da59
mov ecx, dword [rsp + 0x40]
mov rsi, rax
test ecx, ecx
jle 0x18000da51
mov eax, edi
mov r13d, ecx
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x24], edi
mov rcx, rbx
call fcn.180002ae0
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 r13, r12
jne 0x18000d9c8
mov r13, qword [rsp + 0x68]
mov eax, dword [rsp + 0x24]
jmp 0x18000da86
mov eax, edi
mov dword [rsp + 0x24], eax
jmp 0x18000da86
mov r8d, esi
mov dword [rsp + 0x24], edi
mov rdx, rax
mov rcx, rbx
call fcn.180002950
test eax, eax
jne 0x18000da84
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x60]
jmp 0x18000d8e6
mov eax, edi
mov r10d, dword [rsp + 0x30]
mov edi, dword [rsp + 0x44]
mov edx, edi
mov ecx, dword [rsp + 0x2c]
imul edx, ecx
mov esi, eax
mov dword [rsp + 0x68], edx
test edx, edx
je 0x18000dd07
movsxd rdi, dword [rsp + 0x24]
lea rax, [rsp + 0x70]
mov rbp, qword [rsp + 0x38]
mov r9, rdi
mov r8d, edx
sub rbp, rax
mov qword [rsp + 0x48], r8
cmp r10d, 8
jb 0x18000db39
test r15d, r15d
jne 0x18000db29
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18000daed
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000db13
cmp dword [r13], r14d
je 0x18000db11
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000db13
xor cl, cl
movzx eax, cl
mov r15d, eax
and r15d, 0x7f
inc r15d
shr eax, 7
mov dword [rsp + 0x50], eax
jmp 0x18000db39
cmp dword [rsp + 0x50], r14d
je 0x18000db39
test r12d, r12d
je 0x18000dcc5
cmp byte [rsp + 0x20], r14b
je 0x18000dbd1
cmp dword [rsp + 0x54], 8
jne 0x18000db9b
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18000db6d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x18000dba3
cmp dword [r13], r14d
je 0x18000db94
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x18000dba3
xor cl, cl
movzx eax, cl
jmp 0x18000dba3
mov rcx, rbx
call fcn.180002ae0
cmp eax, dword [rsp + 0x40]
cmovge eax, r14d
test rsi, rsi
je 0x18000dcb5
imul eax, edi
lea rcx, [rsp + 0x70]
mov r8, rsi
movsxd rdx, eax
add rdx, qword [rsp + 0x60]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x18000dcb5
cmp dword [rsp + 0x28], r14d
je 0x18000dc58
mov rcx, rbx
call fcn.180002ae0
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 + 0x70], 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 + 0x71], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0x72], dl
jmp 0x18000dcb5
mov rdi, r14
test rsi, rsi
je 0x18000dcb1
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18000dc7f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000dca5
cmp dword [r13], r14d
je 0x18000dca3
mov rcx, rbx
call fcn.1800028d0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18000dca5
xor cl, cl
mov byte [rsp + rdi + 0x70], cl
inc rdi
cmp rdi, rsi
jl 0x18000dc60
mov edi, dword [rsp + 0x24]
mov r8, qword [rsp + 0x48]
mov r12d, r14d
mov r10d, dword [rsp + 0x30]
movsxd r9, edi
mov rdx, r14
test rsi, rsi
je 0x18000dce6
nop dword [rax]
lea rcx, [rsp + 0x70]
add rcx, rdx
inc rdx
movzx eax, byte [rcx]
mov byte [rcx + rbp], al
cmp rdx, rsi
jl 0x18000dcd0
dec r15d
add rbp, r9
sub r8, 1
mov qword [rsp + 0x48], r8
jne 0x18000dac3
mov edi, dword [rsp + 0x44]
mov eax, dword [rsp + 0x24]
mov ecx, dword [rsp + 0x2c]
mov rbp, qword [rsp + 0x38]
cmp dword [rsp + 0x58], r14d
je 0x18000dd79
test edi, edi
jle 0x18000dd79
lea r10d, [rdi - 1]
mov r11d, eax
imul r10d, eax
mov ebx, r14d
imul r11d, ecx
imul r10d, ecx
nop dword [rax]
mov r8d, r11d
test r11d, r11d
jle 0x18000dd6a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + rbp]
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 0x18000dd50
add ebx, r11d
sub r10d, r11d
add r14d, 2
cmp r14d, edi
jl 0x18000dd30
mov rax, qword [rsp + 0x60]
mov ebx, dword [rsp + 0x68]
mov r13d, ebx
test rax, rax
je 0x18000dd93
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x24]
cmp eax, 3
jb 0x18000ddc5
cmp dword [rsp + 0x28], 0
jne 0x18000ddc5
mov rdx, rbp
test r13d, r13d
je 0x18000ddc5
mov r8d, r13d
nop
movzx ecx, byte [rdx]
movzx eax, byte [rdx + 2]
mov byte [rdx], al
mov byte [rdx + 2], cl
add rdx, rsi
sub r8, 1
jne 0x18000ddb0
mov rax, rbp
jmp 0x18000de16
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x1801e5294]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
jmp 0x18000de0b
mov edx, dword [0x1801e5294]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov ecx, 0x28
mov qword [rcx + rax], rdx
xor eax, eax
mov rsi, qword [rsp + 0xd8]
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.1800daf30
add rsp, 0x80
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rbp
pop rbx
ret