Function at 0x180005da0
Capabilities:
Check mutex on windows

Disassembly:
push rsi
push r12
sub rsp, 0x58
movzx eax, byte [0x180034b74]
mov r12, rdx
mov rsi, rcx
test al, al
je 0x180005dfb
call fcn.180003490
mov r9, qword [0x180035148]
mov r8, rax
sub r8, r9
movabs rcx, 0x12a05f200
cmp r8, rcx
mov rcx, qword [0x180034a48]
cmova r9, rax
xor edx, edx
mov qword [0x180035148], r9
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x180005dfb
call fcn.180006100
movzx eax, byte [0x180034b74]
test al, al
jne 0x180005e38
mov rcx, qword [0x180034a40]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x180005e38
mov rax, qword [0x180034a38]
inc rax
test rax, 0xfffffffffffffffe
jne 0x180005e30
call fcn.180002650
mov rcx, rsi
call fcn.180006190
movzx eax, byte [0x180034b74]
test al, al
je 0x1800060f8
mov rax, qword [0x180034a30]
mov qword [rsp + 0x70], rbx
mov rbx, qword [rax + 0x38]
test rbx, rbx
je 0x180005e8b
call fcn.180003490
mov r8, qword [0x180035140]
mov rdx, rax
sub rdx, r8
cmp rdx, rbx
jb 0x1800060f3
lea rcx, [rbx + rbx]
cmp rdx, rcx
ja 0x180005e84
lea rax, [r8 + rbx]
mov qword [0x180035140], rax
mov qword [rsp + 0x50], rdi
lea r8, str.ISR_C5333BDF_7B2B_41A7_8AC5_A85E8D58D42F_GAME64
mov qword [rsp + 0x48], r14
xor ecx, ecx
mov r14d, 1
xor bl, bl
mov edx, r14d
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
movzx ebx, bl
cmove ebx, r14d
test rdi, rdi
je 0x180005ed2
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test bl, bl
je 0x1800060e9
mov qword [rsp + 0x78], rbp
mov qword [rsp + 0x40], r15
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor ecx, ecx
mov ebp, eax
call qword [sym.imp.USER32.dll_GetSystemMetrics]
mov ecx, r14d
mov ebx, eax
call qword [sym.imp.USER32.dll_GetSystemMetrics]
xor r8d, r8d
xor edx, edx
mov ecx, ebp
mov r15d, eax
call fcn.1800065c0
xor edi, edi
mov ecx, ebp
test al, al
cmovne edi, r14d
lea r14d, [rbx - 1]
mov edx, r14d
xor r8d, r8d
call fcn.1800065c0
test al, al
je 0x180005f2d
inc edi
lea ebx, [r15 - 1]
xor edx, edx
mov r8d, ebx
mov ecx, ebp
call fcn.1800065c0
mov r15, qword [rsp + 0x40]
test al, al
je 0x180005f48
inc edi
mov r8d, ebx
mov edx, r14d
mov ecx, ebp
call fcn.1800065c0
mov rbp, qword [rsp + 0x78]
test al, al
je 0x180005f60
inc edi
cmp edi, 3
jb 0x1800060e9
mov ebx, dword [0x180035240]
lea rdi, [0x1800351f0]
inc ebx
mov eax, 0x55555556
imul ebx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
sub ebx, eax
movsxd rcx, ebx
cmp byte [rcx + rdi + 0x48], 0
je 0x180005fb3
mov byte [rcx + rdi + 0x48], 0
xor r8d, r8d
mov byte [rcx + rdi + 0x4b], 1
mov r9d, dword [0x180035204]
mov rdx, qword [rdi + rcx*8 + 0x30]
call fcn.180003540
mov eax, dword [0x180035244]
cmp eax, 2
jge 0x180005fcb
inc eax
mov dword [0x180035244], eax
jmp 0x1800060e3
mov rax, qword [rsi]
lea rcx, [rsp + 0x80]
mov r9d, dword [0x180035200]
mov r8d, dword [0x1800351fc]
mov edx, dword [0x1800351f8]
mov qword [rsp + 0x20], rcx
mov rcx, rsi
call qword [rax + 0xd8]
test eax, eax
jns 0x18000600f
mov edx, eax
lea rcx, str.d3d8_shmem_init_buffer:_Failed_to_create_surface
call fcn.180002480
jmp 0x1800060e9
mov ecx, dword [0x180035240]
call fcn.1800035c0
test al, al
je 0x180006035
movsxd rax, dword [0x180035240]
mov byte [rax + rdi + 0x4b], 0
mov ecx, dword [0x180035240]
call fcn.180003640
mov rax, qword [rsi]
xor r9d, r9d
mov qword [rsp + 0x28], 0
xor r8d, r8d
mov rdx, r12
mov rcx, rsi
mov r10, qword [rax + 0xe0]
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x20], rax
call r10
test eax, eax
jns 0x180006076
mov edx, eax
lea rcx, str.d3d8_shmem_capture:_CopyRects_failed
call fcn.180002480
mov rcx, qword [rsp + 0x80]
lea rdx, [rsp + 0x30]
mov r9d, 0x10
xor r8d, r8d
mov rax, qword [rcx]
call qword [rax + 0x48]
test eax, eax
js 0x1800060c9
mov r8d, dword [0x180035218]
movsxd rcx, dword [0x180035240]
imul r8d, dword [0x1800351fc]
mov rdx, qword [rsp + 0x38]
mov rcx, qword [rdi + rcx*8 + 0x30]
call fcn.18000ea30
mov rcx, qword [rsp + 0x80]
mov rax, qword [rcx]
call qword [rax + 0x50]
mov rcx, qword [rsp + 0x80]
mov rax, qword [rcx]
call qword [rax + 0x10]
movsxd rax, dword [0x180035240]
mov byte [rax + rdi + 0x48], 1
mov dword [0x180035240], ebx
mov rdi, qword [rsp + 0x50]
mov r14, qword [rsp + 0x48]
mov rbx, qword [rsp + 0x70]
add rsp, 0x58
pop r12
pop rsi
ret