Function at 0x5a7870
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [0x708374]
push ebx
push esi
push edi
test eax, eax
jne 0x5a7887
call fcn.005ad270
mov esi, dword [ebp + 8]
cmp esi, 0xfffffffb
jge 0x5a789b
mov eax, 0xc0000020
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
jne 0x5a7973
lea eax, [ebp - 4]
push eax
push 0xfffffffffffffffb
call fcn.005a7e70
add esp, 8
test eax, eax
je 0x5a78c3
mov ecx, dword [ebp + 0xc]
mov dword [ecx], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x636b94]
cmp eax, 2
jl 0x5a78dd
lea edx, [ebp + 8]
push edx
call fcn.005ad480
add esp, 4
mov esi, eax
jmp 0x5a78f8
cmp eax, 1
jl 0x5a78ef
push 0x636b8c
call fcn.005ad4b0
add esp, 4
mov dword [ebp + 8], 0x636b68
xor esi, esi
test esi, esi
je 0x5a791a
mov eax, dword [ebp - 4]
push eax
call fcn.005a3d70
mov ecx, dword [ebp + 0xc]
add esp, 4
mov eax, esi
mov dword [ecx], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 4]
mov eax, dword [edx]
mov dword [ecx + 0x18], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 4]
mov dword [eax], edx
mov eax, dword [0x636b94]
cmp eax, 1
jl 0x5a7946
mov ecx, dword [ebp + 8]
add ecx, 0x24
push ecx
call fcn.005ad4e0
add esp, 4
mov edx, dword [ebp - 4]
mov al, byte [ebp + 0x14]
mov byte [edx + 0x113], al
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 4]
test eax, eax
je 0x5a795f
mov dword [eax + 4], ecx
mov dword [ecx + 0x58], eax
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 4]
xor eax, eax
mov dword [ecx], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esi + 5]
cmp ecx, 0x69
mov dword [ebp - 8], ecx
jge 0x5a7b52
mov esi, ecx
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
shl esi, 3
sub esi, ecx
shl esi, 2
mov eax, dword [esi + 0xa4b1cc]
test eax, eax
je 0x5a79bf
mov esi, ecx
shl esi, 3
sub esi, ecx
shl esi, 2
call edi
cmp dword [esi + 0xa4b1c8], eax
jne 0x5a79bc
mov eax, 0xc0000028
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 8]
mov eax, dword [0x636b94]
mov ebx, 1
cmp eax, 2
jl 0x5a7a86
mov eax, dword [esi + 0xa4b1c0]
test eax, eax
jne 0x5a7a43
lea eax, [esi + 0xa4b1c4]
push eax
call fcn.005ad510
add esp, 4
test eax, eax
je 0x5a79f9
mov ecx, dword [ebp - 8]
mov eax, 0xc0000098
jmp 0x5a7a45
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
sub eax, ecx
shl eax, 2
mov edx, dword [eax + 0xa4b1c0]
test edx, edx
jne 0x5a7a39
mov esi, ecx
push 0
shl esi, 3
sub esi, ecx
push 0
push 0
shl esi, 2
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ecx, dword [ebp - 8]
mov dword [esi + 0xa4b1c0], eax
xor eax, eax
mov dword [esi + 0xa4b1c4], eax
jmp 0x5a7a45
mov dword [eax + 0xa4b1c4], 0
xor eax, eax
test eax, eax
je 0x5a7a50
mov eax, 0xc0000098
jmp 0x5a7a9f
mov edx, ecx
push 0xffffffffffffffff
shl edx, 3
sub edx, ecx
mov eax, dword [edx*4 + 0xa4b1c0]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp - 8]
mov ecx, eax
shl ecx, 3
sub ecx, eax
lea edx, [ecx*4 + 0xa4b1c4]
push edx
call fcn.005ad510
mov ecx, dword [ebp - 8]
add esp, 4
jmp 0x5a7a9f
mov eax, dword [esi + 0xa4b1c4]
test eax, eax
je 0x5a7a97
mov eax, 0xc0000098
jmp 0x5a7a9f
mov dword [esi + 0xa4b1c4], ebx
xor eax, eax
test eax, eax
je 0x5a7aaf
mov eax, 0xc0000098
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, ecx
shl esi, 3
sub esi, ecx
shl esi, 2
call edi
mov dword [esi + 0xa4b1c8], eax
mov dword [esi + 0xa4b1cc], ebx
mov eax, dword [esi + 0xa4b1d8]
test eax, eax
jne 0x5a7b45
mov ecx, dword [ebp + 8]
lea eax, [ebp - 4]
push eax
push ecx
xor ebx, ebx
call fcn.005a7e70
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x5a7b2c
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
sub eax, ecx
mov ecx, dword [0x636b94]
shl eax, 2
cmp ecx, 2
mov dword [eax + 0xa4b1cc], ebx
mov dword [eax + 0xa4b1c4], ebx
jl 0x5a7c17
mov edx, dword [eax + 0xa4b1c0]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp + 0xc]
mov dword [eax], ebx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
mov ecx, eax
shl ecx, 3
sub ecx, eax
mov eax, dword [ebp - 4]
mov dword [ecx*4 + 0xa4b1d8], eax
jmp 0x5a7d58
mov ebx, 1
mov dword [ebp - 4], eax
jmp 0x5a7d58
lea edx, [ebp - 0x10]
lea eax, [ebp - 4]
push edx
lea ecx, [ebp - 8]
push eax
push ecx
push esi
call fcn.005a7f30
add esp, 0x10
test eax, eax
je 0x5a7b7b
mov edx, dword [ebp + 0xc]
mov dword [edx], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x5a7b94
cmp dword [ecx + 0xb8], esi
jne 0x5a7b94
mov ebx, 1
jmp 0x5a7c57
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0xc]
push eax
push ecx
xor ebx, ebx
call fcn.005a7e70
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x5a7c25
cmp dword [0x636b94], 1
jl 0x5a7bcf
mov eax, dword [ebp - 8]
mov edx, eax
shl edx, 3
sub edx, eax
lea eax, [edx*4 + 0xa4b1d0]
push eax
call fcn.005ad4e0
add esp, 4
cmp dword [0x636b94], 2
jl 0x5a7c06
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
sub eax, ecx
shl eax, 2
mov dword [eax + 0xa4b1c4], ebx
mov ecx, dword [eax + 0xa4b1c0]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp + 0xc]
mov dword [eax], ebx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
mov edx, eax
shl edx, 3
sub edx, eax
mov dword [edx*4 + 0xa4b1c4], ebx
mov eax, dword [ebp + 0xc]
mov dword [eax], ebx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
mov dword [edx + 0x18], ecx
mov eax, dword [ebp - 0x10]
cmp eax, ebx
je 0x5a7c3d
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0x18], ecx
jmp 0x5a7c51
mov eax, dword [ebp - 8]
mov edx, eax
shl edx, 3
sub edx, eax
mov eax, dword [ebp - 0xc]
mov dword [edx*4 + 0xa4b1d8], eax
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 4], ecx
mov eax, dword [ecx + 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor edi, edi
cmp eax, edi
je 0x5a7db1
call esi
mov ecx, dword [ebp - 4]
cmp dword [ecx + 8], eax
jne 0x5a7db1
mov esi, 0xc0000028
cmp dword [0x636b94], 1
jl 0x5a7ca0
mov eax, dword [ebp - 8]
mov ecx, eax
shl ecx, 3
sub ecx, eax
lea edx, [ecx*4 + 0xa4b1d0]
push edx
call fcn.005ad4e0
add esp, 4
cmp dword [0x636b94], 2
jl 0x5a7cd7
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
sub eax, ecx
shl eax, 2
mov dword [eax + 0xa4b1c4], edi
mov eax, dword [eax + 0xa4b1c0]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [ebp + 0xc]
mov eax, esi
mov dword [edx], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
mov ecx, eax
shl ecx, 3
sub ecx, eax
mov eax, esi
mov dword [ecx*4 + 0xa4b1c4], edi
mov dword [edx], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [0x636b94], 1
jl 0x5a7d19
mov eax, dword [ebp - 8]
mov ecx, eax
shl ecx, 3
sub ecx, eax
lea edx, [ecx*4 + 0xa4b1d0]
push edx
call fcn.005ad4e0
add esp, 4
cmp dword [0x636b94], 2
jl 0x5a7d44
mov ecx, dword [ebp - 8]
mov eax, ecx
shl eax, 3
sub eax, ecx
shl eax, 2
mov dword [eax + 0xa4b1c4], edi
mov eax, dword [eax + 0xa4b1c0]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x5a7d55
mov eax, dword [ebp - 8]
mov ecx, eax
shl ecx, 3
sub ecx, eax
mov dword [ecx*4 + 0xa4b1c4], edi
mov eax, dword [ebp - 4]
mov edi, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
test ecx, ecx
mov dword [edi], eax
je 0x5a7d67
mov dword [ecx + 4], eax
mov dword [eax + 0x58], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0x14]
test ebx, ebx
mov byte [edx + 0x113], al
je 0x5a7da8
push eax
mov eax, dword [ebp - 4]
push eax
call fcn.005a80a0
mov esi, eax
add esp, 8
test esi, esi
je 0x5a7da8
mov ecx, dword [ebp + 8]
push ecx
call fcn.005a8210
add esp, 4
mov dword [edi], 0
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [0x636b94], 2
jl 0x5a7e2d
cmp dword [ecx], edi
jne 0x5a7e04
add ecx, 4
push ecx
call fcn.005ad510
add esp, 4
test eax, eax
je 0x5a7dd8
mov ecx, dword [ebp - 4]
mov eax, 0xc0000098
jmp 0x5a7e06
mov eax, dword [ebp - 4]
cmp dword [eax], edi
jne 0x5a7dfa
push edi
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ecx, dword [ebp - 4]
mov dword [ecx], eax
mov edx, dword [ebp - 4]
xor eax, eax
mov dword [edx + 4], edi
mov ecx, dword [ebp - 4]
jmp 0x5a7e06
mov dword [eax + 4], edi
mov ecx, dword [ebp - 4]
xor eax, eax
jmp 0x5a7e06
xor eax, eax
cmp eax, edi
je 0x5a7e11
mov eax, 0xc0000098
jmp 0x5a7e42
mov eax, dword [ecx]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [ebp - 4]
add ecx, 4
push ecx
call fcn.005ad510
add esp, 4
jmp 0x5a7e42
cmp dword [ecx + 4], edi
je 0x5a7e39
mov eax, 0xc0000098
jmp 0x5a7e42
mov dword [ecx + 4], 1
xor eax, eax
cmp eax, edi
je 0x5a7e50
mov esi, 0xc0000098
jmp 0x5a7c7d
call esi
mov edx, dword [ebp - 4]
mov dword [edx + 8], eax
mov eax, dword [ebp - 4]
mov dword [eax + 0xc], 1
jmp 0x5a7cf6