Function at 0x14009cf40
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov word [rsp + 0x10], dx
mov qword [rsp + 8], rcx
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xb0
mov rax, qword [rcx]
movzx edi, dx
xor edx, edx
mov qword [rsp + 0x88], rax
mov r14, rcx
mov dword [rsp + 0x58], edx
movzx ecx, byte [rcx + 0x42]
mov r13d, 1
mov r8, qword [rax]
movzx esi, dx
mov qword [rsp + 0x90], r8
movzx r12d, dx
mov qword [rsp + 0x80], rdx
mov dword [rsp + 0x100], ecx
cmp ecx, r13d
jg 0x14009cfa8
mov ebx, r13d
jmp 0x14009cfb8
cmp ecx, 2
mov ebx, 0xa
mov eax, 5
cmove ebx, eax
mov rax, qword [r14 + 0x10]
mov dword [rsp + 0x54], ebx
test rax, rax
je 0x14009cfd4
test di, di
je 0x14009cfd4
mov r15d, dword [rax]
mov dword [rsp + 0x50], r15d
jmp 0x14009cfdb
mov r15d, edx
mov dword [rsp + 0x50], edx
lea eax, [rcx + 4]
imul eax, ebx
lea ecx, [r15 + rax*8]
add ecx, ecx
movsxd rdx, ecx
mov rcx, r8
call fcn.140055480
mov qword [rsp + 0x60], rax
mov rdx, rax
test rax, rax
jne 0x14009d007
lea eax, [rdx + 7]
jmp 0x14009da52
movsxd r8, dword [rsp + 0x100]
xor ecx, ecx
mov eax, ebx
shl rax, 5
lea r9, [rax + rdx]
mov qword [rsp + 0xa8], rbp
mov qword [r9], rcx
mov rbp, rdx
mov qword [r9 + 8], rcx
mov qword [r9 + 0x10], rcx
mov qword [r9 + 0x18], rcx
lea rcx, [rax + r9]
shl r8, 3
lea eax, [rbx + rbx]
mov qword [rsp + 0x40], rdx
add rdx, 0x18
mov qword [rsp + 0x70], r9
nop
mov qword [rdx], rcx
lea rdx, [rdx + 0x20]
add rcx, r8
dec eax
test eax, eax
jg 0x14009d050
test r15d, r15d
je 0x14009d07f
movsxd r8, r15d
xor edx, edx
add r8, r8
mov qword [rsp + 0x80], rcx
call fcn.1400c71f0
mov r9, qword [rsp + 0x70]
mov rax, qword [rsp + 0x88]
mov ecx, 0x30
mov edx, r13d
mov dword [rsp + 0x6c], edx
mov eax, dword [rax + 0xb4]
cmp eax, ecx
cmovb ecx, eax
mov word [r9 + 0x10], cx
test r15d, r15d
je 0x14009d0c3
movzx eax, r15b
or ecx, 0xffffffff
mov r15d, dword [rsp + 0x100]
test r15d, r15d
cmovg eax, ecx
mov byte [r9 + 0x16], al
jmp 0x14009d0cb
mov r15d, dword [rsp + 0x100]
xor r8d, r8d
mov ecx, r8d
mov dword [rsp + 0x108], ecx
test r15d, r15d
jle 0x14009d759
mov r10d, 0x4000
nop word [rax + rax]
mov qword [rsp + 0x48], r9
mov eax, r8d
mov dword [rsp + 0x68], eax
mov r13d, r8d
mov rdi, r9
test edx, edx
jle 0x14009d634
nop word [rax + rax]
mov r15, qword [r14 + 0x50]
test r15, r15
je 0x14009d609
nop dword [rax]
mov r9, qword [rdi]
movzx r11d, byte [rdi + 0x16]
mov rax, r9
not rax
mov qword [rsp + 0x78], r8
test qword [r15], rax
jne 0x14009d5ec
mov rbp, qword [r15 + 8]
test r9, rbp
jne 0x14009d5e7
test dword [r15 + 0x28], r10d
je 0x14009d15a
cmp word [rdi + 0x10], 3
jl 0x14009d5e7
movzx r10d, word [rdi + 0x10]
lea r14, [0x140000000]
movzx ecx, word [r15 + 0x14]
movzx ebx, word [r15 + 0x12]
add cx, r10w
movsx edx, cx
cmp bx, cx
jl 0x14009d1a5
movsx ecx, bx
lea eax, [rdx + 0x31]
cmp ecx, eax
jg 0x14009d1d5
lea eax, [rdx + 0x1f]
cmp ecx, eax
jle 0x14009d192
inc bx
jmp 0x14009d1d5
sub ecx, edx
movsxd rax, ecx
movzx eax, byte [rax + r14 + 0x16ca18]
add bx, ax
jmp 0x14009d1d5
movsx r8d, bx
lea eax, [r8 + 0x31]
cmp edx, eax
jle 0x14009d1b6
movzx ebx, cx
jmp 0x14009d1d5
lea eax, [r8 + 0x1f]
cmp edx, eax
jle 0x14009d1c3
lea ebx, [rcx + 1]
jmp 0x14009d1d5
sub edx, r8d
movsxd rax, edx
movzx ebx, byte [rax + r14 + 0x16ca18]
add bx, cx
movzx ecx, word [rdi + 0x14]
movsx edx, cx
cmp bx, cx
jl 0x14009d20a
movsx ecx, bx
lea eax, [rdx + 0x31]
cmp ecx, eax
jg 0x14009d23a
lea eax, [rdx + 0x1f]
cmp ecx, eax
jle 0x14009d1f7
inc bx
jmp 0x14009d23a
sub ecx, edx
movsxd rax, ecx
movzx eax, byte [rax + r14 + 0x16ca18]
add bx, ax
jmp 0x14009d23a
movsx r8d, bx
lea eax, [r8 + 0x31]
cmp edx, eax
jle 0x14009d21b
movzx ebx, cx
jmp 0x14009d23a
lea eax, [r8 + 0x1f]
cmp edx, eax
jle 0x14009d228
lea ebx, [rcx + 1]
jmp 0x14009d23a
sub edx, r8d
movsxd rax, edx
movzx ebx, byte [rax + r14 + 0x16ca18]
add bx, cx
movzx r14d, word [r15 + 0x16]
or rbp, r9
add r14w, r10w
test r11b, r11b
jns 0x14009d290
lea rax, [rsp + 0x78]
mov r8, rdi
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x108]
mov qword [rsp + 0x28], r15
mov word [rsp + 0x20], ax
mov rax, qword [rsp + 0xf0]
mov rcx, rax
mov rdi, rax
movzx r9d, word [rax + 0x40]
mov rdx, qword [rax + 0x10]
call fcn.14009c690
mov r10, qword [rsp + 0x78]
movzx r11d, al
jmp 0x14009d29c
mov r10, qword [rdi + 8]
mov rdi, qword [rsp + 0xf0]
test r11b, r11b
js 0x14009d496
movsx edx, r11b
cmp edx, dword [rsp + 0x50]
jge 0x14009d496
mov rcx, qword [rsp + 0x80]
movsx rax, r11b
lea r9, [rcx + rax*2]
movzx ecx, word [rcx + rax*2]
test cx, cx
jne 0x14009d424
mov eax, dword [rsp + 0x50]
movzx r8d, word [rsp + 0xf8]
sub eax, edx
imul eax, eax, 0x64
cdq
idiv dword [rsp + 0x50]
movsxd rcx, eax
mov eax, 0x28
cmp rcx, 8
jae 0x14009d311
cmp rcx, 2
jae 0x14009d302
xor eax, eax
movzx edx, ax
jmp 0x14009d366
add ax, 0xfff6
add rcx, rcx
cmp rcx, 8
jb 0x14009d302
jmp 0x14009d34d
cmp rcx, 0xff
jbe 0x14009d331
nop word [rax + rax]
add ax, 0x28
shr rcx, 4
cmp rcx, 0xff
ja 0x14009d320
cmp rcx, 0xf
jbe 0x14009d34d
nop word [rax + rax]
add ax, 0xa
shr rcx, 1
cmp rcx, 0xf
ja 0x14009d340
and ecx, 7
lea rdx, [0x140000000]
movzx edx, word [rdx + rcx*2 + 0x1ca1d8]
sub dx, 0xa
add dx, ax
movzx ecx, word [rsp + 0xf8]
sub dx, 0x32
add dx, cx
mov eax, 0x4000
test word [rdi + 0x40], ax
je 0x14009d38a
cmp word [rdi + 0x28], cx
cmovl r8w, word [rdi + 0x28]
cmp r8w, 0xa
jg 0x14009d39a
xor eax, eax
mov ecx, eax
jmp 0x14009d41d
movsx rax, r8w
mov ecx, 0x28
cmp rax, 8
jae 0x14009d3c2
cmp rax, 2
jae 0x14009d3b3
xor eax, eax
jmp 0x14009d417
add cx, 0xfff6
add rax, rax
cmp rax, 8
jb 0x14009d3b3
jmp 0x14009d3fd
cmp rax, 0xff
jbe 0x14009d3e0
nop word [rax + rax]
add cx, 0x28
shr rax, 4
cmp rax, 0xff
ja 0x14009d3d0
cmp rax, 0xf
jbe 0x14009d3fd
nop word [rax + rax]
add cx, 0xa
shr rax, 1
cmp rax, 0xf
ja 0x14009d3f0
and eax, 7
lea r8, [0x140000000]
movzx eax, word [r8 + rax*2 + 0x1ca1d8]
sub ax, 0xa
add ax, cx
movsx ecx, ax
sub ecx, 0x21
add cx, dx
mov word [r9], cx
movsx edx, cx
cmp bx, cx
jl 0x14009d460
movsx ecx, bx
lea eax, [rdx + 0x31]
cmp ecx, eax
jle 0x14009d43b
movzx ecx, bx
jmp 0x14009d49d
lea eax, [rdx + 0x1f]
cmp ecx, eax
jle 0x14009d447
lea ecx, [rbx + 1]
jmp 0x14009d49d
sub ecx, edx
movsxd rax, ecx
lea rcx, [0x140000000]
movzx ecx, byte [rax + rcx + 0x16ca18]
add cx, bx
jmp 0x14009d49d
movsx r8d, bx
lea eax, [r8 + 0x31]
cmp edx, eax
jg 0x14009d49d
lea eax, [r8 + 0x1f]
cmp edx, eax
jle 0x14009d479
inc cx
jmp 0x14009d49d
sub edx, r8d
movsxd rax, edx
lea rdx, [0x140000000]
movzx eax, byte [rax + rdx + 0x16ca18]
add ax, cx
movzx ecx, ax
jmp 0x14009d49d
movzx ecx, bx
add bx, 0xfffe
mov rdi, qword [rsp + 0x40]
xor r8d, r8d
mov edx, r8d
test r13d, r13d
jle 0x14009d4c9
nop dword [rax]
cmp qword [rdi], rbp
jne 0x14009d4be
movzx eax, byte [rdi + 0x16]
xor al, r11b
jge 0x14009d4eb
inc edx
add rdi, 0x20
cmp edx, r13d
jl 0x14009d4b0
cmp r13d, dword [rsp + 0x54]
jl 0x14009d520
cmp cx, si
jg 0x14009d5dc
jne 0x14009d4e5
cmp bx, r12w
jge 0x14009d5dc
mov eax, dword [rsp + 0x58]
jmp 0x14009d526
cmp edx, r13d
jge 0x14009d4c9
movzx eax, word [rdi + 0x12]
cmp ax, cx
jl 0x14009d5dc
mov rbp, qword [rsp + 0x40]
jne 0x14009d535
movzx eax, word [rdi + 0x10]
cmp ax, r14w
jl 0x14009d5cf
jne 0x14009d535
cmp word [rdi + 0x14], bx
jle 0x14009d5cf
jmp 0x14009d535
mov eax, r13d
inc r13d
mov rbp, qword [rsp + 0x40]
movsxd rdi, eax
shl rdi, 5
add rdi, rbp
mov rax, qword [r15 + 8]
mov rdx, qword [rsp + 0x48]
or rax, qword [rdx]
mov qword [rdi], rax
movsxd rax, dword [rsp + 0x108]
mov word [rdi + 0x14], bx
mov word [rdi + 0x12], cx
mov rcx, qword [rdi + 0x18]
lea rbx, [rax*8]
mov qword [rdi + 8], r10
mov word [rdi + 0x10], r14w
mov r8, rbx
mov byte [rdi + 0x16], r11b
mov rdx, qword [rdx + 0x18]
call fcn.1400c6560
mov rax, qword [rdi + 0x18]
xor r8d, r8d
mov qword [rbx + rax], r15
mov ebx, dword [rsp + 0x54]
cmp r13d, ebx
jl 0x14009d5cf
movzx esi, word [rbp + 0x12]
mov edx, 1
movzx r12d, word [rbp + 0x10]
mov dword [rsp + 0x58], r8d
cmp ebx, edx
jbe 0x14009d5cf
lea rax, [rbp + 0x32]
movzx ecx, word [rax]
cmp cx, si
jg 0x14009d5b9
jne 0x14009d5c5
cmp word [rax + 2], r12w
jle 0x14009d5c5
movzx r12d, word [rax + 2]
movzx esi, cx
mov dword [rsp + 0x58], edx
inc edx
add rax, 0x20
cmp edx, ebx
jl 0x14009d5a8
mov rdi, qword [rsp + 0x48]
mov r10d, 0x4000
jmp 0x14009d5ec
mov rdi, qword [rsp + 0x48]
mov r10d, 0x4000
mov rbp, qword [rsp + 0x40]
mov r15, qword [r15 + 0x40]
test r15, r15
jne 0x14009d120
mov r14, qword [rsp + 0xf0]
mov eax, dword [rsp + 0x68]
mov edx, dword [rsp + 0x6c]
inc eax
add rdi, 0x20
mov dword [rsp + 0x68], eax
mov qword [rsp + 0x48], rdi
cmp eax, edx
jl 0x14009d110
mov ecx, dword [rsp + 0x108]
mov r9, qword [rsp + 0x70]
mov r15d, dword [rsp + 0x100]
mov rax, rbp
mov qword [rsp + 0x40], r9
inc ecx
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x108], ecx
mov edx, r13d
mov dword [rsp + 0x6c], edx
mov rbp, r9
mov r9, rax
cmp ecx, r15d
jl 0x14009d0f0
test r13d, r13d
jne 0x14009d74b
mov rcx, qword [rsp + 0x88]
lea rdx, str.no_query_solution
call fcn.140057c20
mov rcx, qword [rsp + 0x90]
test rcx, rcx
je 0x14009d6d9
cmp qword [rcx + 0x2a8], 0
je 0x14009d6a7
mov rdx, qword [rsp + 0x60]
call fcn.14003b520
lea eax, [r13 + 1]
jmp 0x14009da4a
mov rbx, qword [rsp + 0x60]
cmp rbx, qword [rcx + 0x190]
jb 0x14009d6de
cmp rbx, qword [rcx + 0x198]
jae 0x14009d6de
mov rax, qword [rcx + 0x188]
mov qword [rbx], rax
mov eax, 1
mov qword [rcx + 0x188], rbx
jmp 0x14009da4a
mov rbx, qword [rsp + 0x60]
cmp dword [0x1401c9170], 0
je 0x14009d738
mov rcx, qword [0x1401efbc0]
test rcx, rcx
je 0x14009d6f9
call qword [0x1401c9200]
mov rcx, rbx
call qword [0x1401c91b8]
dec qword [0x1401efd18]
movsxd rcx, eax
sub qword [0x1401efcd0], rcx
mov rcx, rbx
call qword [0x1401c91a8]
mov rcx, qword [0x1401efbc0]
test rcx, rcx
je 0x14009d741
call qword [0x1401c9210]
mov eax, 1
jmp 0x14009da4a
mov rcx, rbx
call qword [0x1401c91a8]
mov eax, 1
jmp 0x14009da4a
movzx edi, word [rsp + 0xf8]
mov r13d, 1
movsxd rdx, edx
mov rbx, r9
cmp rdx, 1
jle 0x14009d790
lea rcx, [r9 + 0x32]
dec rdx
nop dword [rax]
movzx eax, word [rcx]
cmp word [rbx + 0x12], ax
jle 0x14009d783
movsxd rbx, r13d
shl rbx, 5
add rbx, r9
inc r13d
add rcx, 0x20
sub rdx, 1
jne 0x14009d770
test r15d, r15d
jle 0x14009d7d1
lea rdx, [r14 + 0x3c4]
mov r9d, r15d
nop
mov rax, qword [rbx + 0x18]
lea rdx, [rdx + 0x58]
lea r8, [r8 + 8]
mov rcx, qword [r8 + rax - 8]
mov qword [rdx - 0x3c], rcx
movzx eax, byte [rcx + 0x10]
imul rcx, rax, 0x70
mov byte [rdx - 0x58], al
mov rax, qword [r14 + 8]
mov ecx, dword [rcx + rax + 0x4c]
mov dword [rdx - 0x80], ecx
sub r9, 1
jne 0x14009d7a0
movzx eax, word [r14 + 0x40]
mov ecx, 0x180
and ax, cx
mov ecx, 0x100
cmp ax, cx
jne 0x14009d843
cmp byte [r14 + 0x47], 0
jne 0x14009d843
test di, di
je 0x14009d843
lea eax, [r15 - 1]
mov r9d, 0x80
movsxd rcx, eax
lea r8, [rsp + 0xf0]
mov rax, qword [rbx + 0x18]
lea edx, [r15 - 1]
mov qword [rsp + 0x30], r8
mov r8, rbx
mov rax, qword [rax + rcx*8]
mov rcx, r14
mov qword [rsp + 0x28], rax
mov word [rsp + 0x20], dx
mov rdx, qword [r14 + 0x18]
call fcn.14009c690
movsx ecx, al
mov rax, qword [r14 + 0x18]
cmp ecx, dword [rax]
jne 0x14009d843
mov byte [r14 + 0x47], 2
mov rdx, qword [r14 + 0x10]
test rdx, rdx
je 0x14009d98f
test byte [r14 + 0x40], 0x80
je 0x14009d86f
movsx eax, byte [rbx + 0x16]
xor edi, edi
cmp eax, dword [rdx]
jne 0x14009d918
mov byte [r14 + 0x47], 2
jmp 0x14009d918
movzx ecx, byte [rbx + 0x16]
mov byte [r14 + 0x43], cl
mov rax, qword [rbx + 8]
mov qword [r14 + 0x58], rax
test cl, cl
jg 0x14009d916
mov byte [r14 + 0x43], 0
test r15d, r15d
jle 0x14009d916
lea eax, [r15 - 1]
movsxd rcx, eax
mov rax, qword [rbx + 0x18]
mov r10, qword [rax + rcx*8]
mov eax, dword [r10 + 0x28]
and eax, 0x104
cmp eax, 0x104
setne cl
bt dword [r10 + 0x28], 0xc
setae al
xor edi, edi
test al, cl
je 0x14009d918
lea rcx, [rsp + 0xf0]
mov qword [rsp + 0xf0], rdi
mov qword [rsp + 0x30], rcx
lea eax, [r15 - 1]
mov qword [rsp + 0x28], r10
mov rcx, r14
mov r9d, 0x800
mov word [rsp + 0x20], ax
mov r8, rbx
call fcn.14009c690
mov rdx, qword [r14 + 0x10]
movsx ecx, al
cmp ecx, dword [rdx]
jne 0x14009d918
mov rax, qword [rsp + 0xf0]
mov qword [r14 + 0x58], rax
mov byte [r14 + 0x48], 1
jmp 0x14009d918
xor edi, edi
mov eax, 0x200
test word [r14 + 0x40], ax
je 0x14009d98f
movsx eax, byte [r14 + 0x43]
cmp eax, dword [rdx]
jne 0x14009d98f
test r15d, r15d
jle 0x14009d98f
lea eax, [r15 - 1]
mov qword [rsp + 0xf0], rdi
movsxd rcx, eax
lea r8, [rsp + 0xf0]
mov rax, qword [rbx + 0x18]
dec r15w
mov qword [rsp + 0x30], r8
xor r9d, r9d
mov r8, rbx
mov rax, qword [rax + rcx*8]
mov rcx, r14
mov qword [rsp + 0x28], rax
mov word [rsp + 0x20], r15w
call fcn.14009c690
movsx ecx, al
mov rax, qword [r14 + 0x10]
cmp ecx, dword [rax]
jne 0x14009d98f
mov rax, qword [rsp + 0xf0]
mov qword [r14 + 0x58], rax
mov byte [r14 + 0x44], 1
mov rcx, qword [rsp + 0x90]
movzx eax, word [rbx + 0x10]
mov word [r14 + 0x60], ax
test rcx, rcx
je 0x14009d9e8
cmp qword [rcx + 0x2a8], 0
je 0x14009d9be
mov rdx, qword [rsp + 0x60]
call fcn.14003b520
jmp 0x14009da48
mov rbx, qword [rsp + 0x60]
cmp rbx, qword [rcx + 0x190]
jb 0x14009d9ed
cmp rbx, qword [rcx + 0x198]
jae 0x14009d9ed
mov rax, qword [rcx + 0x188]
mov qword [rbx], rax
mov qword [rcx + 0x188], rbx
jmp 0x14009da48
mov rbx, qword [rsp + 0x60]
cmp dword [0x1401c9170], 0
je 0x14009da3f
mov rcx, qword [0x1401efbc0]
test rcx, rcx
je 0x14009da08
call qword [0x1401c9200]
mov rcx, rbx
call qword [0x1401c91b8]
dec qword [0x1401efd18]
movsxd rcx, eax
sub qword [0x1401efcd0], rcx
mov rcx, rbx
call qword [0x1401c91a8]
mov rcx, qword [0x1401efbc0]
test rcx, rcx
je 0x14009da48
call qword [0x1401c9210]
jmp 0x14009da48
mov rcx, rbx
call qword [0x1401c91a8]
xor eax, eax
mov rbp, qword [rsp + 0xa8]
add rsp, 0xb0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret