Function at 0x401291
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x427a19
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x158
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor esi, esi
lea eax, [esp + 0x38]
inc esi
push esi
xor ebx, ebx
push eax
mov dword [edi], vtable.replay::real_mutex.0
mov dword [esp + 0x34], 0xc
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x38], eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
push ebx
push ebx
push esi
push dword [esp + 0x3c]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
lea eax, [esp + 0xc8]
push eax
mov dword [esp + 0xcc], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [esp + 0xcc], 4
push dword [ebp + 0xc]
lea ecx, [esp + 0x14]
jbe 0x4013b5
call fcn.004031b3
mov esi, 0x42b768
push esi
mov dword [esp + 0x170], ebx
call fcn.0040f5f0
pop ecx
push eax
push esi
lea eax, [esp + 0x18]
push eax
xor eax, eax
call fcn.004037d7
cmp eax, 0xffffffff
jne 0x40135d
push str.Global_
call fcn.0040f5f0
mov ebx, eax
pop ecx
lea eax, [esp + 0x10]
call fcn.00403721
xor ebx, ebx
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x40136c
lea eax, [esp + 0x14]
push eax
push ebx
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [edi + 4], eax
cmp eax, ebx
jne 0x40139c
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x40138f
lea eax, [esp + 0x14]
push eax
push ebx
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov dword [edi + 4], eax
or dword [esp + 0x16c], 0xffffffff
push ebx
push 1
lea ecx, [esp + 0x18]
call fcn.0040397b
jmp 0x40149f
call fcn.004031b3
mov dword [esp + 0x16c], esi
mov esi, 0x42b768
push esi
call fcn.0040f5f0
mov edi, eax
pop ecx
cmp edi, ebx
jbe 0x40142e
mov eax, dword [esp + 0x24]
cmp eax, ebx
jbe 0x40142e
or ecx, 0xffffffff
cmp eax, ecx
ja 0x4013e5
lea ecx, [eax - 1]
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x4013f4
lea eax, [esp + 0x14]
lea ebx, [eax + ecx]
jmp 0x401409
cmp dword [esp + 0x28], 0x10
jae 0x401404
lea eax, [esp + 0x14]
cmp ebx, eax
je 0x40142e
dec ebx
movsx eax, byte [ebx]
push edi
push eax
push esi
call fcn.0040f680
add esp, 0xc
test eax, eax
mov eax, dword [esp + 0x14]
je 0x4013f9
cmp dword [esp + 0x28], 0x10
jae 0x40142a
lea eax, [esp + 0x14]
sub ebx, eax
jmp 0x401431
or ebx, 0xffffffff
cmp ebx, 0xffffffff
je 0x401443
inc ebx
push ebx
push 0
lea ecx, [esp + 0x18]
call fcn.00403202
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x401452
lea eax, [esp + 0x14]
push eax
xor edi, edi
push edi
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, dword [ebp + 8]
mov dword [esi + 4], eax
cmp eax, edi
jne 0x401487
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x40147a
lea eax, [esp + 0x14]
push eax
push edi
push 1
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov dword [esi + 4], eax
or dword [esp + 0x16c], 0xffffffff
push edi
push 1
lea ecx, [esp + 0x18]
call fcn.0040397b
xor ebx, ebx
mov edi, esi
cmp dword [edi + 4], ebx
jne 0x4014e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x50]
push str.OpenMutex_returned_0x_08x
push eax
call fcn.00425e93
add esp, 0xc
push eax
lea eax, [esp + 0x6c]
push eax
mov dword [esp + 0x174], 2
call fcn.004258fc
push 0x42e930
lea eax, [esp + 0x6c]
push eax
call fcn.004104b1
mov ecx, dword [esp + 0x164]
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8