Function at 0x18004b3bc
Capabilities:
Check mutex on windows
Create thread

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r14
sub rsp, 0x30
xor edi, edi
mov rbp, rcx
mov ebx, edi
test rcx, rcx
jne 0x18004b3fb
lea ebx, [rcx + 0x57]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, qword [rsp + 0x58]
mov rax, rdi
mov rbp, qword [rsp + 0x60]
add rsp, 0x30
pop r14
pop rdi
pop rsi
ret
cmp qword [0x180097450], rdi
jne 0x18004b42a
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x180097450], rax
test rax, rax
jne 0x18004b42a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp qword [0x180097458], rdi
jne 0x18004b459
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
lea edx, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x180097458], rax
test rax, rax
jne 0x18004b459
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp qword [0x180097448], rdi
jne 0x18004b49d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rcx, rax
test rax, rax
jne 0x18004b481
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x18004b49d
xor eax, eax
lock cmpxchg qword [0x180097448], rcx
je 0x18004b496
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x18004b49d
mov qword [0x180097448], rcx
test ebx, ebx
jne 0x18004b3dd
mov rcx, qword [0x180097440]
test rcx, rcx
je 0x18004b4e9
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, eax
test eax, eax
jne 0x18004b4d7
mov rcx, qword [0x180097440]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x180097440], rdi
mov ebx, edi
jmp 0x18004b4e9
cmp ebx, 0x102
cmove ebx, edi
cmp qword [0x180097440], rdi
jne 0x18004b51a
mov qword [rsp + 0x28], rdi
lea r8, [0x18004aa10]
xor r9d, r9d
mov dword [rsp + 0x20], edi
xor edx, edx
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_CreateThread]
mov qword [0x180097440], rax
test rax, rax
jne 0x18004b51a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jne 0x18004b3dd
cmp qword [rbp + 8], rdi
lea rdx, [0x180070708]
mov r8, rdx
cmovne r8, qword [rbp + 8]
or rax, 0xffffffffffffffff
mov rcx, rax
inc rcx
cmp word [r8 + rcx*2], di
jne 0x18004b53c
cmp qword [rbp + 0x10], rdi
lea ebx, [rcx*2 + 2]
cmovne rdx, qword [rbp + 0x10]
inc rax
cmp word [rdx + rax*2], di
jne 0x18004b556
lea r14d, [rax*2 + 2]
mov eax, 0xfffffff8
lea ecx, [rbx + 0x2f]
add ecx, r14d
and rcx, rax
call fcn.18000618c
mov rsi, rax
test rax, rax
jne 0x18004b58a
lea ebx, [rax + 0xe]
jmp 0x18004b3dd
lea rcx, [rax + 0x28]
mov rdx, rbx
mov qword [rax + 8], rcx
mov r8, qword [rbp + 8]
call fcn.18000e0f0
mov rcx, qword [rsi + 8]
add rcx, rbx
mov edx, r14d
mov qword [rsi + 0x10], rcx
mov r8, qword [rbp + 0x10]
call fcn.18000e0f0
mov eax, 0x51eb851f
mul dword [rbp + 0x18]
shr edx, 6
mov dword [rsi + 0x18], edx
test edx, edx
jne 0x18004b5ce
mov dword [rsi + 0x18], 1
mov eax, dword [rbp + 0x1c]
mov dword [rsi + 0x1c], eax
mov rax, qword [rbp + 0x20]
mov qword [rsi + 0x20], rax
mov rcx, qword [0x180097448]
test rcx, rcx
je 0x18004b607
lea r8, [rsp + 0x50]
mov qword [rsp + 0x50], 0xffffffffffc2f700
xor edx, edx
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov ecx, eax
call fcn.18000dc0c
jmp 0x18004b60c
mov eax, 0x15
test eax, eax
jne 0x18004b678
mov rcx, qword [0x180093040]
test byte [rcx + 0x1c], 0x40
je 0x18004b640
cmp byte [rcx + 0x19], 4
jb 0x18004b640
mov rcx, qword [rcx + 0x10]
lea edx, [rax + 0x16]
mov eax, dword [rsi + 0x18]
lea r8, [0x18007d3b0]
mov r9, rsi
mov dword [rsp + 0x20], eax
call fcn.180047340
mov rax, qword [0x180097438]
mov qword [rsi], rax
mov rcx, qword [0x180097448]
mov qword [0x180097438], rsi
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp qword [rsi], rdi
jne 0x18004b670
mov rcx, qword [0x180097450]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdi, rsi
jmp 0x18004b3e5
mov ecx, eax
jmp 0x18004b3df