Function at 0x180027c10
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov dword [rsp + 0x18], r8d
mov dword [rsp + 0x10], edx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1378]
sub rsp, 0x1478
mov r12, rcx
mov byte [rbp + 0x13c0], 0
xor ecx, ecx
mov dword [rsp + 0x44], 1
xor eax, eax
mov dword [rsp + 0x50], ecx
xor r13b, r13b
mov dword [rsp + 0x48], ecx
mov rbx, qword [r12]
mov r14d, ecx
mov dword [rsp + 0x60], ecx
mov r15d, ecx
mov dword [rsp + 0x4c], ecx
mov edi, edx
mov dword [rsp + 0x5c], ecx
mov qword [r12 + 0x10], rcx
mov qword [r12 + 8], rcx
mov qword [r12 + 0x18], rcx
mov byte [rbp + 0x13d8], r13b
mov r13d, ecx
mov rcx, rbx
mov word [rsp + 0x40], ax
mov byte [rsp + 0x42], al
call fcn.1800211f0
test eax, eax
je 0x180027d56
cmp edi, 1
je 0x18002885b
mov rcx, rbx
call fcn.180023700
mov rcx, rbx
mov esi, eax
call fcn.180023700
shl esi, 0x10
mov rcx, rbx
add esi, eax
call fcn.180023700
mov rcx, rbx
mov edi, eax
call fcn.180023700
shl edi, 0x10
add eax, edi
cmp eax, 0x49484452
ja 0x1800280ad
je 0x180027e1a
cmp eax, 0x43674249
je 0x180027e0d
cmp eax, 0x49444154
je 0x180027d6c
cmp eax, 0x49454e44
jne 0x1800280bf
cmp dword [rsp + 0x44], 0
jne 0x180027d56
cmp dword [rbp + 0x13c8], 0
jne 0x18002885b
mov rdi, qword [r12 + 8]
test rdi, rdi
je 0x180027d56
mov eax, dword [rbx]
imul eax, dword [r12 + 0x20]
add eax, 7
shr eax, 3
imul eax, dword [rbx + 8]
inc eax
imul eax, dword [rbx + 4]
movsxd rsi, eax
mov rcx, rsi
call fcn.180042e50
mov rcx, rax
test rax, rax
jne 0x1800283e7
mov qword [r12 + 0x10], rax
xor eax, eax
add rsp, 0x1478
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
cmp dword [rsp + 0x44], 0
jne 0x180027d56
movzx eax, byte [rbp + 0x13c0]
test al, al
je 0x180027d83
test r14d, r14d
je 0x180027d56
cmp dword [rbp + 0x13c8], 2
je 0x180028847
mov eax, dword [rsp + 0x50]
lea edi, [rsi + rax]
cmp edi, eax
jl 0x180027d56
cmp edi, r13d
jbe 0x180027dea
mov eax, r13d
test r13d, r13d
jne 0x180027dc0
mov r13d, 0x1000
cmp esi, r13d
cmova r13d, esi
cmp edi, r13d
jbe 0x180027dc8
nop word [rax + rax]
add r13d, r13d
cmp edi, r13d
ja 0x180027dc0
mov rcx, qword [r12 + 8]
mov rdx, rax
mov r8d, r13d
call fcn.180043110
test rax, rax
je 0x180027d56
mov qword [r12 + 8], rax
mov eax, dword [rsp + 0x50]
mov edx, eax
mov r8d, esi
add rdx, qword [r12 + 8]
mov rcx, rbx
call fcn.1800239b0
test eax, eax
je 0x180027d56
mov dword [rsp + 0x50], edi
jmp 0x1800283d2
mov dword [rsp + 0x5c], 1
jmp 0x1800280d4
cmp dword [rsp + 0x44], 0
je 0x180027d56
xor eax, eax
mov dword [rsp + 0x44], eax
cmp esi, 0xd
jne 0x180027d56
mov rcx, rbx
call fcn.180023700
mov rcx, rbx
mov edi, eax
call fcn.180023700
shl edi, 0x10
mov rcx, rbx
add eax, edi
mov dword [rbx], eax
call fcn.180023700
mov rcx, rbx
mov edi, eax
call fcn.180023700
shl edi, 0x10
lea ecx, [rax + rdi]
mov dword [rbx + 4], ecx
cmp ecx, 0x1000000
ja 0x180027d56
cmp dword [rbx], 0x1000000
ja 0x180027d56
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180027e9f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180027ec5
cmp dword [rbx + 0x30], 0
je 0x180027ec3
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180027ec5
xor cl, cl
mov rax, rbx
mov edx, 0x30
movzx eax, cl
mov dword [r12 + 0x20], eax
lea rdi, [rdx + rbx]
cmp eax, 0x10
ja 0x180027d56
mov ecx, 0x10116
bt ecx, eax
jae 0x180027d56
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180027f0f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180027f34
cmp dword [rdi], 0
je 0x180027f32
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180027f34
xor cl, cl
movzx r15d, cl
mov dword [rsp + 0x4c], r15d
cmp r15d, 6
ja 0x180027d56
cmp r15d, 3
jne 0x180027f66
cmp dword [r12 + 0x20], 0x10
je 0x180027d56
movzx esi, r15b
mov byte [rbp + 0x13c0], r15b
jmp 0x180027f77
test r15b, 1
jne 0x180027d56
movzx esi, byte [rbp + 0x13c0]
cmp rax, qword [rbx + 0xc8]
jb 0x180027f94
cmp dword [rdi], 0
je 0x180027fa9
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
test cl, cl
jne 0x180027d56
cmp rax, qword [rbx + 0xc8]
jb 0x180027fc6
cmp dword [rdi], 0
je 0x180027fdb
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
test cl, cl
jne 0x180027d56
cmp rax, qword [rbx + 0xc8]
jae 0x180027ff3
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180028018
cmp dword [rdi], 0
je 0x180028016
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180028018
xor cl, cl
movzx r14d, cl
mov dword [rsp + 0x60], r14d
cmp r14d, 1
ja 0x180027d56
mov ecx, dword [rbx]
test ecx, ecx
je 0x180027d56
mov r9d, dword [rbx + 4]
test r9d, r9d
je 0x180027d56
xor edx, edx
mov eax, 0x40000000
div ecx
test sil, sil
jne 0x180028090
xor edx, edx
mov r8d, r15d
shr r8d, 2
mov ecx, r15d
and ecx, 2
and r8d, 1
or ecx, 1
add r8d, ecx
div r8d
mov dword [rbx + 8], r8d
cmp eax, r9d
jb 0x180027d56
cmp dword [rbp + 0x13c8], 2
je 0x18002885b
mov r14d, dword [rsp + 0x48]
jmp 0x1800283d2
shr eax, 2
mov dword [rbx + 8], 1
cmp eax, r9d
jb 0x180027d56
mov r14d, dword [rsp + 0x48]
jmp 0x1800283d2
cmp eax, 0x504c5445
je 0x18002827c
cmp eax, 0x74524e53
je 0x180028135
cmp dword [rsp + 0x44], 0
jne 0x180027d56
bt eax, 0x1d
jae 0x180027d56
test esi, esi
je 0x1800283d2
jns 0x1800280f1
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1800283d2
cmp qword [rbx + 0x10], 0
je 0x180028126
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, esi
jge 0x180028126
mov rax, qword [rbx + 0xc8]
sub esi, ecx
mov rcx, qword [rbx + 0x28]
mov edx, esi
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x1800283d2
movsxd rax, esi
add qword [rbx + 0xc0], rax
jmp 0x1800283d2
cmp dword [rsp + 0x44], 0
jne 0x180027d56
cmp qword [r12 + 8], 0
jne 0x180027d56
cmp byte [rbp + 0x13c0], 0
je 0x1800281eb
cmp dword [rbp + 0x13c8], 2
je 0x180028854
test r14d, r14d
je 0x180027d56
cmp esi, r14d
ja 0x180027d56
xor eax, eax
mov byte [rbp + 0x13c0], 4
mov edi, eax
test esi, esi
je 0x1800283d2
nop dword [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800281af
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800281d5
cmp dword [rbx + 0x30], 0
je 0x1800281d3
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800281d5
xor dl, dl
lea eax, [rdi*4 + 3]
inc edi
mov byte [rsp + rax + 0x70], dl
cmp edi, esi
jb 0x180028190
jmp 0x1800283d2
mov ecx, dword [rbx + 8]
test cl, 1
je 0x180027d56
lea eax, [rcx + rcx]
cmp esi, eax
jne 0x180027d56
xor eax, eax
mov byte [rbp + 0x13d8], 1
cmp dword [r12 + 0x20], 0x10
mov esi, eax
jne 0x18002823d
test ecx, ecx
jle 0x1800283d2
lea rdi, [rsp + 0x54]
mov rcx, rbx
call fcn.180023700
inc esi
mov word [rdi], ax
lea rdi, [rdi + 2]
cmp esi, dword [rbx + 8]
jl 0x180028222
jmp 0x1800283d2
test ecx, ecx
jle 0x1800283d2
lea rdi, [rsp + 0x40]
lea r15, [0x180083600]
mov rcx, rbx
call fcn.180023700
movsxd rcx, dword [r12 + 0x20]
lea rdi, [rdi + 1]
movzx eax, al
inc esi
movzx edx, byte [rcx + r15]
imul eax, edx
mov byte [rdi - 1], al
cmp esi, dword [rbx + 8]
jl 0x180028251
jmp 0x1800283cd
cmp dword [rsp + 0x44], 0
jne 0x180027d56
cmp esi, 0x300
ja 0x180027d56
mov eax, 0xaaaaaaab
mul esi
mov r14d, edx
shr r14d, 1
mov dword [rsp + 0x48], r14d
lea eax, [r14 + r14*2]
cmp eax, esi
jne 0x180027d56
xor eax, eax
mov r15d, eax
test r14d, r14d
je 0x1800283cd
lea rdi, [rbx + 0x30]
mov rdx, qword [rbx + 0xc0]
mov rsi, rdi
cmp rdx, qword [rbx + 0xc8]
jae 0x1800282e5
movzx ecx, byte [rdx]
inc rdx
mov qword [rbx + 0xc0], rdx
jmp 0x18002830b
cmp dword [rdi], 0
je 0x180028309
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
lea rdx, [rax + 1]
mov qword [rbx + 0xc0], rdx
jmp 0x18002830b
xor cl, cl
lea r14d, [r15*4]
mov byte [rsp + r14 + 0x70], cl
cmp rdx, qword [rbx + 0xc8]
jae 0x180028335
movzx r8d, byte [rdx]
lea rdi, [rbx + 0x30]
inc rdx
mov qword [rbx + 0xc0], rdx
jmp 0x18002835d
cmp dword [rdi], 0
je 0x18002835a
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx r8d, byte [rax]
lea rdx, [rax + 1]
mov qword [rbx + 0xc0], rdx
jmp 0x18002835d
xor r8b, r8b
lea eax, [r14 + 1]
mov byte [rsp + rax + 0x70], r8b
cmp rdx, qword [rbx + 0xc8]
jae 0x180028380
movzx r8d, byte [rdx]
lea rax, [rdx + 1]
mov qword [rbx + 0xc0], rax
jmp 0x1800283aa
cmp dword [rsi], 0
mov rdi, rsi
je 0x1800283a7
mov rcx, rbx
call fcn.18002ba10
mov rax, qword [rbx + 0xc0]
movzx r8d, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800283aa
xor r8b, r8b
lea eax, [r14 + 2]
inc r15d
mov byte [rsp + rax + 0x70], r8b
lea eax, [r14 + 3]
mov r14d, dword [rsp + 0x48]
mov byte [rsp + rax + 0x70], 0xff
cmp r15d, r14d
jb 0x1800282c3
mov r15d, dword [rsp + 0x4c]
mov rcx, rbx
call fcn.180023700
mov rcx, rbx
call fcn.180023700
jmp 0x180027ca8
movsxd rax, dword [rsp + 0x50]
xor r14d, r14d
add rax, rdi
mov qword [rbp + 0x390], rcx
mov qword [rbp + 0x378], rax
mov edx, r14d
lea rax, [rsi + rcx]
mov qword [rbp + 0x388], rcx
mov esi, dword [rsp + 0x5c]
lea rcx, [rbp + 0x370]
test esi, esi
mov qword [rbp + 0x370], rdi
mov qword [rbp + 0x398], rax
sete dl
mov dword [rbp + 0x3a0], 1
call fcn.1800289b0
test eax, eax
je 0x180028831
mov rax, qword [rbp + 0x390]
mov edi, dword [rbp + 0x388]
sub edi, dword [rbp + 0x390]
mov qword [r12 + 0x10], rax
test rax, rax
je 0x180027d56
mov rcx, qword [r12 + 8]
call fcn.180042ba0
mov ecx, dword [rbp + 0x13d0]
mov qword [r12 + 8], r14
mov eax, dword [rbx + 8]
movzx r14d, byte [rbp + 0x13c0]
lea r9d, [rax + 1]
cmp ecx, r9d
jne 0x18002849b
cmp ecx, 3
je 0x18002849b
test r14b, r14b
je 0x180028541
movzx r13d, byte [rbp + 0x13d8]
test r13b, r13b
jne 0x1800284ab
mov r9d, eax
mov eax, dword [rsp + 0x60]
mov r8d, edi
mov dword [rsp + 0x30], eax
mov rcx, r12
mov dword [rbx + 0xc], r9d
mov eax, dword [r12 + 0x20]
mov rdx, qword [r12 + 0x10]
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], eax
call fcn.180021ea0
test eax, eax
je 0x180027d56
test r13b, r13b
je 0x1800285ee
mov rcx, qword [r12]
mov eax, dword [rcx + 4]
imul eax, dword [rcx]
cmp dword [r12 + 0x20], 0x10
mov rcx, qword [r12 + 0x18]
jne 0x180028584
test eax, eax
je 0x1800285ee
xor r10d, r10d
cmp dword [rbx + 0xc], 2
jne 0x18002854e
movzx r8d, word [rsp + 0x54]
mov edx, eax
nop word [rax + rax]
cmp word [rcx], r8w
lea rcx, [rcx + 4]
mov eax, 0xffff
cmove ax, r10w
mov word [rcx - 2], ax
sub rdx, 1
jne 0x180028520
jmp 0x1800285ee
movzx r13d, byte [rbp + 0x13d8]
jmp 0x1800284ab
movzx edx, word [rsp + 0x58]
movzx r8d, word [rsp + 0x56]
movzx r9d, word [rsp + 0x54]
nop
cmp word [rcx], r9w
jne 0x180028578
cmp word [rcx + 2], r8w
jne 0x180028578
cmp word [rcx + 4], dx
jne 0x180028578
mov word [rcx + 6], r10w
add rcx, 8
sub rax, 1
jne 0x180028560
jmp 0x1800285ee
test eax, eax
je 0x1800285ee
cmp dword [rbx + 0xc], 2
jne 0x1800285bb
movzx r8d, byte [rsp + 0x40]
xor r10d, r10d
mov edx, eax
nop dword [rax]
cmp byte [rcx], r8b
lea rcx, [rcx + 2]
mov eax, 0xff
cmove eax, r10d
mov byte [rcx - 1], al
sub rdx, 1
jne 0x1800285a0
jmp 0x1800285ee
movzx edx, byte [rsp + 0x42]
movzx r8d, byte [rsp + 0x41]
movzx r9d, byte [rsp + 0x40]
nop dword [rax]
cmp byte [rcx], r9b
jne 0x1800285e4
cmp byte [rcx + 1], r8b
jne 0x1800285e4
cmp byte [rcx + 2], dl
jne 0x1800285e4
mov byte [rcx + 3], 0
add rcx, 4
sub rax, 1
jne 0x1800285d0
test esi, esi
je 0x1800286ea
cmp dword [0x1802e6e98], 0
je 0x1800286ea
cmp dword [rbx + 0xc], 2
jle 0x1800286ea
mov rax, qword [r12]
mov r10, qword [r12 + 0x18]
mov ecx, dword [rax + 4]
imul ecx, dword [rax]
test ecx, ecx
je 0x1800286ea
cmp dword [rax + 0xc], 3
jne 0x18002864f
mov edx, ecx
nop dword [rax]
movzx ecx, byte [r10]
movzx eax, byte [r10 + 2]
mov byte [r10], al
mov byte [r10 + 2], cl
lea r10, [r10 + 3]
sub rdx, 1
jne 0x180028630
jmp 0x1800286ea
cmp dword [0x1802e6e94], 0
je 0x1800286ce
mov esi, ecx
nop word [rax + rax]
movzx eax, byte [r10 + 3]
movzx ecx, byte [r10]
movzx edi, byte [r10 + 2]
test al, al
je 0x1800286b3
mov r8d, eax
mov r9d, eax
movzx eax, byte [r10 + 1]
xor edx, edx
imul eax, eax, 0xff
shr r8d, 1
add eax, r8d
div r9d
xor edx, edx
mov byte [r10 + 1], al
imul eax, ecx, 0xff
add eax, r8d
div r9d
xor edx, edx
mov r11d, eax
imul eax, edi, 0xff
add eax, r8d
div r9d
jmp 0x1800286bb
movzx r11d, cl
movzx eax, dil
mov byte [r10], al
mov byte [r10 + 2], r11b
add r10, 4
sub rsi, 1
jne 0x180028660
jmp 0x1800286ea
mov edx, ecx
movzx ecx, byte [r10]
movzx eax, byte [r10 + 2]
mov byte [r10], al
mov byte [r10 + 2], cl
lea r10, [r10 + 4]
sub rdx, 1
jne 0x1800286d0
test r14b, r14b
je 0x180028806
mov eax, dword [rbp + 0x13d0]
movzx esi, r14b
mov dword [rbx + 8], esi
mov dword [rbx + 0xc], esi
cmp eax, 3
jl 0x18002870d
mov dword [rbx + 0xc], eax
mov esi, eax
mov rax, qword [r12]
mov rdi, qword [r12 + 0x18]
mov r14d, dword [rax + 4]
imul r14d, dword [rax]
test r14d, r14d
js 0x180027d56
test esi, esi
js 0x180027d56
mov ecx, r14d
jne 0x180028739
imul ecx, esi
jmp 0x18002874d
mov eax, 0x7fffffff
imul ecx, esi
cdq
idiv esi
cmp r14d, eax
jg 0x180027d56
movsxd rcx, ecx
call fcn.180042e50
mov r15, rax
test rax, rax
je 0x180027d56
test r14d, r14d
je 0x1800287f5
mov r9d, r14d
lea r8, [rax + 2]
cmp esi, 3
jne 0x1800287c0
nop word [rax + rax]
movzx edx, byte [rdi]
lea r8, [r8 + 3]
lea rdi, [rdi + 1]
movzx eax, byte [rsp + rdx*4 + 0x70]
movzx ecx, byte [rsp + rdx*4 + 0x72]
mov byte [r8 - 5], al
movzx eax, byte [rsp + rdx*4 + 0x71]
mov byte [r8 - 4], al
mov byte [r8 - 3], cl
sub r9, 1
jne 0x180028780
mov rcx, qword [r12 + 0x18]
call fcn.180042ba0
mov qword [r12 + 0x18], r15
jmp 0x18002880e
movzx edx, byte [rdi]
lea r8, [r8 + 4]
lea rdi, [rdi + 1]
movzx eax, byte [rsp + rdx*4 + 0x70]
movzx ecx, byte [rsp + rdx*4 + 0x73]
mov byte [r8 - 6], al
movzx eax, byte [rsp + rdx*4 + 0x71]
mov byte [r8 - 5], al
movzx eax, byte [rsp + rdx*4 + 0x72]
mov byte [r8 - 4], al
mov byte [r8 - 3], cl
sub r9, 1
jne 0x1800287c0
mov rcx, qword [r12 + 0x18]
call fcn.180042ba0
mov qword [r12 + 0x18], r15
jmp 0x18002880e
test r13b, r13b
je 0x18002880e
inc dword [rbx + 8]
mov rcx, qword [r12 + 0x10]
call fcn.180042ba0
xor eax, eax
mov rcx, rbx
mov qword [r12 + 0x10], rax
call fcn.180023880
mov eax, 1
jmp 0x180027d58
mov rcx, qword [rbp + 0x390]
call fcn.180042ba0
mov qword [r12 + 0x10], r14
jmp 0x180027d56
mov dword [rbx + 8], eax
mov eax, 1
jmp 0x180027d58
mov dword [rbx + 8], 4
mov eax, 1
jmp 0x180027d58