Function at 0x18010769c
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x68]
sub rsp, 0x168
mov rax, qword [0x18020d140]
xor rax, rsp
mov qword [rbp + 0x50], rax
mov r15d, dword [rbp + 0xd0]
xor edi, edi
mov rax, qword [rcx]
mov rbx, rcx
mov qword [rsp + 0x60], r9
mov qword [rsp + 0x58], r8
mov qword [rsp + 0x50], rdx
mov dword [rax + 8], edi
mov dword [rsp + 0x30], r15d
cmp r15d, 4
ja 0x180107d27
call fcn.18010b1c4
test eax, eax
je 0x180107d1d
mov rcx, qword [rbx]
lea esi, [rdi + 1]
lea r8d, [rdi + 3]
mov eax, dword [rcx + 8]
test r15d, r15d
jne 0x180107721
cmp eax, r8d
mov r15d, esi
cmovge r15d, r8d
mov dword [rsp + 0x30], r15d
cmp eax, r8d
jne 0x180107748
cmp dword [rbx + 0x4850], r8d
je 0x18010773f
cmp dword [rbx + 0x484c], edi
jne 0x180107748
cmp dword [rbx + 0x4848], edi
jne 0x180107748
mov edx, esi
mov qword [rsp + 0x38], rsi
jmp 0x180107754
mov qword [rsp + 0x38], rdi
mov edx, edi
cmp eax, r8d
jne 0x180107761
cmp r15d, r8d
jge 0x180107761
test edx, edx
jne 0x180107761
mov eax, esi
jmp 0x180107769
test eax, eax
jle 0x180107d1d
movsxd r13, eax
xorps xmm0, xmm0
mov qword [rsp + 0x40], r13
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x68], xmm0
movdqu xmmword [rsp + 0x78], xmm1
test eax, eax
jle 0x180107871
mov r12, rdi
lea r14, [rbx + 0x46a4]
lea rdi, [rbp - 0x58]
mov rax, qword [rbx]
mov ecx, dword [rax]
add ecx, r8d
call fcn.18010f280
mov qword [r14 + 0x44], rax
test rax, rax
je 0x180107892
mov eax, dword [rbx + 0x4688]
and dword [rdi + 0x10], 0
cdq
idiv dword [r14]
mov r8d, eax
mov dword [rdi], eax
mov eax, dword [rbx + 0x468c]
cdq
idiv dword [r14 + 4]
xor edx, edx
mov ecx, eax
mov dword [rdi + 4], eax
sar ecx, 1
mov r9d, eax
mov dword [rdi + 0xc], ecx
mov rcx, qword [rbx]
mov eax, dword [rcx]
mov rcx, qword [r14 + 0x2c]
dec eax
add eax, r8d
mov qword [rdi - 8], rcx
div r8d
mov qword [rdi - 0x10], rcx
mov dword [rdi + 8], eax
cmp r8d, esi
jne 0x180107821
cmp r9d, esi
jne 0x18010780f
lea rax, [0x180107d58]
jmp 0x180107850
mov r8d, esi
cmp r9d, 2
jne 0x180107835
lea rax, [0x180113404]
jmp 0x180107850
cmp r8d, 2
jne 0x180107849
cmp r9d, esi
jne 0x180107835
lea rax, [0x1801130a4]
jmp 0x180107850
cmp r8d, 2
jne 0x180107849
cmp r9d, r8d
jne 0x180107849
mov rax, qword [rbx + 0x4880]
jmp 0x180107850
lea rax, [0x18011306c]
mov qword [rdi - 0x18], rax
add r12, rsi
add rdi, 0x30
add r14, 0x60
mov r8d, 3
cmp r12, r13
jl 0x180107799
mov rcx, qword [rbx]
mov r8d, dword [rcx + 4]
mov r9d, esi
mov edx, dword [rcx]
mov ecx, r15d
call fcn.18010f2c8
xor r8d, r8d
mov qword [rsp + 0x48], rax
mov r12, rax
test rax, rax
jne 0x1801078a6
mov rcx, rbx
call fcn.1801093b4
lea rcx, str.outofmem
jmp 0x180107d2e
mov rcx, qword [rbx]
mov edx, r8d
mov dword [rsp + 0x34], edx
cmp dword [rcx + 4], r8d
jbe 0x180107cdd
mov r14, qword [rsp + 0x68]
mov r13, qword [rsp + 0x78]
mov r11, qword [rsp + 0x70]
jmp 0x1801078ce
xor r8d, r8d
mov edi, dword [rcx]
imul edi, edx
imul edi, r15d
add rdi, r12
mov r12, r8
cmp qword [rsp + 0x40], r8
jle 0x18010798e
mov r15, qword [rsp + 0x40]
lea r13, [rbx + 0x46c0]
lea r14, [rbp - 0x4c]
mov eax, dword [r14 - 8]
sar eax, 1
cmp dword [r14], eax
jl 0x180107909
mov r8, qword [r14 - 0x1c]
jmp 0x18010790d
mov r8, qword [r14 - 0x14]
jl 0x180107915
mov rdx, qword [r14 - 0x14]
jmp 0x180107919
mov rdx, qword [r14 - 0x1c]
mov eax, dword [r14 - 0xc]
mov r9d, dword [r14 - 4]
mov rcx, qword [r13 + 0x28]
mov dword [rsp + 0x20], eax
call qword [r14 - 0x24]
mov qword [rsp + r12*8 + 0x68], rax
xor r8d, r8d
mov eax, dword [r14]
inc eax
mov dword [r14], eax
cmp eax, dword [r14 - 8]
jl 0x180107967
add dword [r14 + 4], esi
mov eax, dword [r14 + 4]
mov rcx, qword [r14 - 0x14]
mov dword [r14], r8d
mov qword [r14 - 0x1c], rcx
cmp eax, dword [r13]
jge 0x180107967
movsxd rax, dword [r13 + 4]
add rax, rcx
mov qword [r14 - 0x14], rax
add r12, rsi
add r14, 0x30
add r13, 0x60
cmp r12, r15
jl 0x1801078f8
mov rcx, qword [rbx]
mov r14, qword [rsp + 0x68]
mov r15d, dword [rsp + 0x30]
mov r13, qword [rsp + 0x78]
mov r11, qword [rsp + 0x70]
mov eax, 3
cmp r15d, eax
jl 0x180107b35
cmp dword [rcx + 8], eax
jne 0x180107a11
cmp qword [rsp + 0x38], r8
je 0x1801079e5
cmp dword [rcx], 0
jbe 0x180107a09
movsxd r10, r15d
mov r9d, r8d
xor edx, edx
mov al, byte [r9 + r14]
mov byte [rdi], al
mov rax, qword [rsp + rdx*8 + 0x70]
mov cl, byte [r9 + rax]
mov byte [rdi + rdx + 1], cl
add rdx, rsi
cmp rdx, 2
jl 0x1801079bb
mov byte [rdi + 3], 0xff
add r8d, esi
mov rax, qword [rbx]
add rdi, r10
cmp r8d, dword [rax]
jb 0x1801079b0
jmp 0x180107a09
mov eax, dword [rcx]
mov r9, r13
mov r8, qword [rsp + 0x70]
mov rcx, rdi
mov dword [rsp + 0x28], r15d
mov rdx, r14
mov dword [rsp + 0x20], eax
call qword [rbx + 0x4878]
mov r11, qword [rsp + 0x70]
mov rcx, qword [rbx]
jmp 0x180107cc5
cmp dword [rcx + 8], 4
jne 0x180107b03
mov eax, dword [rbx + 0x484c]
test eax, eax
jne 0x180107a7c
mov r10d, r8d
cmp dword [rcx], r8d
jbe 0x180107a09
movsxd r11, r15d
mov r15, qword [rsp + 0x70]
mov rax, qword [rbp - 0x80]
mov r9d, r10d
mov dl, byte [r9 + rax]
mov cl, byte [r9 + r14]
call fcn.1801080d0
mov byte [rdi], al
mov cl, byte [r9 + r15]
call fcn.1801080d0
mov byte [rdi + 1], al
mov cl, byte [r9 + r13]
call fcn.1801080d0
mov byte [rdi + 2], al
add r10d, esi
mov byte [rdi + 3], 0xff
add rdi, r11
mov rax, qword [rbx]
cmp r10d, dword [rax]
jb 0x180107a35
mov r15d, dword [rsp + 0x30]
jmp 0x180107a04
mov edx, dword [rcx]
mov r9, r13
mov r10, qword [rbx + 0x4878]
mov rcx, rdi
mov r8, qword [rsp + 0x70]
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], edx
mov rdx, r14
cmp eax, 2
jne 0x180107afb
call r10
mov rax, qword [rbx]
xor r9d, r9d
cmp dword [rax], r9d
jbe 0x180107a04
mov r13, qword [rbp - 0x80]
movsxd r10, r15d
mov cl, byte [rdi]
mov dl, byte [r9 + r13]
not cl
call fcn.1801080d0
mov cl, byte [rdi + 1]
not cl
mov byte [rdi], al
call fcn.1801080d0
mov cl, byte [rdi + 2]
not cl
mov byte [rdi + 1], al
call fcn.1801080d0
mov byte [rdi + 2], al
add r9d, esi
mov rax, qword [rbx]
add rdi, r10
cmp r9d, dword [rax]
jb 0x180107aba
mov r13, qword [rsp + 0x78]
jmp 0x180107a04
call r10
jmp 0x180107a04
mov edx, r8d
cmp dword [rcx], r8d
jbe 0x180107a09
movsxd r8, r15d
mov eax, edx
add edx, esi
mov cl, byte [rax + r14]
mov byte [rdi + 2], cl
mov byte [rdi + 1], cl
mov byte [rdi], cl
mov byte [rdi + 3], 0xff
add rdi, r8
mov rax, qword [rbx]
cmp edx, dword [rax]
jb 0x180107b12
jmp 0x180107a09
cmp qword [rsp + 0x38], r8
je 0x180107bb3
mov eax, dword [rcx]
mov r9d, r8d
cmp r15d, esi
jne 0x180107b7a
test eax, eax
je 0x180107cc5
mov eax, r9d
movzx r8d, byte [rax + r13]
movzx edx, byte [rax + r11]
movzx ecx, byte [rax + r14]
call fcn.180109798
mov byte [rdi], al
add r9d, esi
mov rcx, qword [rbx]
add rdi, rsi
cmp r9d, dword [rcx]
jb 0x180107b4e
jmp 0x180107cc5
test eax, eax
je 0x180107cc5
mov eax, r9d
movzx r8d, byte [rax + r13]
movzx edx, byte [rax + r11]
movzx ecx, byte [rax + r14]
call fcn.180109798
mov byte [rdi], al
add r9d, esi
mov byte [rdi + 1], 0xff
lea rdi, [rdi + 2]
mov rcx, qword [rbx]
cmp r9d, dword [rcx]
jb 0x180107b82
jmp 0x180107cc5
cmp dword [rcx + 8], 4
jne 0x180107c85
mov eax, dword [rbx + 0x484c]
test eax, eax
jne 0x180107c44
mov r12d, r8d
cmp dword [rcx], r8d
jbe 0x180107cc5
movsxd r13, r15d
mov r15, qword [rsp + 0x78]
mov rax, qword [rbp - 0x80]
mov r11d, r12d
mov dl, byte [r11 + rax]
mov cl, byte [r11 + r15]
call fcn.1801080d0
movzx r10d, al
mov rax, qword [rsp + 0x70]
mov cl, byte [r11 + rax]
call fcn.1801080d0
mov cl, byte [r11 + r14]
movzx r9d, al
call fcn.1801080d0
movzx ecx, al
mov r8d, r10d
mov edx, r9d
call fcn.180109798
mov byte [rdi], al
add r12d, esi
mov byte [rdi + 1], 0xff
add rdi, r13
mov rcx, qword [rbx]
cmp r12d, dword [rcx]
jb 0x180107bdb
mov r15d, dword [rsp + 0x30]
mov r13, qword [rsp + 0x78]
mov r11, qword [rsp + 0x70]
jmp 0x180107cc5
cmp eax, 2
jne 0x180107c85
mov r9d, r8d
cmp dword [rcx], r8d
jbe 0x180107cc5
mov r13, qword [rbp - 0x80]
movsxd r10, r15d
mov eax, r9d
mov cl, byte [rax + r14]
mov dl, byte [rax + r13]
not cl
call fcn.1801080d0
mov byte [rdi], al
add r9d, esi
mov byte [rdi + 1], 0xff
add rdi, r10
mov rcx, qword [rbx]
cmp r9d, dword [rcx]
jb 0x180107c58
mov r13, qword [rsp + 0x78]
jmp 0x180107cc5
mov eax, dword [rcx]
mov edx, r8d
cmp r15d, esi
jne 0x180107ca7
test eax, eax
je 0x180107cc5
mov ecx, edx
add edx, esi
mov al, byte [rcx + r14]
mov byte [rcx + rdi], al
mov rcx, qword [rbx]
cmp edx, dword [rcx]
jb 0x180107c93
jmp 0x180107cc5
test eax, eax
je 0x180107cc5
mov eax, edx
add edx, esi
mov cl, byte [rax + r14]
mov byte [rdi], cl
add rdi, rsi
mov byte [rdi], 0xff
add rdi, rsi
mov rcx, qword [rbx]
cmp edx, dword [rcx]
jb 0x180107cab
mov edx, dword [rsp + 0x34]
mov r12, qword [rsp + 0x48]
add edx, esi
mov dword [rsp + 0x34], edx
cmp edx, dword [rcx + 4]
jb 0x1801078cb
mov rcx, rbx
call fcn.1801093b4
mov rax, qword [rbx]
mov ecx, dword [rax]
mov rax, qword [rsp + 0x50]
mov dword [rax], ecx
mov rax, qword [rbx]
mov ecx, dword [rax + 4]
mov rax, qword [rsp + 0x58]
mov dword [rax], ecx
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x180107d18
mov rax, qword [rbx]
mov edx, 3
cmp dword [rax + 8], edx
cmovge esi, edx
mov dword [rcx], esi
mov rax, r12
jmp 0x180107d35
mov rcx, rbx
call fcn.1801093b4
jmp 0x180107d33
lea rcx, str.bad_req_comp
call fcn.18010b4c4
xor eax, eax
mov rcx, qword [rbp + 0x50]
xor rcx, rsp
call fcn.180147bf0
add rsp, 0x168
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret