Function at 0x4bfde0
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 [0x005149e0]
movzx eax, byte [rax]
test al, al
je 0x4bfe8e
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4bfe42
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4bfe42
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
cmp eax, 3
jle 0x4bfe8e
movzx ecx, byte [rbp + 0x240]
movzx edx, byte [rbp + 0x238]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], edx
mov r9, qword [rbp + 0x230]
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 0x4bfeb1
mov eax, 0
jmp 0x4c03f3
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 edx, byte [rbp + 0x240]
movzx eax, byte [rbp + 0x238]
mov r8d, edx
mov edx, eax
mov rcx, qword [rbp + 0x230]
call dbg.mksec
mov qword [rbp + 0x210], rax
cmp qword [rbp + 0x210], 0
jne 0x4bff1b
mov eax, 0
jmp 0x4c03f3
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 0x4bffec
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4bff7b
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4bff7b
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
js 0x4bffcc
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03f3
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 0x4c026f
cmp dword [rbp + 0x204], 0x102
je 0x4c01e6
cmp dword [rbp + 0x204], 0x102
ja 0x4c02f2
cmp dword [rbp + 0x204], 0
je 0x4c0050
cmp dword [rbp + 0x204], 0x80
jne 0x4c02f2
mov dword [rbp + 0x21c], 0
jmp 0x4c01cc
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 0x4c01c5
mov rax, qword [rbp + 0x1f8]
movzx eax, byte [rax + 0x49]
cmp byte [rbp + 0x240], al
jne 0x4c01c5
mov rax, qword [rbp + 0x1f8]
movzx eax, byte [rax + 0x50]
xor eax, 1
test al, al
je 0x4c01c5
mov rax, qword [rbp + 0x208]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReleaseMutex]
call rax
test eax, eax
je 0x4c0142
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c00fb
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c00fb
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
jle 0x4c03b8
lea rax, [rbp - 0x50]
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03b8
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c016f
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c016f
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
js 0x4c03bb
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03bb
add dword [rbp + 0x21c], 1
mov rax, qword [0x00514d30]
mov eax, dword [rax]
cmp dword [rbp + 0x21c], eax
jl 0x4c005f
jmp 0x4c036d
mov rax, qword [0x00514820]
movzx eax, byte [rax]
xor eax, 1
test al, al
je 0x4c03be
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c0228
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c0228
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
jle 0x4c03be
lea rax, [rbp - 0x50]
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03be
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c029c
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c029c
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
js 0x4c03c1
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03c1
mov rax, qword [0x00514e80]
movzx eax, byte [rax]
test al, al
jne 0x4c031f
mov rax, qword [0x00514ac0]
movzx eax, byte [rax]
test al, al
jne 0x4c031f
mov rax, qword [0x00514ab0]
mov eax, dword [rax]
test eax, eax
js 0x4c03c4
mov edx, dword [rbp + 0x204]
lea rax, [rbp - 0x50]
mov dword [rsp + 0x28], edx
lea rdx, [rbp + 0x1b0]
mov qword [rsp + 0x20], rdx
mov r9, qword [rbp + 0x230]
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 0x4c03c4
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 0x4c03f3
nop
jmp 0x4c03c5
nop
jmp 0x4c03c5
nop
jmp 0x4c03c5
nop
jmp 0x4c03c5
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