Function at 0x140178170
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbp
push r14
push rsi
push rdi
push rbx
sub rsp, 0x60
lea rbp, [rsp + 0x60]
mov qword [rbp - 8], 0xfffffffffffffffe
mov rdi, qword [rcx]
test rdi, rdi
je 0x1401783f4
mov r14, rcx
mov rbx, qword [rdx]
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
movzx eax, byte [rax + 0xb8]
cmp eax, 1
je 0x1401781e9
test eax, eax
jne 0x140178224
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rsi, qword [rcx + rax*8]
lea rcx, [rsi + 0x68]
lea rdx, [0x140169e20]
call fcn.1401c5ea0
mov byte [rsi + 0xb8], 1
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx + rax*8]
movzx eax, byte [rcx + 0xb4]
movzx ecx, byte [rcx + 0xb5]
test al, al
je 0x14017822a
test cl, cl
jne 0x14017822a
mov rax, qword [rbx]
mov rcx, qword [rbx + 8]
call qword [rax + 0x10]
mov sil, 2
jmp 0x1401783ac
xor eax, eax
xor ecx, ecx
jmp 0x14017825f
xor edx, edx
mov r8d, ecx
sub r8b, 1
movzx r8d, r8b
cmovb r8d, edx
test al, al
movzx edx, cl
cmovne edx, r8d
mov r8d, dword [0x1402dd5d0]
mov r9, qword gs:[0x58]
mov r8, qword [r9 + r8*8]
mov byte [r8 + 0xb5], dl
mov byte [rbp - 0x40], al
mov byte [rbp - 0x3f], cl
mov rax, qword [rdi + 0x30]
test al, 2
jne 0x1401783a0
mov sil, 1
test al, 4
jne 0x1401783ac
test al, 1
je 0x1401782e2
mov rax, qword [rbx + 8]
cmp rax, qword [rdi + 0x28]
jne 0x1401782b7
mov rax, qword [rdi + 0x20]
mov rcx, qword [rbx]
mov rdx, qword [rax]
cmp rdx, qword [rcx]
jne 0x1401782b7
mov rdx, qword [rax + 8]
cmp rdx, qword [rcx + 8]
jne 0x1401782b7
mov rdx, qword [rax + 0x10]
cmp rdx, qword [rcx + 0x10]
jne 0x1401782b7
mov rax, qword [rax + 0x18]
cmp rax, qword [rcx + 0x18]
je 0x140178317
mov rax, qword [rdi + 0x30]
nop dword [rax + rax]
mov rcx, rax
and rcx, 0xfffffffffffffffe
lock cmpxchg qword [rdi + 0x30], rcx
jne 0x1401782c0
test al, 2
jne 0x14017839a
mov rax, qword [rdi + 0x20]
mov rcx, qword [rdi + 0x28]
call qword [rax + 0x18]
mov rax, qword [rbx]
mov rcx, qword [rbx + 8]
call qword [rax]
mov qword [rdi + 0x20], rax
mov qword [rdi + 0x28], rdx
mov rax, qword [rdi + 0x30]
nop word [rax + rax]
mov rcx, rax
or rcx, 1
lock cmpxchg qword [rdi + 0x30], rcx
jne 0x140178300
test al, 2
jne 0x1401783a0
mov sil, 2
cmp byte [rbp - 0x40], 0
je 0x1401783ac
movzx ebx, byte [rbp - 0x3f]
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
movzx eax, byte [rax + 0xb8]
cmp eax, 1
je 0x140178378
test eax, eax
jne 0x1401783ac
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rdi, qword [rcx + rax*8]
lea rcx, [rdi + 0x68]
lea rdx, [0x140169e20]
call fcn.1401c5ea0
mov byte [rdi + 0xb8], 1
mov eax, dword [0x1402dd5d0]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
mov byte [rax + 0xb4], 1
mov byte [rax + 0xb5], bl
jmp 0x1401783ac
lock or qword [rdi + 0x30], 1
movzx esi, byte [rdi + 0x38]
mov byte [rdi + 0x38], 0
xor sil, 1
test sil, sil
je 0x1401783bf
movzx eax, sil
cmp eax, 2
je 0x1401783e7
mov sil, 1
jmp 0x1401783e7
mov rax, qword [r14]
test rax, rax
mov qword [rbp - 0x10], r14
je 0x1401783da
lock dec qword [rax]
jne 0x1401783da
mov rcx, qword [rbp - 0x10]
call fcn.14017b4c0
mov rax, qword [rbp - 0x10]
mov qword [rax], 0
xor esi, esi
mov eax, esi
add rsp, 0x60
pop rbx
pop rdi
pop rsi
pop r14
pop rbp
ret
lea rax, [0x140240a80]
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], 1
lea rax, [0x1402401b0]
mov qword [rbp - 0x30], rax
xorps xmm0, xmm0
movups xmmword [rbp - 0x28], xmm0
lea rdx, str._b_n__
lea rcx, [rbp - 0x40]
call fcn.1401ed8a0
int3