Function at 0x4012b7
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x426efc
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 0x4013db
call fcn.00403916
mov esi, 0x42a780
push esi
mov dword [esp + 0x170], ebx
call fcn.0040ebd0
pop ecx
push eax
push esi
lea eax, [esp + 0x18]
push eax
xor eax, eax
call fcn.004040ad
cmp eax, 0xffffffff
jne 0x401383
push str.Global_
call fcn.0040ebd0
mov ebx, eax
pop ecx
lea eax, [esp + 0x10]
call fcn.00403ff7
xor ebx, ebx
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x401392
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 0x4013c2
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x4013b5
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.00404329
jmp 0x4014c5
call fcn.00403916
mov dword [esp + 0x16c], esi
mov esi, 0x42a780
push esi
call fcn.0040ebd0
mov edi, eax
pop ecx
cmp edi, ebx
jbe 0x401454
mov eax, dword [esp + 0x24]
cmp eax, ebx
jbe 0x401454
or ecx, 0xffffffff
cmp eax, ecx
ja 0x40140b
lea ecx, [eax - 1]
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x40141a
lea eax, [esp + 0x14]
lea ebx, [eax + ecx]
jmp 0x40142f
cmp dword [esp + 0x28], 0x10
jae 0x40142a
lea eax, [esp + 0x14]
cmp ebx, eax
je 0x401454
dec ebx
movsx eax, byte [ebx]
push edi
push eax
push esi
call fcn.0040ec60
add esp, 0xc
test eax, eax
mov eax, dword [esp + 0x14]
je 0x40141f
cmp dword [esp + 0x28], 0x10
jae 0x401450
lea eax, [esp + 0x14]
sub ebx, eax
jmp 0x401457
or ebx, 0xffffffff
cmp ebx, 0xffffffff
je 0x401469
inc ebx
push ebx
push 0
lea ecx, [esp + 0x18]
call fcn.0040395b
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x401478
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 0x4014ad
cmp dword [esp + 0x28], 0x10
mov eax, dword [esp + 0x14]
jae 0x4014a0
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.00404329
xor ebx, ebx
mov edi, esi
cmp dword [edi + 4], ebx
jne 0x401508
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x50]
push str.OpenMutex_returned_0x_08x
push eax
call fcn.004253b6
add esp, 0xc
push eax
lea eax, [esp + 0x6c]
push eax
mov dword [esp + 0x174], 2
call fcn.00424e1f
push 0x42d960
lea eax, [esp + 0x6c]
push eax
call fcn.0041045b
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