Function at 0x405850
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x544e70
mov eax, dword fs:[0]
push eax
sub esp, 8
push ebx
push esi
push edi
mov eax, dword [0x5ec938]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
mov dword [ebp - 4], 1
mov dword [ebp - 0x10], 0
je 0x405a4f
cmp dword [ebp + 0x10], 0
je 0x405a4f
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x14], esp
mov edi, esp
push eax
call fcn.004023a0
add eax, 0x10
add esp, 4
mov ecx, esi
mov dword [edi], eax
call fcn.004055a0
mov ebx, eax
test ebx, ebx
je 0x405a4c
cmp dword [ebx + 8], 0
jle 0x405a4c
mov edi, dword [sym.imp.KERNEL32.dll_CreateMutexW]
push str.Inst_FileName_Mutex
push 0
push 0
call edi
push str.Inst_Progress_Mutex
push 0
push 0
mov dword [esi], eax
call edi
push str.Inst_Log_Mutex
push 0
push 0
mov dword [esi + 4], eax
call edi
cmp dword [esi], 0
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [esi + 8], eax
je 0x40599c
cmp dword [esi + 4], 0
je 0x405982
test eax, eax
je 0x405982
push 0x420
lea eax, [esi + 0xc]
push 0
push eax
call fcn.0052c850
mov ecx, dword [ebp + 0x10]
mov edx, dword [esi]
mov eax, dword [esi + 4]
mov dword [esi + 0x41c], ecx
mov ecx, dword [esi + 8]
mov dword [esi + 0x420], ecx
add esp, 0xc
lea ecx, [ebp + 0xc]
mov dword [esi + 0x424], edx
mov dword [esi + 0x428], eax
call fcn.004047e0
push eax
lea edx, [esi + 0x214]
push 0x104
push edx
call fcn.0052cd4a
add esp, 0xc
push ebx
mov ecx, esi
call fcn.004054c0
test eax, eax
je 0x405982
mov ecx, esi
call fcn.00405480
mov dword [ebp - 0x10], eax
mov eax, dword [esi]
test eax, eax
je 0x40599c
push 0xffffffffffffffff
push eax
call edi
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], 0
mov eax, dword [esi + 4]
test eax, eax
je 0x4059b9
push 0xffffffffffffffff
push eax
call edi
mov ecx, dword [esi + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], 0
mov eax, dword [esi + 8]
test eax, eax
je 0x4059d6
push 0xffffffffffffffff
push eax
call edi
mov edx, dword [esi + 8]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
push 0xffffffffffffffff
push 0
mov ecx, ebx
call fcn.00439eb3
mov eax, dword [ebx]
mov edx, dword [eax + 4]
push 1
mov ecx, ebx
call edx
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405a0f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405a35
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov byte [ebp - 4], 0
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405a6f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 4], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405a91
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc