Function at 0x100016818
Capabilities:
Check for time delay via gettickcount
Generate random numbers via rtlgenrandom

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
push r13
push r14
sub rsp, 0x150
mov rax, qword [0x10001c110]
xor rax, rsp
mov qword [rsp + 0x140], rax
mov r12, qword [rsp + 0x198]
mov r13, qword [rsp + 0x1a0]
xor r14d, r14d
lea rcx, [rsp + 0x42]
xor edx, edx
mov r8d, 0xfc
lea rbx, [0x100004460]
mov rdi, r14
mov word [rsp + 0x40], r14w
call sub.msvcrt.dll_memset
lea r9, [0x1000049e0]
cmp rbx, r14
lea r8, [0x1000049c8]
lea edx, [r14 + 0x7f]
lea rcx, [rsp + 0x40]
cmovne r9, rbx
call fcn.10000c2ac
cmp eax, r14d
mov ebx, eax
jge 0x1000168e0
mov rcx, qword [0x10001c770]
lea rsi, [0x10001c770]
cmp rcx, rsi
je 0x100016ad3
test byte [rcx + 0x3c], 1
je 0x100016ad3
cmp byte [rcx + 0x39], 1
jb 0x100016ad3
lea edx, [r14 + 0x20]
mov r9d, eax
jmp 0x100016ac3
mov ebp, r14d
lea rsi, [0x10001c770]
lea rcx, [rsp + 0x30]
mov edx, 8
mov qword [rsp + 0x30], r14
call sub.ADVAPI32.dll_SystemFunction036
cmp al, r14b
jne 0x100016936
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, 1
cmp ebx, r14d
cmovne ecx, ebx
xor edx, edx
div ecx
mov ebx, edx
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r11d, eax
imul r11, rbx
mov qword [rsp + 0x30], r11
jmp 0x10001693b
mov r11, qword [rsp + 0x30]
mov edx, 0x7fffffff
lea rax, [rsp + 0x40]
mov ebx, r14d
mov rcx, rdx
cmp word [rax], r14w
je 0x10001695b
add rax, 2
sub rcx, 1
jne 0x10001694b
cmp rcx, r14
jne 0x10001696a
mov ebx, 0x80070057
mov rax, r14
jmp 0x100016970
mov rax, rdx
sub rax, rcx
cmp ebx, r14d
jl 0x100016aa3
add rax, 0x10
mov ecx, 0x100
cmp rax, rcx
jb 0x10001698e
mov ebx, 0x80070057
jmp 0x1000169ac
mov rdx, rcx
lea r9, [rsp + 0x40]
lea r8, [0x1000049b0]
mov rcx, r12
mov qword [rsp + 0x20], r11
call fcn.10000c2ac
mov ebx, eax
cmp ebx, r14d
jl 0x100016aa3
call sub.KERNEL32.dll_GetLastError
cmp eax, 0xb7
jne 0x1000169c9
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov r9, r12
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rdi, rax
cmp rax, r14
jne 0x100016a31
call sub.KERNEL32.dll_GetLastError
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
cmp eax, 5
je 0x1000169ff
cmp eax, 6
jne 0x100016a71
mov rcx, qword [0x10001c770]
cmp rcx, rsi
je 0x100016a58
test byte [rcx + 0x3c], 1
je 0x100016a58
cmp byte [rcx + 0x39], 2
jb 0x100016a58
mov rcx, qword [rcx + 0x30]
lea r8, [0x100001e70]
mov edx, 0x22
mov r9d, eax
call fcn.100005080
jmp 0x100016a58
call sub.KERNEL32.dll_GetLastError
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
cmp eax, 0xb7
jne 0x100016a63
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, r14
inc ebp
cmp ebp, 0x64
jb 0x1000168ea
cmp ebx, r14d
jl 0x100016ad8
mov qword [r13], rdi
mov rdi, r14
jmp 0x100016ad3
mov rcx, qword [0x10001c770]
cmp rcx, rsi
je 0x100016ad3
test byte [rcx + 0x3c], 1
je 0x100016ad3
cmp byte [rcx + 0x39], 1
jb 0x100016ad3
mov rcx, qword [rcx + 0x30]
lea r8, [0x100001e70]
mov edx, 0x23
mov r9d, eax
call fcn.100005080
jmp 0x100016ad3
mov rcx, qword [0x10001c770]
cmp rcx, rsi
je 0x100016ad3
test byte [rcx + 0x3c], 1
je 0x100016ad3
cmp byte [rcx + 0x39], 1
jb 0x100016ad3
mov edx, 0x21
mov r9d, ebx
mov rcx, qword [rcx + 0x30]
lea r8, [0x100001e70]
call fcn.100005080
cmp ebx, r14d
jge 0x100016aeb
mov word [r12], r14w
cmp rdi, r14
je 0x100016aeb
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov rcx, qword [rsp + 0x140]
xor rcx, rsp
call fcn.100017af0
lea r11, [rsp + 0x150]
mov rbx, qword [r11 + 0x20]
mov rbp, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop r13
pop r12
ret