Function at 0x40cda0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], esi
mov dword [ebp - 0xc], ebx
mov esi, dword [eax]
cmp esi, 0xffffffff
mov dword [ebp - 8], edi
je 0x40cdc8
jle 0x40d126
cmp esi, 0x68
jg 0x40d126
inc esi
mov eax, esi
mov ebx, esi
mov edx, esi
test eax, eax
jl 0x40d10e
mov dword [ebp - 0x1c], esi
cmp eax, 0x271
jg 0x40d10e
mov esi, eax
lea ecx, [eax*4]
shl esi, 5
sub esi, ecx
cmp dword [esi + 0x4e6918], 0
je 0x40d103
mov dword [ebp - 0x18], edx
cmp eax, 0x68
jg 0x40cfc1
cmp dword [esi + 0x4e690c], 0
je 0x40ce52
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
mov ebx, dword [ebp - 0x18]
mov ecx, ebx
shl ecx, 5
mov eax, ebx
lea edx, [ebx*4]
sub ecx, edx
cmp esi, dword [ecx + 0x4e6908]
jne 0x40ce52
mov esi, dword [ebp - 0x1c]
mov eax, 0x28
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov dword [edx], esi
mov esi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
cmp dword [0x4e30a0], 2
jge 0x40ce8c
lea edx, [eax*4]
shl eax, 5
sub eax, edx
mov ecx, dword [eax + 0x4e6904]
test ecx, ecx
je 0x40ce7b
mov eax, 0x98
jmp 0x40cf12
mov dword [eax + 0x4e6904], 1
xor eax, eax
jmp 0x40cf12
lea eax, [ebx*4]
shl ebx, 5
sub ebx, eax
lea edx, [ebx + 0x4e6904]
push edx
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40ceb2
mov eax, 0x98
jmp 0x40cf12
mov edx, dword [ebp - 0x18]
mov ecx, edx
shl ecx, 5
lea eax, [edx*4]
sub ecx, eax
cmp dword [ecx + 0x4e6900], 0
je 0x40d35e
mov dword [ecx + 0x4e6904], 0
push 0xffffffffffffffff
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
lea ecx, [edx + 0x4e6904]
push ecx
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40cf1d
mov eax, 0x98
jmp 0x40cf44
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [ebp - 0x18]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
mov dword [ecx + 0x4e6908], eax
xor eax, eax
mov dword [ecx + 0x4e690c], 1
test eax, eax
jne 0x40d356
mov eax, dword [ebp - 0x18]
mov ecx, eax
shl ecx, 5
lea edx, [eax*4]
sub ecx, edx
mov edx, dword [ecx + 0x4e6918]
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x40d322
mov dword [ecx + 0x4e690c], 0
mov dword [ecx + 0x4e6908], 0xffffffff
cmp dword [0x4e30a0], 2
jge 0x40cf9a
mov dword [ecx + 0x4e6904], 0
jmp 0x40d103
mov dword [ecx + 0x4e6904], 0
lea edx, [eax*4]
shl eax, 5
sub eax, edx
push dword [eax + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40d100
call fcn.0040d730
mov edi, eax
mov edx, dword [0x4e30a0]
cmp edx, 2
jge 0x40cff3
mov eax, dword [esi + 0x4e6904]
test eax, eax
jne 0x40d07b
mov dword [esi + 0x4e6904], 1
mov ebx, dword [ebp - 0x18]
jmp 0x40d07b
lea eax, [ebx*4]
shl ebx, 5
sub ebx, eax
lea edx, [ebx + 0x4e6904]
push edx
call fcn.00401c70
add esp, 4
test eax, eax
jne 0x40d072
mov edx, dword [ebp - 0x18]
mov ecx, edx
shl ecx, 5
lea eax, [edx*4]
sub ecx, eax
cmp dword [ecx + 0x4e6900], 0
je 0x40d5e9
mov dword [ecx + 0x4e6904], 0
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push 0xffffffffffffffff
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
lea ecx, [edx + 0x4e6904]
push ecx
call fcn.00401c70
add esp, 4
mov edx, dword [0x4e30a0]
mov ebx, dword [ebp - 0x18]
cmp edx, 1
je 0x40d5c6
mov ecx, ebx
lea eax, [ebx*4]
shl ecx, 5
sub ecx, eax
mov edx, dword [ecx + 0x4e6918]
test edx, edx
mov dword [ebp - 0x14], edx
jne 0x40d3b3
mov edx, dword [0x4e30a0]
cmp edx, 1
je 0x40d38f
mov eax, dword [ebp - 0x18]
cmp edx, 2
jge 0x40d0d2
lea edx, [ebx*4]
shl ebx, 5
sub ebx, edx
mov dword [ebx + 0x4e6904], 0
jmp 0x40d103
lea edx, [ebx*4]
shl ebx, 5
sub ebx, edx
mov dword [ebx + 0x4e6904], 0
lea ecx, [eax*4]
shl eax, 5
sub eax, ecx
push dword [eax + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x18]
inc eax
mov ebx, eax
mov edx, eax
jns 0x40cdda
mov edx, dword [ebp + 0xc]
xor eax, eax
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov dword [edx], 0xffffffff
mov esp, ebp
pop ebp
ret
lea edi, [esi - 5]
test esi, esi
jge 0x40d12f
mov edi, esi
lea ebx, [ebp - 0x10]
mov dword [esp + 0xc], ebx
mov eax, edi
lea edx, [ebp - 0x18]
lea ecx, [ebp - 0x14]
call fcn.0040cc00
mov ebx, eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x1c], eax
call fcn.0040d730
cmp eax, 0x7fffffff
je 0x40d161
cmp eax, 0xfffffffa
lea esi, [eax + 5]
jg 0x40d161
mov esi, eax
mov eax, dword [ebp + 0xc]
test ebx, ebx
mov dword [eax], esi
jne 0x40d313
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x40d61a
cmp edi, dword [edx + 0x100]
jne 0x40d18f
mov edx, dword [edx + 0x28]
test edx, edx
mov dword [ebp - 0x14], edx
je 0x40d61a
cmp dword [edx + 0xc], 0
je 0x40d1ad
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebp - 0x14]
cmp eax, dword [edx + 8]
jne 0x40d1ad
mov ebx, 0x28
jmp 0x40d239
cmp dword [0x4e30a0], 2
jge 0x40d1cf
mov eax, dword [edx + 4]
test eax, eax
je 0x40d1c4
mov eax, 0x98
jmp 0x40d215
mov dword [edx + 4], 1
xor eax, eax
jmp 0x40d215
add edx, 4
push edx
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40d1e6
mov eax, 0x98
jmp 0x40d215
mov eax, dword [ebp - 0x14]
cmp dword [eax], 0
je 0x40d714
mov dword [eax + 4], 0
mov eax, dword [ebp - 0x14]
push 0xffffffffffffffff
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x14]
add eax, 4
push eax
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40d220
mov ebx, 0x98
jmp 0x40d235
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebp - 0x14]
xor ebx, ebx
mov dword [edx + 8], eax
mov dword [edx + 0xc], 1
test ebx, ebx
je 0x40d2a0
mov eax, dword [0x4e30a0]
cmp eax, 1
je 0x40d6ba
cmp eax, 2
jge 0x40d267
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
jmp 0x40d28c
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [ebp + 0xc]
mov eax, ebx
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov dword [edx], esi
mov esi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4e30a0]
cmp eax, 1
je 0x40d6e7
cmp eax, 2
jge 0x40d2ce
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
jmp 0x40d2f3
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 0x10]
call fcn.0040d770
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov dword [ecx], edx
mov esp, ebp
pop ebp
ret
mov eax, ebx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov eax, edx
mov edx, dword [ebp + 0x10]
call fcn.0040d770
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x14]
mov edi, dword [ebp + 0xc]
mov dword [edx], ecx
mov ebx, dword [ecx + 0x100]
cmp ebx, 0xfffffffa
lea esi, [ebx + 5]
jg 0x40d347
mov esi, ebx
mov dword [edi], esi
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x1c]
jmp 0x40ce40
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edx, dword [ebp - 0x18]
mov ebx, edx
shl ebx, 5
lea ecx, [edx*4]
sub ebx, ecx
mov dword [ebx + 0x4e6900], eax
mov dword [ebx + 0x4e6904], 0
jmp 0x40ceda
push dword [ecx + 0x4e6914]
push dword [ecx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov ebx, dword [ebp - 0x18]
mov eax, ebx
mov edx, dword [0x4e30a0]
jmp 0x40d0b5
cmp dword [edx + 0xc], 0
je 0x40d3d1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebp - 0x14]
cmp eax, dword [edx + 8]
jne 0x40d3d1
mov ebx, 0x28
jmp 0x40d45d
cmp dword [0x4e30a0], 2
jge 0x40d3f3
mov eax, dword [edx + 4]
test eax, eax
je 0x40d3e8
mov eax, 0x98
jmp 0x40d439
mov dword [edx + 4], 1
xor eax, eax
jmp 0x40d439
add edx, 4
push edx
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40d40a
mov eax, 0x98
jmp 0x40d439
mov eax, dword [ebp - 0x14]
cmp dword [eax], 0
je 0x40d5aa
mov dword [eax + 4], 0
mov eax, dword [ebp - 0x14]
push 0xffffffffffffffff
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x14]
add eax, 4
push eax
call fcn.00401c70
add esp, 4
test eax, eax
je 0x40d444
mov ebx, 0x98
jmp 0x40d459
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebp - 0x14]
xor ebx, ebx
mov dword [edx + 8], eax
mov dword [edx + 0xc], 1
test ebx, ebx
je 0x40d4ce
mov eax, dword [0x4e30a0]
cmp eax, 1
je 0x40d550
cmp eax, 2
jge 0x40d48b
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
jmp 0x40d4b0
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp edi, 0xfffffffa
lea edx, [edi + 5]
mov ecx, dword [ebp + 0xc]
mov eax, ebx
jg 0x40d4bf
mov edx, edi
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov dword [ecx], edx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x4e30a0]
cmp eax, 1
je 0x40d57d
cmp eax, 2
jge 0x40d4fc
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
jmp 0x40d521
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
mov dword [edx + 0x4e6904], 0
push dword [edx + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 0x10]
call fcn.0040d770
cmp edi, 0xfffffffa
lea ebx, [edi + 5]
mov ecx, dword [ebp + 8]
jg 0x40d539
mov ebx, edi
mov esi, dword [ebp + 0xc]
mov edx, dword [ebp - 0x14]
mov dword [ecx], edx
mov dword [esi], ebx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6914]
push dword [edx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov eax, dword [0x4e30a0]
jmp 0x40d46b
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6914]
push dword [edx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov eax, dword [0x4e30a0]
jmp 0x40d4dc
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edx, dword [ebp - 0x14]
mov dword [edx], eax
mov dword [edx + 4], 0
jmp 0x40d41d
lea eax, [ebx*4]
shl ebx, 5
sub ebx, eax
lea edx, [ebx + 0x4e6910]
push edx
call fcn.00401c20
add esp, 4
mov ebx, dword [ebp - 0x18]
jmp 0x40d084
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edx, dword [ebp - 0x18]
mov ebx, edx
shl ebx, 5
lea ecx, [edx*4]
sub ebx, ecx
mov dword [ebx + 0x4e6900], eax
mov dword [ebx + 0x4e6904], 0
jmp 0x40d03a
mov ebx, dword [0x4e30a0]
cmp ebx, 1
je 0x40d686
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
lea edx, [ecx*4]
shl ecx, 5
sub ecx, edx
mov dword [ebp - 0x1c], ecx
cmp ebx, 2
jge 0x40d64d
mov edx, ecx
mov dword [edx + 0x4e6904], 0
jmp 0x40d674
mov edx, ecx
lea ecx, [eax*4]
shl eax, 5
sub eax, ecx
mov dword [edx + 0x4e6904], 0
push dword [eax + 0x4e6900]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
inc eax
mov ebx, eax
lea edx, [esi + 1]
mov dword [ecx], edx
mov edx, eax
jmp 0x40cdcf
mov edx, dword [ebp - 0x1c]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6914]
push dword [edx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x1c], eax
mov ebx, dword [0x4e30a0]
jmp 0x40d628
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6914]
push dword [edx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov eax, dword [0x4e30a0]
jmp 0x40d247
mov edx, dword [ebp - 0x18]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x4e6914]
push dword [edx + 0x4e6910]
call fcn.00401c50
add esp, 8
mov eax, dword [0x4e30a0]
jmp 0x40d2ae
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edx, dword [ebp - 0x14]
mov dword [edx], eax
mov dword [edx + 4], 0
jmp 0x40d1f9