Function at 0x18009cdc0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov word [rsp + 0x10], dx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa8
mov rax, qword [rcx]
xor r8d, r8d
mov r13, rcx
movzx ecx, byte [rcx + 0x3b]
mov r15, qword [rax]
mov ebp, 1
movzx edi, dx
mov dword [rsp + 0x48], r8d
movzx esi, r8w
mov qword [rsp + 0x98], r15
movzx r14d, r8w
mov qword [rsp + 0x78], r8
mov qword [rsp + 0x90], rax
mov dword [rsp + 0x100], ecx
cmp ecx, ebp
jg 0x18009ce26
mov ebx, ebp
jmp 0x18009ce36
mov ebx, 0xa
mov eax, 5
cmp ecx, 2
cmove ebx, eax
mov rax, qword [r13 + 0x10]
mov dword [rsp + 0x4c], ebx
test rax, rax
je 0x18009ce52
test di, di
je 0x18009ce52
mov r12d, dword [rax]
mov dword [rsp + 0x60], r12d
jmp 0x18009ce5a
mov r12d, r8d
mov dword [rsp + 0x60], r8d
lea eax, [rcx + 4]
imul eax, ebx
lea ecx, [r12 + rax*8]
add ecx, ecx
movsxd rdx, ecx
mov rcx, r15
call fcn.180017520
mov rdx, rax
mov qword [rsp + 0x58], rax
test rax, rax
jne 0x18009ce86
lea eax, [rdx + 7]
jmp 0x18009d87a
xor ecx, ecx
mov r10, rax
mov qword [rsp + 0x70], rax
movsxd rax, ebx
shl rax, 5
lea r9, [rax + rdx]
mov qword [rsp + 0x80], 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 0x18009cee0
movsxd r8, dword [rsp + 0x100]
shl r8, 3
add rdx, 0x18
nop dword [rax]
mov qword [rdx], rcx
dec eax
add rdx, 0x20
add rcx, r8
test eax, eax
jg 0x18009ced0
test r12d, r12d
je 0x18009cf04
movsxd r8, r12d
xor edx, edx
mov qword [rsp + 0x78], rcx
add r8, r8
call fcn.1800b45b0
mov r10, qword [rsp + 0x70]
mov r9, qword [rsp + 0x80]
mov rax, qword [rsp + 0x90]
mov r11d, dword [rsp + 0x100]
mov ecx, gethostbyaddr
mov eax, dword [rax + 0x1dc]
mov edx, ebp
cmp eax, ecx
mov dword [rsp + 0x68], edx
cmovb ecx, eax
mov word [r9 + 0x10], cx
test r12d, r12d
je 0x18009cf45
or ecx, 0xffffffff
movzx eax, r12b
test r11d, r11d
cmovg eax, ecx
mov byte [r9 + 0x16], al
xor r12d, r12d
mov ecx, r12d
mov dword [rsp + 0x108], ecx
test r11d, r11d
jle 0x18009d620
mov ebx, 0x4000
mov eax, r12d
mov r8d, r12d
mov dword [rsp + 0x50], r12d
mov rdi, r9
mov qword [rsp + 0x40], r9
mov dword [rsp + 0x64], eax
test edx, edx
jle 0x18009d419
nop
mov r15, qword [r13 + 0x20]
test r15, r15
je 0x18009d3eb
nop dword [rax]
mov r9, qword [rdi]
movzx r11d, byte [rdi + 0x16]
mov qword [rsp + 0x88], r12
mov rax, r9
not rax
test qword [r15], rax
jne 0x18009d3d6
mov rbp, qword [r15 + 8]
test r9, rbp
jne 0x18009d3d1
test dword [r15 + 0x28], ebx
je 0x18009cfcd
cmp word [rdi + 0x10], 0xa
jl 0x18009d3d1
movzx r10d, word [rdi + 0x10]
movzx edx, word [r15 + 0x14]
movzx ebx, word [r15 + 0x12]
add dx, r10w
lea r12, [0x180000000]
cmp bx, dx
jl 0x18009d021
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x18009d059
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d008
inc bx
jmp 0x18009d059
movsx rcx, bx
movsx rax, dx
sub rcx, rax
movzx eax, byte [rcx + r12 + 0x2b5990]
add bx, ax
jmp 0x18009d059
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jle 0x18009d035
movzx ebx, dx
jmp 0x18009d059
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d042
lea ebx, [rdx + 1]
jmp 0x18009d059
movsx rax, bx
movsx rcx, dx
sub rcx, rax
movzx ebx, byte [rcx + r12 + 0x2b5990]
add bx, dx
movzx edx, word [rdi + 0x14]
cmp bx, dx
jl 0x18009d097
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x18009d0cf
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d07e
inc bx
jmp 0x18009d0cf
movsx rax, dx
movsx rcx, bx
sub rcx, rax
movzx eax, byte [rcx + r12 + 0x2b5990]
add bx, ax
jmp 0x18009d0cf
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jle 0x18009d0ab
movzx ebx, dx
jmp 0x18009d0cf
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d0b8
lea ebx, [rdx + 1]
jmp 0x18009d0cf
movsx rax, bx
movsx rcx, dx
sub rcx, rax
movzx ebx, byte [rcx + r12 + 0x2b5990]
add bx, dx
movzx r12d, word [r15 + 0x16]
or rbp, r9
add r12w, r10w
test r11b, r11b
jns 0x18009d120
movzx r9d, word [r13 + 0x34]
mov rdx, qword [r13 + 0x10]
lea rax, [rsp + 0x88]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x108]
mov r8, rdi
mov rcx, r13
mov qword [rsp + 0x28], r15
mov word [rsp + 0x20], ax
call fcn.18009c5a0
mov r13, qword [rsp + 0x88]
movzx r11d, al
jmp 0x18009d124
mov r13, qword [rdi + 8]
test r11b, r11b
js 0x18009d348
mov r9d, dword [rsp + 0x60]
movsx ecx, r11b
cmp ecx, r9d
jge 0x18009d348
mov rax, qword [rsp + 0x78]
movsx r10, r11b
movzx edx, word [rax + r10*2]
test dx, dx
jne 0x18009d2ca
movzx edi, word [rsp + 0xf8]
mov eax, r9d
sub eax, ecx
movzx r8d, di
imul eax, eax, 0x64
cdq
idiv r9d
movsxd rcx, eax
mov eax, 0x28
cmp rcx, 8
jae 0x18009d19f
cmp rcx, 2
jae 0x18009d190
xor edx, edx
movzx r9d, dx
jmp 0x18009d1fb
add rcx, rcx
add ax, 0xfff6
cmp rcx, 8
jb 0x18009d190
jmp 0x18009d1dd
cmp rcx, 0xff
jbe 0x18009d1c1
nop dword [rax + rax]
shr rcx, 4
add ax, 0x28
cmp rcx, 0xff
ja 0x18009d1b0
cmp rcx, 0xf
jbe 0x18009d1dd
nop word [rax + rax]
shr rcx, 1
add ax, 0xa
cmp rcx, 0xf
ja 0x18009d1d0
lea rdx, [0x180000000]
and ecx, 7
movzx r9d, word [rdx + rcx*2 + 0x2e82f0]
add r9w, ax
sub r9w, 0xa
xor edx, edx
mov rax, qword [rsp + 0xf0]
add r9w, di
mov ecx, 0x4000
sub r9w, 0x32
test word [rax + 0x34], cx
je 0x18009d223
movzx eax, word [rax + 0x32]
cmp ax, di
cmovl r8w, ax
cmp r8w, 0xa
jle 0x18009d2bc
movsx rax, r8w
mov ecx, 0x28
cmp rax, 8
jae 0x18009d25f
cmp rax, 2
jae 0x18009d250
movzx eax, dx
jmp 0x18009d2b6
add rax, rax
add cx, 0xfff6
cmp rax, 8
jb 0x18009d250
jmp 0x18009d29d
cmp rax, 0xff
jbe 0x18009d280
nop word [rax + rax]
shr rax, 4
add cx, 0x28
cmp rax, 0xff
ja 0x18009d270
cmp rax, 0xf
jbe 0x18009d29d
nop word [rax + rax]
shr rax, 1
add cx, 0xa
cmp rax, 0xf
ja 0x18009d290
and eax, 7
lea rdx, [0x180000000]
movzx eax, word [rdx + rax*2 + 0x2e82f0]
add ax, cx
sub ax, 0xa
movsx edx, ax
sub edx, 0x21
mov rax, qword [rsp + 0x78]
add dx, r9w
mov word [rax + r10*2], dx
cmp bx, dx
jl 0x18009d30a
movsx ecx, dx
movsx r8d, bx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x18009d348
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d2eb
lea edx, [rbx + 1]
jmp 0x18009d34b
movsx rax, dx
movsx rcx, bx
sub rcx, rax
lea rax, [0x180000000]
movzx edx, byte [rcx + rax + 0x2b5990]
add dx, bx
jmp 0x18009d34b
movsx ecx, bx
movsx r8d, dx
lea eax, [rcx + 0x31]
cmp r8d, eax
jg 0x18009d34b
lea eax, [rcx + 0x1f]
cmp r8d, eax
jle 0x18009d326
inc dx
jmp 0x18009d34b
movsx rcx, dx
movsx rax, bx
sub rcx, rax
lea rax, [0x180000000]
movzx eax, byte [rcx + rax + 0x2b5990]
add ax, dx
movzx edx, ax
jmp 0x18009d34b
movzx edx, bx
mov r10, qword [rsp + 0x70]
xor r8d, r8d
mov ecx, r8d
mov r8d, dword [rsp + 0x50]
mov rdi, r10
test r8d, r8d
jle 0x18009d37c
cmp qword [rdi], rbp
jne 0x18009d371
movzx eax, byte [rdi + 0x16]
xor al, r11b
jns 0x18009d39d
inc ecx
add rdi, 0x20
cmp ecx, r8d
jl 0x18009d363
cmp r8d, dword [rsp + 0x4c]
jl 0x18009d498
cmp dx, si
jg 0x18009d3bc
jne 0x18009d394
cmp bx, r14w
jge 0x18009d3bc
mov eax, dword [rsp + 0x48]
jmp 0x18009d4a3
cmp ecx, r8d
jge 0x18009d37c
movzx eax, word [rdi + 0x12]
cmp ax, dx
jl 0x18009d3bc
jne 0x18009d4ad
cmp word [rdi + 0x10], r12w
jg 0x18009d4ad
mov r13, qword [rsp + 0xf0]
mov rdi, qword [rsp + 0x40]
mov ebx, 0x4000
xor r12d, r12d
mov ebp, 1
mov r15, qword [r15 + 0x40]
test r15, r15
jne 0x18009cf90
mov eax, dword [rsp + 0x64]
mov edx, dword [rsp + 0x68]
inc eax
add rdi, 0x20
mov dword [rsp + 0x64], eax
mov qword [rsp + 0x40], rdi
cmp eax, edx
jl 0x18009cf80
mov ecx, dword [rsp + 0x108]
mov r9, qword [rsp + 0x80]
mov r11d, dword [rsp + 0x100]
mov rax, r10
inc ecx
mov edx, r8d
mov r10, r9
mov qword [rsp + 0x70], r9
mov r9, rax
mov qword [rsp + 0x80], rax
mov dword [rsp + 0x68], edx
mov dword [rsp + 0x108], ecx
cmp ecx, r11d
jl 0x18009cf60
test r8d, r8d
jne 0x18009d610
mov rcx, qword [rsp + 0x90]
lea rdx, str.no_query_solution
call fcn.18001a500
mov r11, qword [rsp + 0x98]
test r11, r11
je 0x18009d5a4
cmp qword [r11 + 0x290], 0
je 0x18009d56e
mov rdx, qword [rsp + 0x58]
mov rcx, r11
call fcn.180017190
mov eax, ebp
jmp 0x18009d87a
mov eax, r8d
inc r8d
mov dword [rsp + 0x50], r8d
movsxd rdi, eax
shl rdi, 5
add rdi, r10
mov rax, qword [r15 + 8]
mov rcx, qword [rsp + 0x40]
or rax, qword [rcx]
mov word [rdi + 0x14], bx
mov qword [rdi + 8], r13
mov qword [rdi], rax
movsxd rax, dword [rsp + 0x108]
mov word [rdi + 0x10], r12w
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 fcn.1800acfd0
mov r11, qword [rdi + 0x18]
mov r8d, dword [rsp + 0x50]
mov r10, qword [rsp + 0x70]
xor r12d, r12d
mov qword [rbx + r11], r15
mov ebx, dword [rsp + 0x4c]
lea ebp, [r12 + 1]
cmp r8d, ebx
jl 0x18009d557
movzx esi, word [r10 + 0x12]
movzx r14d, word [r10 + 0x10]
mov edx, ebp
mov dword [rsp + 0x48], r12d
cmp ebx, edx
jle 0x18009d557
lea rax, [r10 + 0x32]
nop dword [rax]
movzx ecx, word [rax]
cmp cx, si
jg 0x18009d541
jne 0x18009d54d
cmp word [rax + 2], r14w
jle 0x18009d54d
movzx r14d, word [rax + 2]
movzx esi, cx
mov dword [rsp + 0x48], edx
inc edx
add rax, 0x20
cmp edx, ebx
jl 0x18009d530
mov rdi, qword [rsp + 0x40]
mov r13, qword [rsp + 0xf0]
mov ebx, 0x4000
jmp 0x18009d3d6
mov rbx, qword [rsp + 0x58]
cmp rbx, qword [r11 + 0x178]
jb 0x18009d5a9
cmp rbx, qword [r11 + 0x180]
jae 0x18009d5a9
mov rax, qword [r11 + 0x170]
mov qword [rbx], rax
dec dword [r11 + 0x158]
mov qword [r11 + 0x170], rbx
mov eax, ebp
jmp 0x18009d87a
mov rbx, qword [rsp + 0x58]
cmp dword [0x1802e7f80], 0
je 0x18009d600
mov rcx, qword [0x1802f0c18]
test rcx, rcx
je 0x18009d5c4
call qword [0x1802e8008]
mov rcx, rbx
call qword [0x1802e7fc0]
dec qword [0x1802f0968]
movsxd rcx, eax
sub qword [0x1802f0920], rcx
mov rcx, rbx
call qword [0x1802e7fb0]
mov rcx, qword [0x1802f0c18]
test rcx, rcx
je 0x18009d609
call qword [0x1802e8018]
mov eax, ebp
jmp 0x18009d87a
mov rcx, rbx
call qword [0x1802e7fb0]
mov eax, ebp
jmp 0x18009d87a
movzx edi, word [rsp + 0xf8]
mov r15, qword [rsp + 0x98]
movsxd rdx, edx
mov rbx, r9
cmp rdx, 1
jle 0x18009d651
lea rcx, [r9 + 0x32]
dec rdx
movzx eax, word [rcx]
cmp word [rbx + 0x12], ax
jle 0x18009d646
movsxd rbx, ebp
shl rbx, 5
add rbx, r9
inc ebp
add rcx, 0x20
dec rdx
jne 0x18009d633
test r11d, r11d
jle 0x18009d695
mov r8, r12
lea rdx, [r13 + 0x36c]
mov r9d, r11d
mov rax, qword [rbx + 0x18]
add rdx, 0x58
add r8, 8
mov rcx, qword [r8 + rax - 8]
mov qword [rdx - 0x3c], rcx
movzx eax, byte [rcx + 0x10]
mov byte [rdx - 0x58], al
mov ecx, eax
mov rax, qword [r13 + 8]
imul rcx, rcx, 0x78
dec r9
mov ecx, dword [rcx + rax + 0x50]
mov dword [rdx - 0x80], ecx
jne 0x18009d663
movzx eax, word [r13 + 0x34]
mov ecx, 0x400
mov esi, 0x200
test cx, ax
je 0x18009d70b
test si, ax
jne 0x18009d70b
cmp byte [r13 + 0x3a], 0
jne 0x18009d70b
test di, di
je 0x18009d70b
mov rax, qword [rbx + 0x18]
movsxd rcx, r11d
lea edx, [r11 - 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 [r13 + 0x18]
mov r8, rbx
mov rcx, r13
call fcn.18009c5a0
mov r11d, dword [rsp + 0x100]
movsx ecx, al
mov rax, qword [r13 + 0x18]
cmp ecx, dword [rax]
jne 0x18009d70b
mov byte [r13 + 0x3a], 2
mov rdx, qword [r13 + 0x10]
test rdx, rdx
je 0x18009d7bd
movzx r8d, word [r13 + 0x34]
test si, r8w
je 0x18009d732
movsx eax, byte [rbx + 0x16]
cmp eax, dword [rdx]
jne 0x18009d74a
mov byte [r13 + 0x3a], 2
jmp 0x18009d74a
movzx eax, byte [rbx + 0x16]
mov ecx, eax
test al, al
cmovs ecx, r12d
mov byte [r13 + 0x36], cl
mov rax, qword [rbx + 8]
mov qword [r13 + 0x28], rax
mov eax, 0x800
test ax, r8w
je 0x18009d7bd
movsx eax, byte [r13 + 0x36]
cmp eax, dword [rdx]
jne 0x18009d7bd
test r11d, r11d
jle 0x18009d7bd
mov rax, qword [rbx + 0x18]
movsxd rcx, r11d
lea r8, [rsp + 0xf0]
mov rax, qword [rax + rcx*8 - 8]
mov qword [rsp + 0x30], r8
dec r11w
mov qword [rsp + 0x28], rax
xor r9d, r9d
mov r8, rbx
mov rcx, r13
mov qword [rsp + 0xf0], r12
mov word [rsp + 0x20], r11w
call fcn.18009c5a0
movsx ecx, al
mov rax, qword [r13 + 0x10]
cmp ecx, dword [rax]
jne 0x18009d7bd
mov rax, qword [rsp + 0xf0]
mov byte [r13 + 0x37], 1
mov qword [r13 + 0x28], rax
movzx eax, word [rbx + 0x10]
mov word [r13 + 0x30], ax
test r15, r15
je 0x18009d818
cmp qword [r15 + 0x290], 0
je 0x18009d7e7
mov rdx, qword [rsp + 0x58]
mov rcx, r15
call fcn.180017190
jmp 0x18009d878
mov rbx, qword [rsp + 0x58]
cmp rbx, qword [r15 + 0x178]
jb 0x18009d81d
cmp rbx, qword [r15 + 0x180]
jae 0x18009d81d
mov rax, qword [r15 + 0x170]
mov qword [rbx], rax
dec dword [r15 + 0x158]
mov qword [r15 + 0x170], rbx
jmp 0x18009d878
mov rbx, qword [rsp + 0x58]
cmp dword [0x1802e7f80], 0
je 0x18009d86f
mov rcx, qword [0x1802f0c18]
test rcx, rcx
je 0x18009d838
call qword [0x1802e8008]
mov rcx, rbx
call qword [0x1802e7fc0]
dec qword [0x1802f0968]
movsxd rcx, eax
sub qword [0x1802f0920], rcx
mov rcx, rbx
call qword [0x1802e7fb0]
mov rcx, qword [0x1802f0c18]
test rcx, rcx
je 0x18009d878
call qword [0x1802e8018]
jmp 0x18009d878
mov rcx, rbx
call qword [0x1802e7fb0]
xor eax, eax
add rsp, 0xa8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret