Function at 0x180004800
Capabilities:
Create thread

Disassembly:
push rbx
push rsi
push rdi
push r14
push r15
sub rsp, 0x30
mov rsi, qword [rcx + 0xbc]
mov rdi, rcx
xor r15d, r15d
add rcx, 0x43
mov word [rsp + 0x60], r15w
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
movzx eax, byte [rdi + 0x3a]
test al, 0x20
je 0x180004835
mov bl, 1
jmp 0x18000483c
xor bl, bl
or al, 0x20
mov byte [rdi + 0x3a], al
lea rcx, [rdi + 0x43]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test bl, bl
jne 0x180004a9a
lea rcx, [0x1800df3e0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
inc dword [0x1800df338]
lea rcx, [0x1800df3e0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [rdi + 0x2a], r15d
je 0x180004890
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [rdi + 0x2a], r15d
jne 0x180004874
nop word [rax + rax]
mov rax, rdi
cmp qword [rdi + 0xc4], r15
je 0x1800048ba
nop dword [rax]
mov rax, qword [rax + 0xc4]
test byte [rax + 0x3a], 0x20
je 0x180004aa8
cmp qword [rax + 0xc4], r15
jne 0x1800048a0
mov qword [rsp + 0x70], rbp
test rsi, rsi
je 0x180004981
cmp byte [rsi + 0xbb], r15b
je 0x18000495a
mov rcx, qword [rsi + 0x6b]
lea r9, [rsp + 0x68]
mov r8d, 2
mov qword [rsp + 0x68], 0x10
lea rdx, [rsp + 0x60]
call fcn.180007600
lea rcx, [rsi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor bpl, bpl
test byte [rsi + 0x3a], 0x40
jne 0x180004929
lea rcx, [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov rax, qword [rsp + 0x68]
mov bpl, 1
or byte [rsi + 0x3a], 0x40
mov qword [rsi + 0x32], rax
mov dword [rsi + 0x2e], r15d
lea rcx, [rsi + 0x43]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test bpl, bpl
je 0x18000495a
mov rcx, qword [rsi + 0x6b]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
lea rcx, [rsi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
and byte [rsi + 0x3a], 0xbf
lea rcx, [rsi + 0x43]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [rsi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rcx, [rsi + 0x43]
mov word [rsi + 0x10], r15w
mov qword [rsi + 0xc4], r15
mov qword [rsi + 0xcc], rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [rdi + 0xbb], r15b
je 0x180004a2a
lea rcx, [rdi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbp, qword [rdi + 0x6b]
lea rcx, [rdi + 0x43]
mov qword [rdi + 0x6b], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp rbp, 0xffffffffffffffff
je 0x180004a2a
mov ebx, r15d
mov rcx, rbp
call fcn.180026018
mov esi, eax
test eax, eax
je 0x1800049d0
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
inc ebx
cmp esi, 0xc0000121
jne 0x1800049df
cmp ebx, 0xa
jl 0x1800049b7
lea rcx, [rdi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rcx, [rdi + 0x43]
mov qword [rdi + 0x6b], rbp
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [rdi + 0x43]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [rdi + 0x6b]
lea rcx, [rdi + 0x43]
mov qword [rdi + 0x6b], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x180004a2a
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbp, qword [rsp + 0x70]
cmp dword [rdi + 0x2a], r15d
je 0x180004a46
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [rdi + 0x2a], r15d
jne 0x180004a35
lea rcx, [0x1800df3e0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
dec dword [0x1800df338]
lea rcx, [0x1800df3e0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, 0x10
call fcn.180053730
test rax, rax
je 0x180004a9a
mov qword [rsp + 0x28], r15
lea r8, [0x180007200]
mov r9, rax
mov dword [rsp + 0x20], r15d
xor edx, edx
mov qword [rax], rdi
xor ecx, ecx
mov dword [rax + 8], r15d
call qword [sym.imp.KERNEL32.dll_CreateThread]
xor eax, eax
add rsp, 0x30
pop r15
pop r14
pop rdi
pop rsi
pop rbx
ret
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x180004890