Function at 0x180005898
Capabilities:
Check mutex on windows

Disassembly:
mov rax, rsp
push rdi
push r12
push r14
sub rsp, 0x180
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rax, qword [0x180295a70]
xor rax, rsp
mov qword [rsp + 0x170], rax
mov rdi, rcx
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
and qword [rsp + 0x38], 0
xor edx, edx
lea rcx, [rsp + 0x38]
call fcn.180003368
cmp qword [rsp + 0x38], 0
jne 0x1800058fc
lea rcx, [rsp + 0x38]
call fcn.180003e24
nop
lea rcx, [rsp + 0x38]
call fcn.18000421c
mov rsi, rax
test rax, rax
je 0x180005919
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_lstrlenW]
jmp 0x18000591b
xor eax, eax
lea ebx, [rax + rax]
mov eax, dword [rdi + 0xc]
mov dword [rsp + 0x50], eax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
and dword [rsp + 0x30], 0
lea rdx, [rsp + 0x30]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
lea rcx, [rsp + 0xc0]
call fcn.18003a570
nop
mov r8d, ebx
mov rdx, rsi
lea rcx, [rsp + 0xc0]
call fcn.18003a5c0
mov r8d, 4
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0xc0]
call fcn.18003a5c0
mov r8d, 4
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0xc0]
call fcn.18003a5c0
lea rcx, [rsp + 0xc0]
call fcn.18003a640
lea rcx, [rsp + 0xc0]
call fcn.180039110
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.180005510
nop
lea rcx, [rsp + 0x70]
call fcn.180003dac
nop
lea rcx, [0x1802886b8]
mov rax, qword [0x1802886b8]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
add rax, 0x18
mov qword [rsp + 0x48], rax
mov r8, qword [rsp + 0x40]
lea rdx, str.LocalMTX__s
lea rcx, [rsp + 0x48]
call fcn.1800051e8
mov r11, qword [rsp + 0xa0]
neg r11
sbb rcx, rcx
lea rax, [rsp + 0x98]
and rcx, rax
mov r8, qword [rsp + 0x48]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rbp, rax
or r14, 0xffffffffffffffff
test rax, rax
je 0x180005b51
lea rcx, [0x1802886b8]
mov rdx, qword [0x1802886b8]
call qword [rdx + reloc.OLEAUT32.dll_SafeArrayGetElement]
add rax, 0x18
mov qword [rsp + 0x58], rax
mov r8, qword [rsp + 0x40]
lea rdx, str.Local_s
lea rcx, [rsp + 0x58]
call fcn.1800051e8
or edx, 0xffffffff
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rbx, qword [rsp + 0x58]
test eax, eax
je 0x180005a77
cmp eax, 0x80
jne 0x180005b2a
xor r12b, r12b
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x20]
mov esi, eax
mov rcx, qword [rsp + 0xa0]
neg rcx
sbb rdx, rdx
lea rax, [rsp + 0x98]
and rdx, rax
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], esi
xor r9d, r9d
lea r8d, [r9 + 4]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov qword [rdi + 0x18], rax
test rax, rax
je 0x180005ad2
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x180005ae6
mov r12b, 1
jmp 0x180005ae6
mov r8, rbx
xor edx, edx
mov ecx, 0xf001f
call qword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov qword [rdi + 0x18], rax
mov rcx, qword [rdi + 0x18]
test rcx, rcx
je 0x180005b09
mov qword [rsp + 0x20], rsi
xor r9d, r9d
xor r8d, r8d
mov edx, 0xf001f
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov qword [rdi + 0x20], rax
cmp qword [rdi + 0x20], 0
je 0x180005b21
mov dword [rdi + 0x28], esi
test r12b, r12b
je 0x180005b21
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetElement]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
lea rdx, [rbx - 0x18]
mov eax, r14d
lock xadd dword [rdx + 0x10], eax
add eax, r14d
test eax, eax
jg 0x180005b51
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, r14d
lock xadd dword [rdx + 0x10], eax
add eax, r14d
test eax, eax
jg 0x180005b73
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rcx, qword [rsp + 0xb0]
test rcx, rcx
je 0x180005b8f
call qword [sym.imp.KERNEL32.dll_LocalFree]
and qword [rsp + 0xb0], 0
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
mov eax, r14d
lock xadd dword [rdx + 0x10], eax
add eax, r14d
test eax, eax
jg 0x180005bb1
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
lea rcx, [rsp + 0xc0]
call fcn.180039090
nop
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x180005bcf
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x170]
xor rcx, rsp
call fcn.1801604e0
lea r11, [rsp + 0x180]
mov rbx, qword [r11 + 0x28]
mov rbp, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop r12
pop rdi
ret