Function at 0x180010d50
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push r12
push r13
push r15
sub rsp, 0xa8
mov rax, qword [0x18021c8c0]
xor rax, rsp
mov qword [rsp + 0x90], rax
mov eax, dword [rsp + 0x100]
mov rbx, rcx
mov dword [rsp + 0x84], eax
xor ebp, ebp
mov rax, qword [rcx + 0xc0]
mov rcx, qword [rcx + 0xc8]
mov qword [rsp + 0x68], r8
mov qword [rsp + 0x48], rdx
cmp rax, rcx
jb 0x180010dbe
cmp dword [rbx + 0x30], ebp
je 0x180010de0
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
inc rax
movzx r8d, dl
mov dword [rsp + 0x5c], r8d
mov dword [rsp + 0x34], r8d
mov qword [rbx + 0xc0], rax
cmp rax, rcx
jae 0x180010de8
jmp 0x180010e03
mov dword [rsp + 0x5c], ebp
mov dword [rsp + 0x34], ebp
cmp dword [rbx + 0x30], ebp
je 0x180010e2c
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx esi, byte [rax]
inc rax
movzx edx, sil
mov dword [rsp + 0x58], edx
mov qword [rbx + 0xc0], rax
cmp rax, rcx
jae 0x180010e33
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180010e58
xor sil, sil
mov dword [rsp + 0x58], ebp
cmp dword [rbx + 0x30], ebp
je 0x180010e56
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180010e58
xor cl, cl
movzx eax, cl
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call fcn.180005a60
mov rcx, rbx
mov dword [rsp + 0x80], eax
call fcn.180005a60
mov rcx, qword [rbx + 0xc0]
mov dword [rsp + 0x50], eax
cmp rcx, qword [rbx + 0xc8]
jae 0x180010e99
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xc0], rcx
jmp 0x180010ebe
cmp dword [rbx + 0x30], ebp
je 0x180010ebc
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180010ebe
xor dl, dl
mov qword [rsp + 0xf8], rdi
mov rcx, rbx
mov qword [rsp + 0xa0], r14
movzx r15d, dl
call fcn.180005a60
mov rcx, rbx
call fcn.180005a60
mov rcx, rbx
call fcn.180005a60
mov rcx, rbx
mov dword [rsp + 0x40], eax
call fcn.180005a60
mov rcx, qword [rbx + 0xc8]
mov dword [rsp + 0x54], eax
mov rax, qword [rbx + 0xc0]
cmp rax, rcx
jb 0x180010f28
cmp dword [rbx + 0x30], ebp
je 0x180010f50
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
inc rax
movzx r14d, dl
mov qword [rbx + 0xc0], rax
mov edi, r14d
cmp rax, rcx
jae 0x180010f55
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180010f7a
mov r14d, ebp
mov edi, ebp
cmp dword [rbx + 0x30], ebp
je 0x180010f78
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180010f7a
xor cl, cl
mov r8d, dword [rsp + 0x54]
mov r12d, ebp
movzx eax, cl
mov r13d, 1
mov qword [rsp + 0x78], rbp
mov dword [rsp + 0x88], ebp
mov dword [rsp + 0x60], ebp
cmp r8d, 0x1000000
jg 0x18001173d
mov r9d, dword [rsp + 0x40]
cmp r9d, 0x1000000
jg 0x18001173d
mov edx, dword [rsp + 0x3c]
cmp edx, 8
mov dword [rsp + 0x38], ebp
lea ecx, [rdx - 8]
cmovb ecx, edx
shr eax, 5
and eax, r13d
mov edx, r13d
sub edx, eax
mov dword [rsp + 0x64], edx
cmp dword [rsp + 0x58], ebp
je 0x180010ffe
mov ecx, r15d
sub ecx, 8
je 0x18001105e
sub ecx, 7
je 0x180011051
sub ecx, r13d
je 0x180011051
sub ecx, 8
je 0x18001101a
cmp ecx, 8
jne 0x180011027
jmp 0x18001101a
sub edi, 8
je 0x18001105e
sub edi, 7
je 0x180011051
sub edi, r13d
je 0x180011046
sub edi, 8
je 0x180011017
cmp edi, 8
jne 0x180011027
mov r15d, r14d
shr r15d, 3
mov dword [rsp + 0x38], ebp
test r15d, r15d
jne 0x180011061
mov edx, dword [0x1802e1e34]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_format
jmp 0x180011757
cmp ecx, 3
jne 0x180011051
lea r15d, [rcx - 1]
jmp 0x180011061
mov r15d, 3
mov dword [rsp + 0x38], r13d
jmp 0x180011061
mov r15d, r13d
mov rax, qword [rsp + 0x48]
mov dword [rax], r9d
mov rax, qword [rsp + 0x68]
mov dword [rax], r8d
test r9d, r9d
js 0x18001173d
test r8d, r8d
js 0x18001173d
je 0x18001109e
mov eax, 0x7fffffff
mov ecx, ebp
cdq
idiv r8d
cmp r9d, eax
setle cl
test ecx, ecx
je 0x18001173d
mov ecx, r8d
imul ecx, r9d
mov dword [rsp + 0x68], ecx
test ecx, ecx
js 0x18001173d
xor edx, edx
mov eax, 0x7fffffff
div r15d
mov edi, eax
cmp ecx, eax
jg 0x18001173d
test r8d, r8d
je 0x1800110dc
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x180011721
mov eax, r15d
imul eax, r8d
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 rdx, rax
test rax, rax
je 0x180011721
cmp dword [rsp + 0x5c], ebp
je 0x180011149
mov edx, dword [rsp + 0x34]
cmp qword [rbx + 0x10], rbp
je 0x18001113a
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x18001113a
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
jmp 0x180011144
movsxd rax, edx
add qword [rbx + 0xc0], rax
mov rdx, qword [rsp + 0x48]
cmp dword [rsp + 0x58], ebp
jne 0x1800111fe
mov ecx, dword [rsp + 0x3c]
mov edi, r14d
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
cmp ecx, 8
jae 0x180011378
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
test eax, eax
jne 0x180011378
mov r13d, dword [rsp + 0x54]
mov r12d, dword [rsp + 0x40]
test r13d, r13d
jle 0x1800116af
mov ebp, r12d
mov edi, r13d
imul ebp, r15d
cmp dword [rsp + 0x64], eax
je 0x1800111dc
mov eax, ebp
neg eax
movsxd r14, eax
lea eax, [r13 - 1]
imul eax, r15d
imul eax, r12d
movsxd rsi, eax
add rsi, rdx
nop
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.1800058d0
add rsi, r14
sub rdi, 1
jne 0x1800111c0
jmp 0x1800116ab
movsxd r14, ebp
mov rsi, rdx
mov r8d, ebp
mov rdx, rsi
mov rcx, rbx
call fcn.1800058d0
add rsi, r14
sub rdi, 1
jne 0x1800111e2
jmp 0x1800116ab
cmp dword [rsp + 0x50], ebp
jne 0x18001122c
mov rcx, rdx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x1802e1e34]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_palette
jmp 0x180011757
movsxd rdx, dword [rsp + 0x80]
test edx, edx
je 0x180011280
jns 0x18001124a
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x180011280
cmp qword [rbx + 0x10], rbp
je 0x180011279
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x180011279
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
jmp 0x180011280
add qword [rbx + 0xc0], rdx
mov ecx, dword [rsp + 0x50]
test ecx, ecx
js 0x180011716
cmp ecx, edi
mov eax, ebp
setle al
test eax, eax
je 0x180011716
mov edi, r15d
imul edi, ecx
movsxd rcx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x180011716
mov dword [rsp + 0x34], r14d
mov byte [rsp + 0x30], sil
cmp dword [rsp + 0x38], ebp
je 0x1800113d3
mov ecx, dword [rsp + 0x50]
mov rdi, rax
test ecx, ecx
jle 0x180011371
mov byte [rsp + 0x30], sil
mov r12d, ecx
mov esi, r15d
mov dword [rsp + 0x34], r14d
nop dword [rax + rax]
mov rcx, rbx
call fcn.180005a60
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 [rdi], 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 [rdi + 1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rdi + 2], dl
add rdi, rsi
sub r12, r13
jne 0x1800112f0
mov r12d, ebp
mov ecx, dword [rsp + 0x3c]
mov edi, r14d
mov eax, dword [rsp + 0x68]
mov esi, r15d
test eax, eax
jle 0x180011627
mov r14, qword [rsp + 0x48]
lea rdx, [rsp + 0x88]
sub r14, rdx
mov r9d, r15d
mov r8d, eax
mov qword [rsp + 0x70], rax
cmp ecx, 8
jb 0x180011444
test r12d, r12d
jne 0x180011435
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800113fa
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18001141f
mov r8d, edi
mov rdx, rax
mov rcx, rbx
call fcn.1800058d0
test eax, eax
jne 0x180011371
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x78]
jmp 0x180011207
cmp dword [rbx + 0x30], ebp
je 0x18001141d
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18001141f
xor cl, cl
movzx eax, cl
mov r12d, eax
and r12d, 0x7f
inc r12d
shr eax, 7
mov dword [rsp + 0x60], eax
jmp 0x180011444
cmp dword [rsp + 0x60], ebp
je 0x180011444
test r13d, r13d
je 0x1800115de
cmp byte [rsp + 0x30], bpl
je 0x1800114dc
cmp edi, 8
jne 0x1800114a3
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180011476
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x1800114ab
cmp dword [rbx + 0x30], ebp
je 0x18001149c
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
movzx eax, cl
jmp 0x1800114ab
xor cl, cl
movzx eax, cl
jmp 0x1800114ab
mov rcx, rbx
call fcn.180005a60
cmp eax, dword [rsp + 0x50]
cmovge eax, ebp
test r15d, r15d
je 0x1800115d3
imul eax, r15d
lea rcx, [rsp + 0x88]
mov r8, rsi
movsxd rdx, eax
add rdx, qword [rsp + 0x78]
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1800115d3
cmp dword [rsp + 0x38], ebp
je 0x18001156b
mov rcx, rbx
call fcn.180005a60
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 0x1800115d3
mov rdi, rbp
test r15d, r15d
je 0x1800115d3
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18001159f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800115c4
cmp dword [rbx + 0x30], ebp
je 0x1800115c2
mov rcx, rbx
call fcn.180005850
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800115c4
xor cl, cl
mov byte [rsp + rdi + 0x88], cl
inc rdi
cmp rdi, rsi
jl 0x180011580
mov r8, qword [rsp + 0x70]
mov r13d, ebp
mov r9d, r15d
mov rdx, rbp
test r15d, r15d
je 0x18001160a
nop word [rax + rax]
lea rcx, [rsp + 0x88]
add rcx, rdx
inc rdx
movzx eax, byte [rcx]
mov byte [rcx + r14], al
cmp rdx, rsi
jl 0x1800115f0
mov edi, dword [rsp + 0x34]
dec r12d
mov ecx, dword [rsp + 0x3c]
add r14, r9
sub r8, 1
mov qword [rsp + 0x70], r8
jne 0x1800113a2
mov r13d, dword [rsp + 0x54]
mov r12d, dword [rsp + 0x40]
cmp dword [rsp + 0x64], ebp
je 0x180011698
test r13d, r13d
jle 0x180011698
mov rdi, qword [rsp + 0x48]
lea r10d, [r13 - 1]
imul r10d, r15d
mov r11d, r15d
imul r11d, r12d
mov ebx, ebp
imul r10d, r12d
mov r8d, r11d
test r11d, r11d
jle 0x18001168a
movsxd rax, ebx
movsxd r9, r10d
sub r9, rax
lea rdx, [rdi + rax]
nop dword [rax + rax]
movzx eax, byte [rdx + r9]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [rdx + r9], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x180011670
add ebx, r11d
sub r10d, r11d
add ebp, 2
cmp ebp, r13d
jl 0x180011656
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x1800116ab
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [rsp + 0x38]
cmp r15d, 3
jb 0x1800116e9
test eax, eax
mov rax, qword [rsp + 0x48]
jne 0x1800116ee
mov ecx, dword [rsp + 0x68]
mov r10, rax
test ecx, ecx
jle 0x1800116ee
mov ebx, r15d
mov r11d, ecx
nop
movzx ecx, byte [r10]
movzx eax, byte [r10 + 2]
mov byte [r10], al
mov byte [r10 + 2], cl
add r10, rbx
sub r11, 1
jne 0x1800116d0
mov rax, qword [rsp + 0x48]
mov ecx, dword [rsp + 0x84]
test ecx, ecx
je 0x180011762
cmp ecx, r15d
je 0x180011762
mov r8d, ecx
mov dword [rsp + 0x20], r13d
mov rcx, rax
mov r9d, r12d
mov edx, r15d
call fcn.180005b20
jmp 0x180011762
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x1802e1e34]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
jmp 0x180011757
mov edx, dword [0x1802e1e34]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov ecx, Ordinal_41
mov qword [rcx + rax], rdx
xor eax, eax
mov r14, qword [rsp + 0xa0]
mov rdi, qword [rsp + 0xf8]
mov rcx, qword [rsp + 0x90]
xor rcx, rsp
call fcn.180172080
add rsp, 0xa8
pop r15
pop r13
pop r12
pop rsi
pop rbp
pop rbx
ret