Function at 0x1800167d0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x1a8
mov ebx, dword [rsp + 0x210]
mov rax, qword [0x180127a40]
xor rax, rsp
mov qword [rsp + 0x1a0], rax
mov rax, qword [rcx]
mov dword [rax + 8], 0
cmp ebx, 5
jb 0x180016817
lea rcx, str.bad_req_comp
jmp 0x1800170bb
mov r14, r9
mov r15, r8
mov r12, rdx
mov rdi, rcx
call fcn.180017150
test eax, eax
je 0x1800169f5
mov rsi, qword [rdi]
mov eax, dword [rsi + 8]
xor ecx, ecx
cmp eax, 3
setge cl
test ebx, ebx
lea ecx, [rcx + rcx + 1]
cmovne ecx, ebx
cmp eax, 3
jne 0x180016864
mov dl, 1
cmp dword [rdi + 0x4850], 3
je 0x180016866
cmp dword [rdi + 0x484c], 0
je 0x180017139
xor edx, edx
test dl, dl
mov r8d, 1
cmovne r8d, eax
cmp ecx, 3
cmovae r8d, eax
cmp eax, 3
cmovne r8d, eax
test r8d, r8d
jle 0x1800169f5
mov dword [rsp + 0x5c], edx
mov dword [rsp + 0x48], ecx
mov qword [rsp + 0x90], r12
mov qword [rsp + 0x98], r15
mov qword [rsp + 0xa0], r14
xorps xmm0, xmm0
movaps xmmword [rsp + 0x190], xmm0
movaps xmmword [rsp + 0x180], xmm0
mov dword [rsp + 0x7c], r8d
mov r14d, r8d
mov r8d, dword [rsi]
mov rax, r14
shl rax, 4
lea rbx, [rax + rax*2]
xor r15d, r15d
lea r13, [0x1800176c0]
lea rbp, [0x1800172c0]
lea r12, [0x1800172b0]
jmp 0x180016908
mov rax, r13
mov qword [rsp + r15 + 0xc0], rax
add r15, 0x30
cmp rbx, r15
je 0x180016a02
add r8d, 3
mov rcx, r8
call fcn.180009320
mov qword [rdi + r15*2 + 0x46e8], rax
test rax, rax
je 0x1800170ac
mov eax, dword [rdi + 0x4688]
cdq
idiv dword [rdi + r15*2 + 0x46a4]
mov r9d, eax
mov dword [rsp + r15 + 0xd8], eax
mov eax, dword [rdi + 0x468c]
cdq
idiv dword [rdi + r15*2 + 0x46a8]
mov ecx, eax
mov dword [rsp + r15 + 0xdc], eax
sar eax, 1
mov dword [rsp + r15 + 0xe4], eax
mov r8d, dword [rsi]
lea eax, [r9 + r8]
dec eax
xor edx, edx
div r9d
mov dword [rsp + r15 + 0xe0], eax
mov dword [rsp + r15 + 0xe8], 0
mov rax, qword [rdi + r15*2 + 0x46d0]
mov qword [rsp + r15 + 0xd0], rax
mov qword [rsp + r15 + 0xc8], rax
cmp r9d, 2
je 0x1800169d0
cmp r9d, 1
jne 0x1800168f0
cmp ecx, 2
mov rax, r13
cmove rax, rbp
cmp ecx, 1
cmove rax, r12
jmp 0x1800168f3
lea rax, [0x1800174b0]
cmp ecx, 1
je 0x1800168f3
cmp ecx, 2
jne 0x1800168f0
mov rax, qword [rdi + 0x4880]
jmp 0x1800168f3
mov rcx, rdi
call fcn.1800172a0
jmp 0x1800170c0
mov r12d, dword [rsi + 4]
mov ebx, dword [rsp + 0x48]
mov ecx, ebx
mov edx, r8d
mov r8d, r12d
mov r9d, 1
call fcn.180011ab0
test rax, rax
je 0x1800170ac
mov qword [rsp + 0x40], rax
test r12d, r12d
je 0x1800170e9
mov eax, ebx
mov qword [rsp + 0x50], rax
lea rax, [rdi + 0x46c0]
mov qword [rsp + 0xa8], rax
mov rax, qword [rsp + 0x40]
lea rcx, [rax + 1]
mov qword [rsp + 0x80], rcx
lea rcx, [rax + 2]
mov qword [rsp + 0x88], rcx
add rax, 3
mov qword [rsp + 0x60], rax
xor eax, eax
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x4c], 0
jmp 0x180016ad4
mov eax, dword [rbx]
mov r8, qword [rsp + 0x188]
mov r9, qword [rsp + 0x190]
mov dword [rsp + 0x28], edx
mov dword [rsp + 0x20], eax
mov rdx, r12
call qword [rdi + 0x4878]
nop word cs:[rax + rax]
mov ecx, dword [rsp + 0x4c]
inc ecx
mov rsi, qword [rdi]
mov rax, qword [rsp + 0x38]
add eax, dword [rsp + 0x48]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x4c], ecx
cmp ecx, dword [rsi + 4]
jae 0x1800170e9
mov esi, dword [rsi]
cmp dword [rsp + 0x7c], 0
jle 0x180016bb0
mov rbx, qword [rsp + 0xa8]
lea r12, [rsp + 0xe8]
xor r13d, r13d
jmp 0x180016b14
inc r13
add r12, 0x30
add rbx, 0x60
cmp r14, r13
je 0x180016bb0
mov ebp, dword [r12 - 4]
mov eax, dword [r12 - 0x10]
mov r15d, dword [r12 - 0xc]
mov ecx, r15d
sar ecx, 1
xor edx, edx
xor r8d, r8d
cmp ebp, ecx
setge dl
setl r8b
mov r9d, dword [r12 - 8]
shl r8d, 3
or r8, 0xffffffffffffffe0
mov r8, qword [r12 + r8]
shl edx, 3
or rdx, 0xffffffffffffffe0
mov rdx, qword [r12 + rdx]
mov rcx, qword [rbx + 0x28]
mov dword [rsp + 0x20], eax
call qword [r12 - 0x28]
mov qword [rsp + r13*8 + 0x180], rax
inc ebp
mov dword [r12 - 4], ebp
cmp ebp, r15d
jl 0x180016b00
mov dword [r12 - 4], 0
mov rax, qword [r12 - 0x18]
mov qword [r12 - 0x20], rax
mov ecx, dword [r12]
inc ecx
mov dword [r12], ecx
cmp ecx, dword [rbx]
jge 0x180016b00
movsxd rcx, dword [rbx + 4]
add rax, rcx
mov qword [r12 - 0x18], rax
jmp 0x180016b00
mov edx, dword [rsp + 0x48]
cmp edx, 3
jb 0x180016ca0
mov eax, dword [rsp + 0x4c]
mov ecx, eax
imul ecx, edx
imul ecx, esi
add rcx, qword [rsp + 0x40]
mov r12, qword [rsp + 0x180]
mov rbx, qword [rdi]
mov eax, dword [rbx + 8]
cmp eax, 3
je 0x180016e16
cmp eax, 4
jne 0x180016e83
mov eax, dword [rdi + 0x484c]
cmp eax, 2
je 0x180016fac
test eax, eax
jne 0x180016a81
cmp dword [rbx], 0
je 0x180016ab0
mov rax, qword [rsp + 0x198]
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x188]
mov qword [rsp + 0x68], rax
mov rbp, qword [rsp + 0x190]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x60]
xor r15d, r15d
nop dword [rax]
mov rax, qword [rsp + 0x70]
movzx r13d, byte [rax + r15]
movzx ecx, byte [r12 + r15]
mov edx, r13d
call fcn.180017880
mov byte [rsi - 3], al
mov rax, qword [rsp + 0x68]
movzx ecx, byte [rax + r15]
mov edx, r13d
call fcn.180017880
mov byte [rsi - 2], al
movzx ecx, byte [rbp + r15]
mov edx, r13d
call fcn.180017880
mov byte [rsi - 1], al
mov byte [rsi], 0xff
inc r15
mov eax, dword [rbx]
add rsi, qword [rsp + 0x50]
cmp r15, rax
jb 0x180016c40
jmp 0x180016ab0
mov rbp, qword [rdi]
cmp byte [rsp + 0x5c], 0
je 0x180016d20
mov eax, dword [rbp]
cmp edx, 1
jne 0x180016f07
test eax, eax
je 0x180016ab0
mov rbx, qword [rsp + 0x190]
mov r15, qword [rsp + 0x180]
mov r12, qword [rsp + 0x188]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x40]
xor r13d, r13d
nop word cs:[rax + rax]
movzx r8d, byte [rbx + r13]
movzx edx, byte [r12 + r13]
movzx ecx, byte [r15 + r13]
call fcn.180011e30
mov byte [rsi + r13], al
inc r13
mov eax, dword [rbp]
cmp r13, rax
jb 0x180016cf0
jmp 0x180016ab0
cmp dword [rbp + 8], 4
jne 0x180016ec5
mov eax, dword [rdi + 0x484c]
cmp eax, 2
je 0x18001704b
test eax, eax
jne 0x180016ec5
cmp dword [rbp], 0
je 0x180016ab0
mov rax, qword [rsp + 0x198]
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x180]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x188]
mov qword [rsp + 0xb8], rax
mov rax, qword [rsp + 0x190]
mov qword [rsp + 0xb0], rax
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x80]
xor r15d, r15d
nop word cs:[rax + rax]
mov rax, qword [rsp + 0x70]
movzx r12d, byte [rax + r15]
mov rax, qword [rsp + 0x68]
movzx ecx, byte [rax + r15]
mov edx, r12d
call fcn.180017880
mov r13d, eax
mov rax, qword [rsp + 0xb8]
movzx ecx, byte [rax + r15]
mov edx, r12d
call fcn.180017880
mov ebx, eax
mov rax, qword [rsp + 0xb0]
movzx ecx, byte [rax + r15]
mov edx, r12d
call fcn.180017880
movzx r8d, al
movzx edx, bl
movzx ecx, r13b
call fcn.180011e30
mov byte [rsi - 1], al
mov byte [rsi], 0xff
inc r15
mov eax, dword [rbp]
add rsi, qword [rsp + 0x50]
cmp r15, rax
jb 0x180016da0
jmp 0x180016ab0
cmp byte [rsp + 0x5c], 0
je 0x180016a81
cmp dword [rbx], 0
je 0x180016ab0
mov rax, qword [rsp + 0x188]
mov rcx, qword [rsp + 0x190]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x60]
xor edx, edx
nop word cs:[rax + rax]
movzx r8d, byte [r12 + rdx]
mov byte [rsi - 3], r8b
movzx r8d, byte [rax + rdx]
mov byte [rsi - 2], r8b
movzx r8d, byte [rcx + rdx]
mov byte [rsi - 1], r8b
mov byte [rsi], 0xff
inc rdx
mov r8d, dword [rbx]
add rsi, qword [rsp + 0x50]
cmp rdx, r8
jb 0x180016e50
jmp 0x180016ab0
cmp dword [rbx], 0
je 0x180016ab0
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x60]
xor eax, eax
nop dword [rax + rax]
movzx ecx, byte [r12 + rax]
mov byte [rsi - 1], cl
mov byte [rsi - 2], cl
mov byte [rsi - 3], cl
mov byte [rsi], 0xff
inc rax
mov ecx, dword [rbx]
add rsi, qword [rsp + 0x50]
cmp rax, rcx
jb 0x180016ea0
jmp 0x180016ab0
mov rax, qword [rsp + 0x180]
mov ecx, dword [rbp]
cmp edx, 1
jne 0x180016f6e
test ecx, ecx
je 0x180016ab0
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x40]
xor ecx, ecx
nop dword [rax]
movzx edx, byte [rax + rcx]
mov byte [rsi + rcx], dl
inc rcx
mov edx, dword [rbp]
cmp rcx, rdx
jb 0x180016ef0
jmp 0x180016ab0
test eax, eax
je 0x180016ab0
mov rbx, qword [rsp + 0x190]
mov r15, qword [rsp + 0x180]
mov r12, qword [rsp + 0x188]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x40]
xor r13d, r13d
nop word cs:[rax + rax]
movzx r8d, byte [rbx + r13]
movzx edx, byte [r12 + r13]
movzx ecx, byte [r15 + r13]
call fcn.180011e30
mov byte [rsi + r13*2], al
mov byte [rsi + r13*2 + 1], 0xff
inc r13
mov eax, dword [rbp]
cmp r13, rax
jb 0x180016f40
jmp 0x180016ab0
test ecx, ecx
je 0x180016ab0
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x40]
xor ecx, ecx
nop word cs:[rax + rax]
movzx edx, byte [rax + rcx]
mov byte [rsi + rcx*2], dl
mov byte [rsi + rcx*2 + 1], 0xff
inc rcx
mov edx, dword [rbp]
cmp rcx, rdx
jb 0x180016f90
jmp 0x180016ab0
mov eax, dword [rbx]
mov r8, qword [rsp + 0x188]
mov r9, qword [rsp + 0x190]
mov dword [rsp + 0x28], edx
mov dword [rsp + 0x20], eax
mov rdx, r12
call qword [rdi + 0x4878]
mov rbx, qword [rdi]
cmp dword [rbx], 0
je 0x180016ab0
mov r13, qword [rsp + 0x198]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x88]
xor r15d, r15d
nop word cs:[rax + rax]
movzx r12d, byte [r13 + r15]
movzx ecx, byte [rsi - 2]
not cl
mov edx, r12d
call fcn.180017880
mov byte [rsi - 2], al
movzx ecx, byte [rsi - 1]
not cl
mov edx, r12d
call fcn.180017880
mov byte [rsi - 1], al
movzx ecx, byte [rsi]
not cl
mov edx, r12d
call fcn.180017880
mov byte [rsi], al
inc r15
mov eax, dword [rbx]
add rsi, qword [rsp + 0x50]
cmp r15, rax
jb 0x180017000
jmp 0x180016ab0
cmp dword [rbp], 0
je 0x180016ab0
mov rbx, qword [rsp + 0x180]
mov r15, qword [rsp + 0x198]
imul esi, dword [rsp + 0x38]
add rsi, qword [rsp + 0x80]
xor r12d, r12d
nop word cs:[rax + rax]
movzx edx, byte [r15 + r12]
movzx ecx, byte [rbx + r12]
not cl
call fcn.180017880
mov byte [rsi - 1], al
mov byte [rsi], 0xff
inc r12
mov eax, dword [rbp]
add rsi, qword [rsp + 0x50]
cmp r12, rax
jb 0x180017080
jmp 0x180016ab0
mov rcx, rdi
call fcn.1800172a0
lea rcx, str.outofmem
call fcn.1800082a0
xor esi, esi
mov rcx, qword [rsp + 0x1a0]
xor rcx, rsp
call fcn.1800cf260
mov rax, rsi
add rsp, 0x1a8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, rdi
call fcn.1800172a0
mov rax, qword [rdi]
mov eax, dword [rax]
mov rcx, qword [rsp + 0x90]
mov dword [rcx], eax
mov rax, qword [rdi]
mov eax, dword [rax + 4]
mov rcx, qword [rsp + 0x98]
mov dword [rcx], eax
mov rdx, qword [rsp + 0xa0]
test rdx, rdx
je 0x180017132
mov rax, qword [rdi]
xor ecx, ecx
cmp dword [rax + 8], 3
setge cl
lea eax, [rcx*2 + 1]
mov dword [rdx], eax
mov rsi, qword [rsp + 0x40]
jmp 0x1800170c2
cmp dword [rdi + 0x4848], 0
sete dl
jmp 0x180016866