Function at 0x1004a240
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101217e0
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x1016e750]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi], eax
mov eax, dword [0x101726bc]
test eax, eax
jne 0x1004a293
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x101726bc], eax
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [0x10175350]
mov eax, 0x2aaaaaab
mov ebx, dword [0x1017534c]
xor edi, edi
sub ecx, ebx
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x14], eax
test eax, eax
jle 0x1004a318
mov eax, dword [ebp + 8]
xor ecx, ecx
test eax, eax
setne cl
mov dword [ebp - 0x18], ecx
test ecx, ecx
je 0x1004a32a
mov edx, dword [ebx]
mov ecx, eax
mov si, word [edx]
cmp si, word [ecx]
jne 0x1004a2fe
test si, si
je 0x1004a2fa
mov si, word [edx + 2]
cmp si, word [ecx + 2]
jne 0x1004a2fe
add edx, 4
add ecx, 4
test si, si
jne 0x1004a2d8
xor ecx, ecx
jmp 0x1004a303
sbb ecx, ecx
or ecx, 1
test ecx, ecx
sete cl
test cl, cl
jne 0x1004a334
mov ecx, dword [ebp - 0x18]
inc edi
add ebx, 0xc
cmp edi, dword [ebp - 0x14]
jl 0x1004a2d0
call fcn.10022690
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x1004a34a
push 0x80004005
call fcn.100223c0
mov ecx, dword [ebp - 0x10]
push dword [0x101726bc]
mov dword [ecx], edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x1004a40e
mov eax, dword [edx]
mov ecx, edx
call dword [eax + 0xc]
lea ecx, [eax + 0x10]
mov dword [ebp - 0x24], ecx
mov byte [ebp - 4], 1
lea esi, [ecx - 0x10]
mov eax, dword [ebp + 8]
lea ebx, [eax - 0x10]
cmp ebx, esi
je 0x1004a3a8
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x1004a39c
mov edx, dword [ebx]
cmp edx, dword [esi]
jne 0x1004a39c
mov ecx, ebx
call fcn.10024750
mov ebx, eax
or ecx, 0xffffffff
lock xadd dword [edi], ecx
dec ecx
test ecx, ecx
jg 0x1004a394
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
lea eax, [ebx + 0x10]
mov dword [ebp - 0x24], eax
jmp 0x1004a3a8
push dword [eax - 0xc]
lea ecx, [ebp - 0x24]
push eax
call fcn.10024680
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x20], 0
push ecx
mov dword [ebp - 0x1c], 0
call fcn.1004a810
mov ecx, dword [0x10175350]
mov eax, 0x2aaaaaab
sub ecx, dword [0x1017534c]
push dword [0x101726bc]
imul ecx
mov ecx, dword [ebp - 0x10]
sar edx, 1
mov eax, edx
dec edx
shr eax, 0x1f
add eax, edx
mov dword [ecx], eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov byte [ebp - 4], 0
or ecx, 0xffffffff
mov edx, dword [ebp - 0x24]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x1004a40e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
or ecx, 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x1004a432
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret