Function at 0x40f890
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], edi
mov dword [ebp - 8], esi
mov edi, edx
mov esi, eax
cmp esi, 0xfffffffb
jl 0x40f8b0
je 0x40fce7
jmp 0x40f8c6
push 0x564
push str.for_lub_mgt.c
push 2
push 8
call fcn.00414810
add esp, 0x10
lea ecx, [esi + 5]
cmp ecx, 0x69
jge 0x40fb56
lea eax, [esi*4 + 0x14]
lea edx, [eax*8]
sub edx, eax
mov ebx, dword [edx + 0x4df6f8]
mov dword [ebp - 0x18], edx
test ebx, ebx
je 0x40f8f5
cmp dword [ebx + 0x18], 0
je 0x40f912
mov dword [ebp - 0x10], ecx
push 0
push esi
call fcn.00417740
add esp, 8
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
xor eax, eax
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x64]
mov dword [ebx + 0x64], 0
test edi, edi
mov dword [ebp - 0x14], eax
je 0x40fa28
mov dword [ebp - 0x10], ecx
test byte [ebx + 0x161], 0x18
jne 0x40f995
xor eax, eax
cmp dword [0x4db0a0], 2
mov dword [edx + 0x4df6f8], eax
mov dword [edx + 0x4df6e8], 0xffffffff
mov dword [edx + 0x4df6ec], eax
jge 0x40f962
mov eax, edx
mov dword [eax + 0x4df6e4], 0
jmp 0x40f989
mov eax, edx
mov dword [eax + 0x4df6e4], 0
mov ecx, dword [ebp - 0x10]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
push dword [ecx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
call fcn.00412200
pop ecx
jmp 0x40fb37
push 0x178
push 0
mov esi, dword [ebx + 0xf8]
push ebx
call fcn.004a1df0
add esp, 0xc
mov edx, dword [ebp - 0x18]
movzx eax, byte [ebx + 0x161]
or byte [ebx + 0x16a], 4
and eax, 0xffffffe7
or eax, 8
cmp dword [0x4db0a0], 2
mov byte [ebx + 0x161], al
mov dword [ebx + 0xf8], esi
mov dword [edx + 0x4df6ec], 0
mov dword [edx + 0x4df6e8], 0xffffffff
jge 0x40f9fc
mov eax, edx
mov dword [eax + 0x4df6e4], 0
jmp 0x40fb37
mov eax, edx
mov dword [eax + 0x4df6e4], 0
mov ecx, dword [ebp - 0x10]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
push dword [ecx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40fb37
movzx eax, byte [ebx + 0x16b]
test al, 1
je 0x40fa55
movzx esi, byte [ebx + 0x163]
mov edx, esi
and edx, 0xffffffdf
and esi, 0x40
shr esi, 1
or edx, esi
mov byte [ebx + 0x163], dl
and eax, 0xfffffffe
mov byte [ebx + 0x16b], al
test al, 2
je 0x40fa6f
movzx edx, byte [ebx + 0x15a]
mov byte [ebx + 0x159], dl
and eax, 0xfffffffd
mov byte [ebx + 0x16b], al
test al, 4
je 0x40fa89
movzx edx, byte [ebx + 0x152]
mov byte [ebx + 0x151], dl
and eax, 0xfffffffb
mov byte [ebx + 0x16b], al
test al, 8
je 0x40faaf
movzx esi, byte [ebx + 0x166]
mov edx, esi
and edx, 0xfffffffd
and esi, 4
shr esi, 1
or edx, esi
mov byte [ebx + 0x166], dl
and eax, 0xfffffff7
mov byte [ebx + 0x16b], al
test al, 0x10
je 0x40fac9
movzx edx, byte [ebx + 0x158]
mov byte [ebx + 0x157], dl
and eax, 0xffffffef
mov byte [ebx + 0x16b], al
test al, 0x20
je 0x40fae3
movzx edx, byte [ebx + 0x15c]
mov byte [ebx + 0x15b], dl
and eax, 0xffffffdf
mov byte [ebx + 0x16b], al
cmp dword [0x4db0a0], 2
mov eax, dword [ebp - 0x18]
mov dword [eax + 0x4df6ec], 0
mov dword [eax + 0x4df6e8], 0xffffffff
jge 0x40fb0f
mov dword [eax + 0x4df6e4], 0
jmp 0x40fb37
mov dword [ebp - 0x10], ecx
mov dword [eax + 0x4df6e4], 0
mov ecx, dword [ebp - 0x10]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
push dword [ecx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [ebp - 0x14], 0
je 0x40fb47
mov eax, dword [ebp - 0x14]
mov dword [eax + 4], 0
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
xor eax, eax
mov esp, ebp
pop ebp
ret
mov eax, 0x3ee4f99d
imul ecx
mov ebx, ecx
sar ebx, 0x1f
sar edx, 7
sub edx, ebx
imul eax, edx, 0x209
sub ecx, eax
lea eax, [ecx + 0x69]
mov edx, dword [0x4db0a0]
mov dword [ebp - 0x10], eax
cmp edx, 2
jge 0x40fbb0
lea ebx, [ecx*4 + 0x1a4]
lea ecx, [ebx*8]
sub ecx, ebx
mov ebx, dword [ecx + 0x4df6e4]
test ebx, ebx
jne 0x40fc47
mov dword [ecx + 0x4df6e4], 1
mov eax, dword [ebp - 0x10]
jmp 0x40fc47
lea eax, [ecx*4 + 0x1a4]
lea edx, [eax*8]
sub edx, eax
lea ecx, [edx + 0x4df6e4]
push ecx
call fcn.00401dd0
pop ecx
test eax, eax
jne 0x40fc3e
mov ecx, dword [ebp - 0x10]
lea eax, [ecx*4]
mov edx, ecx
shl edx, 5
sub edx, eax
cmp dword [edx + 0x4df6e0], 0
je 0x40ffc8
lea eax, [ecx*4]
shl ecx, 5
sub ecx, eax
mov dword [ecx + 0x4df6e4], 0
mov edx, dword [ebp - 0x10]
push 0xffffffffffffffff
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x10]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
lea ecx, [edx + 0x4df6e4]
push ecx
call fcn.00401dd0
pop ecx
mov edx, dword [0x4db0a0]
mov eax, dword [ebp - 0x10]
cmp edx, 1
je 0x40ffa1
lea ecx, [eax*4]
mov ebx, eax
shl ebx, 5
sub ebx, ecx
mov dword [ebp - 0x18], ebx
mov ebx, dword [ebx + 0x4df6f8]
test ebx, ebx
je 0x40fc82
xor ecx, ecx
cmp esi, dword [ebx + 0xf8]
jle 0x40fdd9
mov ecx, ebx
mov ebx, dword [ebx + 0x28]
test ebx, ebx
jne 0x40fc6d
cmp edx, 1
je 0x40fdb4
lea ecx, [eax*4]
shl eax, 5
sub eax, ecx
cmp edx, 2
jge 0x40fca8
mov dword [eax + 0x4df6e4], 0
jmp 0x40fccd
mov dword [eax + 0x4df6e4], 0
mov edx, dword [ebp - 0x10]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push 0
push esi
call fcn.00417740
add esp, 8
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
xor eax, eax
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4db0a0]
cmp eax, 2
jge 0x40fd04
cmp eax, 1
je 0x40fd69
mov dword [ebp - 0x18], section..data
mov edx, section..data
jmp 0x40fd15
lea eax, [ebp - 0x18]
push eax
call fcn.00401b40
pop ecx
test eax, eax
jne 0x40fd5f
mov edx, dword [ebp - 0x18]
mov ebx, dword [edx]
test ebx, ebx
je 0x40fd8c
mov eax, dword [ebx + 0x28]
mov dword [edx], eax
mov edx, dword [ebx + 0x64]
mov eax, dword [ebx + 0x58]
mov dword [ebp - 0x14], edx
mov dword [ebx + 0x64], 0
test byte [eax + 0x4f], 2
je 0x40fd42
push dword [eax + 4]
call fcn.00412200
pop ecx
mov eax, dword [ebx + 0x58]
push eax
call fcn.00412200
push ebx
call fcn.00412200
add esp, 8
cmp dword [0x4db0a0], 1
je 0x40fd76
jmp 0x40fb37
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
push 0x4db064
call fcn.00401d80
pop ecx
jmp 0x40fcf6
mov eax, dword [ebp - 0x18]
push dword [eax + 0x68]
push dword [eax + 0x64]
call fcn.00401db0
add esp, 8
jmp 0x40fb37
cmp dword [0x4db0a0], 1
je 0x40fda4
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
xor eax, eax
mov esp, ebp
pop ebp
ret
push dword [edx + 0x68]
push dword [edx + 0x64]
call fcn.00401db0
add esp, 8
jmp 0x40fd95
mov eax, dword [ebp - 0x18]
push dword [eax + 0x4df6f4]
push dword [eax + 0x4df6f0]
call fcn.00401db0
add esp, 8
mov eax, dword [ebp - 0x10]
mov edx, dword [0x4db0a0]
jmp 0x40fc8b
jne 0x40fc82
test edi, edi
je 0x40fdf1
test ecx, ecx
je 0x40ff6b
mov esi, dword [ebx + 0x28]
mov dword [ecx + 0x28], esi
cmp edx, 1
je 0x40ff7c
lea ecx, [eax*4]
shl eax, 5
sub eax, ecx
cmp edx, 2
jge 0x40fe17
mov dword [eax + 0x4df6e4], 0
jmp 0x40fe3c
mov dword [eax + 0x4df6e4], 0
mov edx, dword [ebp - 0x10]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4df6e0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebx + 0x64]
mov dword [ebx + 0x64], 0
mov dword [ebp - 0x14], eax
movzx eax, byte [ebx + 0x16b]
test al, 1
je 0x40fe76
movzx ecx, byte [ebx + 0x163]
mov edx, ecx
and edx, 0xffffffdf
and ecx, 0x40
shr ecx, 1
or edx, ecx
mov byte [ebx + 0x163], dl
and eax, 0xfffffffe
mov byte [ebx + 0x16b], al
test al, 2
je 0x40fe90
movzx edx, byte [ebx + 0x15a]
mov byte [ebx + 0x159], dl
and eax, 0xfffffffd
mov byte [ebx + 0x16b], al
test al, 4
je 0x40feaa
movzx edx, byte [ebx + 0x152]
mov byte [ebx + 0x151], dl
and eax, 0xfffffffb
mov byte [ebx + 0x16b], al
test al, 8
je 0x40fed0
movzx ecx, byte [ebx + 0x166]
mov edx, ecx
and edx, 0xfffffffd
and ecx, 4
shr ecx, 1
or edx, ecx
mov byte [ebx + 0x166], dl
and eax, 0xfffffff7
mov byte [ebx + 0x16b], al
test al, 0x10
je 0x40feea
movzx edx, byte [ebx + 0x158]
mov byte [ebx + 0x157], dl
and eax, 0xffffffef
mov byte [ebx + 0x16b], al
test al, 0x20
je 0x40ff04
movzx edx, byte [ebx + 0x15c]
mov byte [ebx + 0x15b], dl
and eax, 0xffffffdf
mov byte [ebx + 0x16b], al
cmp dword [0x4db0a0], 2
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0xffffffff
jge 0x40ff24
mov dword [ebx + 4], 0
jmp 0x40ff33
push dword [ebx]
mov dword [ebx + 4], 0
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test edi, edi
je 0x40fb37
cmp dword [0x4db0a0], 2
jl 0x40ff51
mov eax, dword [ebx]
test eax, eax
je 0x40ff51
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 8], 0xffffffff
push ebx
mov dword [ebx + 0xc], 0
call fcn.00412200
pop ecx
jmp 0x40fb37
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebx + 0x28]
mov dword [esi + 0x4df6f8], ecx
jmp 0x40fdf1
mov eax, dword [ebp - 0x18]
push dword [eax + 0x4df6f4]
push dword [eax + 0x4df6f0]
call fcn.00401db0
add esp, 8
mov eax, dword [ebp - 0x10]
mov edx, dword [0x4db0a0]
jmp 0x40fdfa
lea edx, [eax*4]
shl eax, 5
sub eax, edx
lea eax, [eax + 0x4df6f0]
push eax
call fcn.00401d80
pop ecx
mov edx, dword [0x4db0a0]
mov eax, dword [ebp - 0x10]
jmp 0x40fc50
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ecx, dword [ebp - 0x10]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
mov dword [ecx + 0x4df6e0], eax
mov dword [ecx + 0x4df6e4], 0
jmp 0x40fc05