Function at 0x140082aa0
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]
xor r9d, r9d
mov r14, rcx
movzx ecx, byte [rcx + 0x39]
mov r8, qword [rax]
mov r13d, 1
movzx edi, dx
mov dword [rsp + 0x54], r9d
movzx esi, r9w
mov qword [rsp + 0x90], r8
movzx r15d, r9w
mov qword [rsp + 0x78], r9
mov qword [rsp + 0x80], rax
mov dword [rsp + 0x100], ecx
cmp ecx, r13d
jg 0x140082b08
mov ebx, r13d
jmp 0x140082b18
mov ebx, 0xa
mov eax, 5
cmp ecx, 2
cmove ebx, eax
mov rax, qword [r14 + 0x10]
mov dword [rsp + 0x50], ebx
test rax, rax
je 0x140082b34
test di, di
je 0x140082b34
mov r12d, dword [rax]
mov dword [rsp + 0x68], r12d
jmp 0x140082b3c
mov r12d, r9d
mov dword [rsp + 0x68], r9d
lea eax, [rcx + 4]
imul eax, ebx
lea ecx, [r12 + rax*8]
add ecx, ecx
movsxd rdx, ecx
mov rcx, r8
call fcn.140044680
mov rdx, rax
mov qword [rsp + 0x58], rax
test rax, rax
jne 0x140082b68
lea eax, [rdx + 7]
jmp 0x140083471
xor ecx, ecx
mov qword [rsp + 0x40], rax
mov qword [rsp + 0xa8], rbp
mov rbp, rax
movsxd rax, ebx
shl rax, 5
lea r9, [rax + rdx]
mov qword [rsp + 0x70], r9
mov qword [r9], rcx
mov qword [r9 + 8], rcx
mov qword [r9 + 0x10], rcx
mov qword [r9 + 0x18], rcx
lea rcx, [rax + r9]
lea eax, [rbx + rbx]
test eax, eax
jle 0x140082bd0
movsxd r8, dword [rsp + 0x100]
shl r8, 3
add rdx, 0x18
nop dword [rax]
nop dword [rax + rax]
mov qword [rdx], rcx
dec eax
add rcx, r8
lea rdx, [rdx + 0x20]
test eax, eax
jg 0x140082bc0
test r12d, r12d
je 0x140082bec
movsxd r8, r12d
xor edx, edx
mov qword [rsp + 0x78], rcx
add r8, r8
call sub.MSVCR120.dll_memset
mov r9, qword [rsp + 0x70]
mov rax, qword [rsp + 0x80]
mov r10d, dword [rsp + 0x100]
mov ecx, 0x2e
mov eax, dword [rax + 0x1d8]
mov edx, r13d
cmp eax, ecx
mov dword [rsp + 0x60], edx
cmovb ecx, eax
mov word [r9 + 0x10], cx
test r12d, r12d
je 0x140082c2e
or ecx, 0xffffffff
movzx eax, r12b
test r10d, r10d
cmovg eax, ecx
mov byte [r9 + 0x16], al
xor r8d, r8d
mov r11d, 0x400
mov ecx, r8d
mov dword [rsp + 0x108], ecx
test r10d, r10d
jle 0x14008326d
nop word [rax + rax]
mov eax, r8d
mov r12d, r8d
mov rdi, r9
mov qword [rsp + 0x48], r9
mov dword [rsp + 0x64], eax
test edx, edx
jle 0x1400831a0
nop word [rax + rax]
mov r13, qword [r14 + 0x20]
test r13, r13
je 0x140083175
nop dword [rax]
mov r9, qword [rdi]
movzx r11d, byte [rdi + 0x16]
mov qword [rsp + 0x88], r8
mov rax, r9
not rax
test qword [r13], rax
jne 0x140083158
mov rbp, qword [r13 + 8]
test r9, rbp
jne 0x140083153
movzx r10d, word [rdi + 0x10]
movzx edx, word [r13 + 0x14]
movzx ebx, word [r13 + 0x12]
add dx, r10w
lea r14, [0x140000000]
cmp bx, dx
jl 0x140082d01
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x140082d39
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082ce8
inc bx
jmp 0x140082d39
movsx rcx, bx
movsx rax, dx
sub rcx, rax
movzx eax, byte [rcx + r14 + 0x2d64c0]
add bx, ax
jmp 0x140082d39
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jle 0x140082d15
movzx ebx, dx
jmp 0x140082d39
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082d22
lea ebx, [rdx + 1]
jmp 0x140082d39
movsx rax, bx
movsx rcx, dx
sub rcx, rax
movzx ebx, byte [rcx + r14 + 0x2d64c0]
add bx, dx
movzx edx, word [rdi + 0x14]
cmp bx, dx
jl 0x140082d77
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x140082daf
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082d5e
inc bx
jmp 0x140082daf
movsx rax, dx
movsx rcx, bx
sub rcx, rax
movzx eax, byte [rcx + r14 + 0x2d64c0]
add bx, ax
jmp 0x140082daf
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jle 0x140082d8b
movzx ebx, dx
jmp 0x140082daf
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082d98
lea ebx, [rdx + 1]
jmp 0x140082daf
movsx rax, bx
movsx rcx, dx
sub rcx, rax
movzx ebx, byte [rcx + r14 + 0x2d64c0]
add bx, dx
movzx r14d, word [r13 + 0x16]
or rbp, r9
add r14w, r10w
test r11b, r11b
jns 0x140082e08
lea rax, [rsp + 0x88]
mov r8, rdi
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x108]
mov qword [rsp + 0x28], r13
mov word [rsp + 0x20], ax
mov rax, qword [rsp + 0xf0]
movzx r9d, word [rax + 0x32]
mov rdx, qword [rax + 0x10]
mov rcx, rax
call fcn.1400822a0
mov r10, qword [rsp + 0x88]
movzx r11d, al
jmp 0x140082e0c
mov r10, qword [rdi + 8]
test r11b, r11b
js 0x140083020
mov r8d, dword [rsp + 0x68]
movsx ecx, r11b
cmp ecx, r8d
jge 0x140083020
mov rdx, qword [rsp + 0x78]
movsx rax, r11b
lea r9, [rdx + rax*2]
movzx edx, word [rdx + rax*2]
test dx, dx
jne 0x140082fa2
mov eax, r8d
sub eax, ecx
mov ecx, 0x28
imul eax, eax, 0x64
cdq
idiv r8d
cdqe
cmp rax, 8
jae 0x140082e7f
cmp rax, 2
jae 0x140082e70
xor edx, edx
movzx r8d, dx
jmp 0x140082edb
add rax, rax
add cx, 0xfff6
cmp rax, 8
jb 0x140082e70
jmp 0x140082ebd
cmp rax, 0xff
jbe 0x140082ea0
nop word [rax + rax]
shr rax, 4
add cx, 0x28
cmp rax, 0xff
ja 0x140082e90
cmp rax, 0xf
jbe 0x140082ebd
nop word [rax + rax]
shr rax, 1
add cx, 0xa
cmp rax, 0xf
ja 0x140082eb0
lea rdx, [0x140000000]
and eax, 7
movzx r8d, word [rdx + rax*2 + 0x439e28]
sub r8w, 0xa
add r8w, cx
xor edx, edx
movzx edi, word [rsp + 0xf8]
sub r8w, 0x42
cmp di, 0xa
jle 0x140082f7c
movsx rax, di
mov ecx, 0x28
cmp rax, 8
jae 0x140082f1f
cmp rax, 2
jae 0x140082f10
movzx eax, dx
jmp 0x140082f76
add rax, rax
add cx, 0xfff6
cmp rax, 8
jb 0x140082f10
jmp 0x140082f5d
cmp rax, 0xff
jbe 0x140082f40
nop word [rax + rax]
shr rax, 4
add cx, 0x28
cmp rax, 0xff
ja 0x140082f30
cmp rax, 0xf
jbe 0x140082f5d
nop word [rax + rax]
shr rax, 1
add cx, 0xa
cmp rax, 0xf
ja 0x140082f50
and eax, 7
lea rdx, [0x140000000]
movzx eax, word [rdx + rax*2 + 0x439e28]
sub ax, 0xa
add ax, cx
movsx edx, ax
sub edx, 0x21
mov rax, qword [rsp + 0xf0]
add dx, 0x10
mov ecx, 0x400
add dx, r8w
add dx, di
test word [rax + 0x32], cx
je 0x140082f9e
add dx, 0x10
mov word [r9], dx
cmp bx, dx
jl 0x140082fe2
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x140083020
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082fc3
lea edx, [rbx + 1]
jmp 0x140083023
movsx rax, dx
movsx rcx, bx
sub rcx, rax
lea rax, [0x140000000]
movzx edx, byte [rcx + rax + 0x2d64c0]
add dx, bx
jmp 0x140083023
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x140083023
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x140082ffe
inc dx
jmp 0x140083023
movsx rcx, dx
movsx rax, bx
sub rcx, rax
lea rax, [0x140000000]
movzx eax, byte [rcx + rax + 0x2d64c0]
add ax, dx
movzx edx, ax
jmp 0x140083023
movzx edx, bx
mov rdi, qword [rsp + 0x40]
xor r8d, r8d
mov ecx, r8d
test r12d, r12d
jle 0x14008304c
cmp qword [rdi], rbp
jne 0x140083041
movzx eax, byte [rdi + 0x16]
xor al, r11b
jns 0x14008306e
inc ecx
add rdi, 0x20
cmp ecx, r12d
jl 0x140083033
cmp r12d, dword [rsp + 0x50]
jl 0x140083094
cmp dx, si
jg 0x14008314e
jne 0x140083068
cmp bx, r15w
jge 0x14008314e
mov eax, dword [rsp + 0x54]
jmp 0x14008309a
cmp ecx, r12d
jge 0x14008304c
movzx eax, word [rdi + 0x12]
mov rbp, qword [rsp + 0x40]
cmp ax, dx
jl 0x140083147
jne 0x1400830a9
cmp word [rdi + 0x10], r14w
jle 0x140083147
jmp 0x1400830a9
mov eax, r12d
inc r12d
mov rbp, qword [rsp + 0x40]
movsxd rdi, eax
shl rdi, 5
add rdi, rbp
mov rax, qword [r13 + 8]
mov rcx, qword [rsp + 0x48]
or rax, qword [rcx]
mov word [rdi + 0x14], bx
mov qword [rdi + 8], r10
mov qword [rdi], rax
movsxd rax, dword [rsp + 0x108]
mov word [rdi + 0x10], r14w
mov word [rdi + 0x12], dx
mov byte [rdi + 0x16], r11b
mov rdx, qword [rcx + 0x18]
mov rcx, qword [rdi + 0x18]
lea rbx, [rax*8]
mov r8, rbx
call sub.MSVCR120.dll_memcpy
mov rax, qword [rdi + 0x18]
xor r8d, r8d
mov qword [rbx + rax], r13
mov ebx, dword [rsp + 0x50]
cmp r12d, ebx
jl 0x140083147
movzx esi, word [rbp + 0x12]
movzx r15d, word [rbp + 0x10]
mov edx, 1
mov dword [rsp + 0x54], r8d
cmp ebx, edx
jle 0x140083147
lea rax, [rbp + 0x32]
nop dword [rax]
movzx ecx, word [rax]
cmp cx, si
jg 0x140083131
jne 0x14008313d
cmp word [rax + 2], r15w
jle 0x14008313d
movzx r15d, word [rax + 2]
movzx esi, cx
mov dword [rsp + 0x54], edx
inc edx
add rax, 0x20
cmp edx, ebx
jl 0x140083120
mov rdi, qword [rsp + 0x48]
jmp 0x140083158
mov rdi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x40]
mov r13, qword [r13 + 0x38]
test r13, r13
jne 0x140082c80
mov r14, qword [rsp + 0xf0]
mov eax, dword [rsp + 0x64]
mov edx, dword [rsp + 0x60]
inc eax
add rdi, 0x20
mov dword [rsp + 0x64], eax
mov qword [rsp + 0x48], rdi
cmp eax, edx
jl 0x140082c70
mov ecx, dword [rsp + 0x108]
mov r9, qword [rsp + 0x70]
mov r10d, dword [rsp + 0x100]
mov rax, rbp
inc ecx
mov edx, r12d
mov rbp, r9
mov qword [rsp + 0x40], r9
mov r9, rax
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x60], edx
mov dword [rsp + 0x108], ecx
cmp ecx, r10d
jl 0x140082c50
test r12d, r12d
jne 0x140083259
mov rcx, qword [rsp + 0x80]
lea rdx, str.no_query_solution
call fcn.140046e00
mov rcx, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x58]
test rcx, rcx
je 0x140083247
cmp qword [rcx + 0x320], 0
je 0x140083214
call fcn.14002c560
lea eax, [r12 + 1]
jmp 0x140083469
cmp rdx, qword [rcx + 0x168]
jb 0x140083247
cmp rdx, qword [rcx + 0x170]
jae 0x140083247
mov rax, qword [rcx + 0x160]
mov qword [rdx], rax
dec dword [rcx + 0x14c]
mov qword [rcx + 0x160], rdx
mov eax, 1
jmp 0x140083469
mov rcx, rdx
call fcn.14000e700
mov eax, 1
jmp 0x140083469
movzx edi, word [rsp + 0xf8]
mov r13d, 1
mov r11d, 0x400
movsxd rdx, edx
mov rbx, r9
cmp rdx, 1
jle 0x14008329f
lea rcx, [r9 + 0x32]
dec rdx
movzx eax, word [rcx]
cmp word [rbx + 0x12], ax
jle 0x140083293
movsxd rbx, r13d
shl rbx, 5
add rbx, r9
inc r13d
add rcx, 0x20
dec rdx
jne 0x140083280
test r10d, r10d
jle 0x1400832e0
lea rdx, [r14 + 0x364]
mov r9d, r10d
nop
mov rax, qword [rbx + 0x18]
add r8, 8
lea rdx, [rdx + 0x50]
mov rcx, qword [r8 + rax - 8]
mov qword [rdx - 0x34], rcx
movzx eax, byte [rcx + 0x10]
mov byte [rdx - 0x50], al
imul rcx, rax, 0x78
mov rax, qword [r14 + 8]
mov ecx, dword [rcx + rax + 0x50]
mov dword [rdx - 0x70], ecx
dec r9
jne 0x1400832b0
movzx eax, word [r14 + 0x32]
mov esi, 0x200
test r11w, ax
je 0x140083352
test si, ax
jne 0x140083352
cmp byte [r14 + 0x38], 0
jne 0x140083352
test di, di
je 0x140083352
mov rax, qword [rbx + 0x18]
movsxd rcx, r10d
lea edx, [r10 - 1]
mov rax, qword [rax + rcx*8 - 8]
lea r8, [rsp + 0xf0]
mov r9d, esi
mov qword [rsp + 0x30], r8
mov qword [rsp + 0x28], rax
mov word [rsp + 0x20], dx
mov rdx, qword [r14 + 0x18]
mov r8, rbx
mov rcx, r14
call fcn.1400822a0
mov r10d, dword [rsp + 0x100]
movsx ecx, al
mov rax, qword [r14 + 0x18]
cmp ecx, dword [rax]
jne 0x140083352
mov byte [r14 + 0x38], 2
mov rdx, qword [r14 + 0x10]
test rdx, rdx
je 0x140083408
movzx r8d, word [r14 + 0x32]
test si, r8w
je 0x14008337c
movsx eax, byte [rbx + 0x16]
xor r9d, r9d
cmp eax, dword [rdx]
jne 0x14008339a
mov byte [r14 + 0x38], 2
jmp 0x14008339a
movzx ecx, byte [rbx + 0x16]
mov r9d, 0
mov eax, ecx
test cl, cl
cmovs eax, r9d
mov byte [r14 + 0x34], al
mov rax, qword [rbx + 8]
mov qword [r14 + 0x28], rax
mov eax, 0x800
test ax, r8w
je 0x140083408
movsx eax, byte [r14 + 0x34]
cmp eax, dword [rdx]
jne 0x140083408
mov rax, qword [rbx + 0x18]
movsxd rcx, r10d
lea r8, [rsp + 0xf0]
mov rax, qword [rax + rcx*8 - 8]
mov qword [rsp + 0x30], r8
mov qword [rsp + 0xf0], r9
dec r10w
mov qword [rsp + 0x28], rax
xor r9d, r9d
mov r8, rbx
mov rcx, r14
mov word [rsp + 0x20], r10w
call fcn.1400822a0
movsx ecx, al
mov rax, qword [r14 + 0x10]
cmp ecx, dword [rax]
jne 0x140083408
mov rax, qword [rsp + 0xf0]
mov byte [r14 + 0x35], 1
mov qword [r14 + 0x28], rax
mov rcx, qword [rsp + 0x90]
movzx eax, word [rbx + 0x10]
mov rdx, qword [rsp + 0x58]
mov word [r14 + 0x30], ax
test rcx, rcx
je 0x14008345f
cmp qword [rcx + 0x320], 0
je 0x140083434
call fcn.14002c560
jmp 0x140083467
cmp rdx, qword [rcx + 0x168]
jb 0x14008345f
cmp rdx, qword [rcx + 0x170]
jae 0x14008345f
mov rax, qword [rcx + 0x160]
mov qword [rdx], rax
dec dword [rcx + 0x14c]
mov qword [rcx + 0x160], rdx
jmp 0x140083467
mov rcx, rdx
call fcn.14000e700
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