Function at 0x402180
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x416898
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x422008]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x44], ebx
test ebx, ebx
jne 0x4021bf
or eax, 0xffffffff
jmp 0x402430
push 0x12
xor eax, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
lea ecx, [ebp - 0x40]
push str.__detect_available
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
call fcn.00403a40
mov dword [ebp - 4], 0
mov ecx, ebx
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
lea edx, [ecx + 2]
mov word [ebp - 0x28], ax
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402220
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x28]
call fcn.00403a40
mov byte [ebp - 4], 1
cmp dword [ebp - 0x18], 0
mov esi, dword [ebp - 0x40]
mov ebx, dword [ebp - 0x28]
je 0x402383
cmp dword [ebp - 0x14], 8
lea ecx, [ebp - 0x28]
mov edx, str.__typedefault
cmovae ecx, ebx
call fcn.00406b20
test al, al
jne 0x402292
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x18], eax
jne 0x402383
cmp dword [ebp - 0x2c], 8
lea edx, [ebp - 0x40]
lea ecx, [ebp - 0x28]
cmovae edx, esi
cmp dword [ebp - 0x14], 8
cmovae ecx, ebx
call fcn.00406b20
test al, al
je 0x402383
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x18], eax
jne 0x4022c3
cmp dword [ebp - 0x2c], 8
lea edx, [ebp - 0x40]
lea ecx, [ebp - 0x28]
cmovae edx, esi
cmp dword [ebp - 0x14], 8
cmovae ecx, ebx
call fcn.00406b20
test al, al
je 0x4022c3
call fcn.004031b0
mov esi, eax
jmp 0x402386
push str.7A504455_92EF_4B25_8E3F_D8F56B6FCF22
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [edi + 8], eax
test eax, eax
je 0x402383
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x402304
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 8], 0
mov esi, 1
jmp 0x402386
push dword [ebp - 0x44]
lea ecx, [ebp - 0x5c]
call fcn.00403970
mov byte [ebp - 4], 2
push ecx
mov ecx, edi
call fcn.00402450
mov esi, eax
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x48]
cmp edx, 8
jb 0x40235d
mov ecx, dword [ebp - 0x5c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x402353
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x402353
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0041503a
add esp, 8
push dword [edi + 8]
xor eax, eax
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 7
mov word [ebp - 0x5c], ax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 8], 0
jmp 0x402386
or esi, 0xffffffff
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x4023c3
lea ecx, [eax*2 + 2]
mov eax, ebx
cmp ecx, 0x1000
jb 0x4023b9
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4023b9
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push ebx
call fcn.0041503a
add esp, 8
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x2c]
cmp eax, 8
jb 0x40241a
mov edx, dword [ebp - 0x40]
lea ecx, [eax*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x402410
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x402410
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.0041503a
add esp, 8
xor eax, eax
mov dword [ebp - 0x30], 0
mov word [ebp - 0x40], ax
mov eax, esi
mov dword [ebp - 0x2c], 7
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00414ff9
mov esp, ebp
pop ebp
ret 4