Function at 0x140005160
Capabilities:
Check mutex on windows

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x338]
sub rsp, 0x410
mov qword [rbp - 0x58], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x14006b9c0]
xor rax, rsp
mov qword [rbp + 0x300], rax
lea r8, str.ThpSvrInitialize
mov qword [rsp + 0x78], r8
lea r14, str.ThpsrvLib.cpp
mov qword [rbp - 0x80], r14
mov dword [rbp - 0x78], 0x621
lea r12, str.__ThpSvrInitialize_
mov qword [rbp - 0x70], r12
lea r15, [0x1400278f0]
mov qword [rbp - 0x68], r15
mov dword [rbp - 0x60], 3
lea rdx, str.ENTER__s
lea rcx, [rbp - 0x80]
call fcn.1400013f0
nop
xor esi, esi
mov dword [0x14006d588], esi
call fcn.140003650
and dword [0x14006d588], 0xffffffdf
call fcn.140004020
test eax, eax
je 0x14000524b
lea ecx, [rsi + 0x56]
call qword [sym.imp.USER32.dll_GetSystemMetrics]
test eax, eax
je 0x14000524b
call fcn.140003430
cmp rax, 0xffffffffffffffff
je 0x14000524b
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.1400041f0
test eax, eax
mov eax, dword [0x14006d588]
jne 0x14000523d
or eax, 0x3000
or eax, 0x20
mov dword [0x14006d588], eax
call fcn.140003c30
mov ebx, 1
test byte [0x14006d588], 0x20
je 0x140005277
lea rcx, [rsp + 0x68]
call fcn.1400042d0
test eax, eax
je 0x140005277
cmp dword [rsp + 0x68], 0x2051f351
mov dword [0x14006d590], ebx
je 0x14000527d
mov dword [0x14006d590], esi
call fcn.1400045b0
mov eax, dword [0x14006d588]
test bl, al
je 0x1400052b6
mov ecx, dword [0x14006d594]
dec ecx
je 0x1400052ae
dec ecx
je 0x1400052a6
dec ecx
jne 0x1400052b6
shr eax, 0xc
and eax, 3
jmp 0x1400052b8
shr eax, 0xa
and eax, 3
jmp 0x1400052b8
shr eax, 8
and eax, 3
jmp 0x1400052b8
mov eax, esi
mov dword [0x14006d598], eax
cmp dword [0x14006d590], esi
je 0x1400052d1
cmp eax, ebx
cmova eax, ebx
mov dword [0x14006d598], eax
call fcn.1400031e0
mov rbx, rax
mov ecx, esi
cmp rax, 0xffffffffffffffff
sete cl
test ecx, ecx
je 0x1400052f3
mov dword [rsp + 0x48], 0x646
jmp 0x140005610
mov edi, esi
xor r9d, r9d
xor r8d, r8d
mov edx, 0x222c80
mov rcx, rax
call fcn.140003380
mov qword [rsp + 0x40], r14
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r15
lea rcx, [rsp + 0x40]
test al, al
je 0x14000534f
mov r8d, dword [0x14006d59c]
inc r8d
mov dword [0x14006d59c], r8d
mov dword [rsp + 0x48], 0x64b
mov dword [rsp + 0x60], 3
lea rdx, str.Thpdrv_start_service_OK__g_ThpdrvStartServiceCount:__d
call fcn.1400013f0
jmp 0x140005367
mov dword [rsp + 0x48], 0x64f
mov dword [rsp + 0x60], esi
lea rdx, str.Thpdrv_start_service_ERROR
call fcn.1400013f0
call fcn.140004eb0
test eax, eax
jne 0x140005394
lea rcx, str.SYSTEMCurrentControlSetServicesmsahciController0
call fcn.140004d00
lea rcx, str.SYSTEMCurrentControlSetServices_storahciController0
call fcn.140004d00
lea rcx, str.SYSTEMCurrentControlSetServices_storahciParametersDevice
call fcn.140004d00
movzx eax, byte [0x14006d588]
and eax, 1
bts eax, 0x1f
mov dword [rsp + 0x6c], eax
cmp rbx, 0xffffffffffffffff
jne 0x140005441
mov dword [rbp - 0x50], 3
mov dword [rbp - 0x4c], 0x222c88
mov dword [rbp - 0x48], 4
mov dword [rbp - 0x40], eax
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
lea r9, [rbp + 0xf0]
lea rdx, [rbp - 0x50]
call fcn.140003000
test eax, eax
je 0x1400053f0
mov eax, dword [rbp + 0x100]
mov dword [rsp + 0x6c], eax
mov dword [rbp - 0x50], 3
mov dword [rbp - 0x4c], 0x222c88
mov dword [rbp - 0x48], 4
mov eax, dword [0x14006d598]
mov dword [rbp - 0x40], eax
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
lea r9, [rbp + 0xf0]
lea rdx, [rbp - 0x50]
call fcn.140003000
test eax, eax
je 0x140005533
mov eax, dword [rbp + 0x100]
mov dword [0x14006d598], eax
jmp 0x140005533
mov qword [rsp + 0x38], rsi
lea rax, [rsp + 0x70]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 4
lea rax, [rsp + 0x6c]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rsp + 0x6c]
mov edx, 0x222c88
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea r13, str.__ThpdrvDeviceIoControl_
test eax, eax
jne 0x1400054bf
mov qword [rsp + 0x40], r14
mov dword [rsp + 0x48], 0x17f
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x60], 3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.DeviceIoControl_error:__d
lea rcx, [rsp + 0x40]
call fcn.1400013f0
mov qword [rsp + 0x38], rsi
lea rax, [rsp + 0x70]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 4
lea r8, [0x14006d598]
mov qword [rsp + 0x20], r8
mov edx, 0x222c88
mov r9d, 4
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x140005533
mov qword [rsp + 0x40], r14
mov dword [rsp + 0x48], 0x17f
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x60], 3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.DeviceIoControl_error:__d
lea rcx, [rsp + 0x40]
call fcn.1400013f0
xor r8d, r8d
xor edx, edx
lea rcx, [0x140002eb0]
call qword [sym.imp.KERNEL32.dll_CreateThreadpoolWork]
test rax, rax
jne 0x14000557f
mov qword [rsp + 0x40], r14
mov dword [rsp + 0x48], 0x671
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x60], 3
lea rdx, str.Thp_CreateThreadpoolWork_failed
lea rcx, [rsp + 0x40]
call fcn.1400013f0
jmp 0x14000563c
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SubmitThreadpoolWork]
mov qword [rsp + 0x40], r14
mov dword [rsp + 0x48], 0x679
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x60], 3
lea rdx, str.Thp_RPC_service_poll_is_established.
lea rcx, [rsp + 0x40]
call fcn.1400013f0
lea r8, str.Global_thpsrv
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rcx, rax
mov qword [0x14006d5a0], rax
test rax, rax
je 0x1400055fc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [0x14006d5a0]
cmp eax, 0xb7
jne 0x1400055fc
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
mov qword [0x14006d5a0], rcx
mov eax, esi
test rcx, rcx
sete al
test eax, eax
je 0x14000563c
mov dword [rsp + 0x48], 0x67d
mov edi, 0x80004005
mov qword [rsp + 0x40], r14
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x60], esi
mov r8d, edi
lea rdx, str.Error_Code:_0x_x
lea rcx, [rsp + 0x40]
call fcn.1400013f0
lea rcx, [rbx - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x140005650
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov r8, qword [rsp + 0x78]
lea rdx, str.LEAVE__s
lea rcx, [rbp - 0x80]
call fcn.1400013f0
mov eax, edi
mov rcx, qword [rbp + 0x300]
xor rcx, rsp
call fcn.14000b090
lea r11, [rsp + 0x410]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret