Function at 0x180001920
Capabilities:
Create thread
Encode data using xor

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x30
mov rax, qword [0x180004178]
xor r15d, r15d
cmp byte [0x180004184], r15b
mov ebp, r15d
mov qword [0x180004190], rax
mov ebx, r15d
mov eax, dword [0x180004180]
mov dword [0x180004208], eax
jne 0x180001c50
lea r13, [0x180004198]
mov dword [rsp + 0x60], r15d
test rbx, rbx
jne 0x180001a18
lea rcx, [0x180004290]
call fcn.1800015a8
mov rbx, rax
test rax, rax
jne 0x180001a13
mov r9d, dword [0x180004278]
cmp r9d, 0xa
jge 0x1800019a7
mov dword [rsp + 0x60], r9d
jmp 0x1800019e8
imul ecx, r9d, 0x78
mov eax, 0x51eb851f
imul ecx
lea ecx, [r9 + r9*4]
shl ecx, 4
mov r8d, edx
sar r8d, 5
mov eax, r8d
shr eax, 0x1f
add r8d, eax
mov eax, 0x51eb851f
imul ecx
mov ecx, edx
mov edx, r8d
sar ecx, 5
mov eax, ecx
shr eax, 0x1f
add ecx, eax
call fcn.180002e94
mov dword [rsp + 0x60], eax
xor edx, edx
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x60]
xor r8d, r8d
lea ecx, [rdx + 6]
call fcn.1800021ac
lea rcx, [0x180004290]
call fcn.1800015a8
mov rbx, rax
jmp 0x180001a18
mov dword [rsp + 0x60], r15d
cmp dword [0x18000427c], r15d
mov esi, r15d
jle 0x180001c12
mov rax, qword [0x180004190]
mov edi, r15d
mov r11, qword [rbx + 8]
mov r9d, r15d
mov r10, r15
mov rcx, qword [rax]
movsx r8, byte [rcx]
test r8, r8
jle 0x180001a9c
mov rax, qword [0x180004190]
lea r14, [0x180004240]
movsxd rdx, r9d
mov rcx, qword [rax]
mov al, byte [rdx + r14]
xor al, byte [rcx + r10 + 1]
mov byte [r10 + r13], al
lea eax, [r9 + 1]
movsxd r9, eax
inc r10
movabs rax, 0x842108421084211
mul r9
mov rax, r9
sub rax, rdx
shr rax, 1
add rax, rdx
shr rax, 4
imul rax, rax, 0x1f
sub r9, rax
cmp r10, r8
jl 0x180001a48
mov rdx, qword [0x180004190]
mov edx, dword [rdx + 0xc]
cmp edx, 1
jne 0x180001ab5
mov rcx, r11
call fcn.180002970
mov edi, eax
xor edx, edx
mov rcx, r13
lea r8d, [rdx + 0x40]
call fcn.180002f58
test edi, edi
jne 0x180001b01
lea eax, [rbp + 1]
mov dword [rsp + 0x60], r15d
cdq
inc esi
idiv dword [0x18000427c]
movsxd rbp, edx
mov rax, rbp
shl rax, 4
add rax, qword [0x180004178]
cmp esi, dword [0x18000427c]
mov qword [0x180004190], rax
jl 0x180001a28
jmp 0x180001c43
mov rdx, rbx
lea rcx, [0x180004210]
call fcn.180001604
mov rbx, r15
cmp edi, 2
jne 0x180001c03
mov ecx, dword [0x1800041f8]
call fcn.180002150
movsxd r8, dword [0x1800041f8]
mov rdi, rax
mov rdx, qword [0x1800041f0]
mov rcx, qword [rax + 8]
call fcn.180002ecc
mov ecx, dword [0x1800041f8]
lea r8, [0x1800041dc]
mov dword [rdi + 0x10], ecx
mov edx, dword [0x1800041f8]
mov rcx, qword [rdi + 8]
mov r9d, dword [0x1800041d8]
call fcn.180002104
mov edx, dword [rdi + 0x10]
lea r8, [0x1800040c0]
mov rcx, qword [rdi + 8]
mov r9d, 0x1f
call fcn.180002104
mov r8, qword [rdi + 8]
movzx ecx, byte [r8]
test ecx, ecx
je 0x180001bf2
sub ecx, 2
je 0x180001bcb
sub ecx, 1
je 0x180001bb4
cmp ecx, 1
jne 0x180001bf2
mov eax, dword [r8 + 1]
mov rcx, qword [0x180004170]
mov dword [0x180004278], eax
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x180001bf2
mov rcx, qword [0x1800042c8]
xor r9d, r9d
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
jmp 0x180001c12
mov qword [rsp + 0x28], r15
lea r8, [0x180001c68]
xor r9d, r9d
mov dword [rsp + 0x20], r15d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, rdi
lea rcx, [0x180004210]
call fcn.180001604
jmp 0x180001c12
mov eax, dword [rsp + 0x60]
cmp edi, 1
cmove eax, r15d
mov dword [rsp + 0x60], eax
mov eax, dword [rsp + 0x60]
test eax, eax
je 0x180001c43
cmp qword [0x180004290], r15
jne 0x180001c43
mov rcx, qword [0x180004170]
imul edx, eax, 0x3e8
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [0x180004170]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
cmp byte [0x180004184], r15b
je 0x18000196d
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
add rsp, 0x30
pop r15
pop r14
pop r13
pop rdi
pop rsi
ret