Function at 0x1400c6d40
Capabilities:
Check mutex on windows

Disassembly:
push rbp
sub rsp, 0x2a0
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x230], rcx
mov eax, edx
mov edx, r8d
mov byte [rbp + 0x238], al
mov eax, edx
mov byte [rbp + 0x240], al
mov rax, qword [0x14011bd40]
movzx eax, byte [rax]
test al, al
je 0x1400c6df1
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c6da2
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c6da2
mov rax, qword [0x14011be10]
mov eax, dword [rax]
cmp eax, 3
jle 0x1400c6df1
movzx ecx, byte [rbp + 0x240]
movzx edx, byte [rbp + 0x238]
mov r8, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], edx
mov r9, r8
lea r8, str.USB_res_lock__s__d__d
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 4
call dbg._applog
movzx edx, byte [rbp + 0x240]
movzx eax, byte [rbp + 0x238]
mov ecx, eax
call dbg.is_in_use_bd
test al, al
je 0x1400c6e14
mov eax, 0
jmp 0x1400c7369
movzx edx, byte [rbp + 0x240]
movzx ecx, byte [rbp + 0x238]
lea rax, [rbp + 0x1b0]
mov dword [rsp + 0x20], edx
mov r9d, ecx
lea r8, str.cg_usb__d__d
mov edx, 0x40
mov rcx, rax
call sym.snprintf_4
movzx ecx, byte [rbp + 0x240]
movzx edx, byte [rbp + 0x238]
mov rax, qword [rbp + 0x230]
mov r8d, ecx
mov rcx, rax
call dbg.mksec
mov qword [rbp + 0x210], rax
cmp qword [rbp + 0x210], 0
jne 0x1400c6e7f
mov eax, 0
jmp 0x1400c7369
lea rdx, [rbp + 0x1b0]
mov rax, qword [rbp + 0x210]
mov r8, rdx
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateMutexA]
call rax
mov qword [rbp + 0x208], rax
cmp qword [rbp + 0x208], 0
jne 0x1400c6f53
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c6edf
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c6edf
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
js 0x1400c6f33
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_failed_to_get__s_err___d_
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 0
call dbg._applog
mov rax, qword [rbp + 0x210]
mov rcx, rax
call dbg.unsec
mov qword [rbp + 0x210], rax
mov eax, 0
jmp 0x1400c7369
mov rax, qword [rbp + 0x208]
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call rax
mov dword [rbp + 0x204], eax
cmp dword [rbp + 0x204], 0xffffffff
je 0x1400c71df
cmp dword [rbp + 0x204], 0x102
je 0x1400c7153
cmp dword [rbp + 0x204], 0x102
ja 0x1400c7265
cmp dword [rbp + 0x204], 0
je 0x1400c6fb7
cmp dword [rbp + 0x204], 0x80
jne 0x1400c7265
mov dword [rbp + 0x21c], 0
jmp 0x1400c7139
mov eax, dword [rbp + 0x21c]
mov ecx, eax
call dbg.get_devices
mov qword [rbp + 0x1f8], rax
mov rax, qword [rbp + 0x1f8]
movzx eax, byte [rax + 0x48]
cmp byte [rbp + 0x238], al
jne 0x1400c7132
mov rax, qword [rbp + 0x1f8]
movzx eax, byte [rax + 0x49]
cmp byte [rbp + 0x240], al
jne 0x1400c7132
mov rax, qword [rbp + 0x1f8]
movzx eax, byte [rax + 0x50]
xor eax, 1
test al, al
je 0x1400c7132
mov rax, qword [rbp + 0x208]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReleaseMutex]
call rax
test eax, eax
je 0x1400c70ac
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c7062
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c7062
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
jle 0x1400c732e
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_cant_get__s___device_in_use
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 1
call dbg._applog
jmp 0x1400c732e
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c70d9
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c70d9
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
js 0x1400c7331
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_cant_get__s___device_in_use___failure___d_
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 0
call dbg._applog
jmp 0x1400c7331
add dword [rbp + 0x21c], 1
mov rax, qword [0x14011c090]
mov eax, dword [rax]
cmp dword [rbp + 0x21c], eax
jl 0x1400c6fc6
jmp 0x1400c72e3
mov rax, qword [0x14011bbd0]
movzx eax, byte [rax]
xor eax, 1
test al, al
je 0x1400c7334
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c7195
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c7195
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
jle 0x1400c7334
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_failed_to_get__s___device_in_use
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 1
call dbg._applog
jmp 0x1400c7334
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c720c
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c720c
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
js 0x1400c7337
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_failed_to_get__s_err___d_
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 0
call dbg._applog
jmp 0x1400c7337
mov rax, qword [0x14011c1e0]
movzx eax, byte [rax]
test al, al
jne 0x1400c7292
mov rax, qword [0x14011be20]
movzx eax, byte [rax]
test al, al
jne 0x1400c7292
mov rax, qword [0x14011be10]
mov eax, dword [rax]
test eax, eax
js 0x1400c733a
mov edx, dword [rbp + 0x204]
mov rcx, qword [rbp + 0x230]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, rcx
lea r8, str.MTX:__s_USB_failed_to_get__s_unknown_reply___d_
mov edx, 0x200
mov rcx, rax
call sym.snprintf_4
lea rax, [rbp - 0x50]
mov r8d, 0
mov rdx, rax
mov ecx, 0
call dbg._applog
jmp 0x1400c733a
movzx edx, byte [rbp + 0x240]
movzx eax, byte [rbp + 0x238]
mov r8d, 0
mov ecx, eax
call dbg.add_in_use
movzx edx, byte [rbp + 0x240]
movzx eax, byte [rbp + 0x238]
mov r8, qword [rbp + 0x210]
mov rcx, qword [rbp + 0x208]
mov r9, r8
mov r8, rcx
mov ecx, eax
call dbg.in_use_store_ress
mov eax, 1
jmp 0x1400c7369
nop
jmp 0x1400c733b
nop
jmp 0x1400c733b
nop
jmp 0x1400c733b
nop
jmp 0x1400c733b
nop
mov rax, qword [rbp + 0x208]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov rax, qword [rbp + 0x210]
mov rcx, rax
call dbg.unsec
mov qword [rbp + 0x210], rax
mov eax, 0
add rsp, 0x2a0
pop rbp
ret