Function at 0x542740
Capabilities:
Check if file exists
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x90
mov esi, esp
mov dword [esi + 4], ecx
mov eax, dword [0x5c4738]
xor eax, ebp
mov dword [esi + 0x88], eax
lea edi, [esi + 0x30]
mov ecx, edi
call fcn.00542af0
cmp byte [edi + 0xb], 0
jns 0x542774
mov edi, dword [esi + 0x30]
push edi
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
test eax, eax
je 0x54298d
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp edi, 0xffffffff
je 0x542ad8
call fcn.004bafe0
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp byte [esi + 0x3b], 0
jns 0x5427ba
push dword [esi + 0x30]
call fcn.004cf0d6
add esp, 4
lea eax, [edi + 1]
cmp eax, 1
ja 0x54284b
mov dword [esi + 4], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esi + 0x24]
push eax
push edi
call fcn.00501dd0
add esp, 8
lea ebx, [esi + 0x30]
mov ecx, ebx
push edi
push 0x127
push str.Open
push 1
call fcn.00501b30
lea ecx, [esi + 0x6c]
push 0x589972
push str.Cannot_open_service_update_mutex
call fcn.004fc970
mov ecx, ebx
call fcn.00501b70
cmp byte [edi + 0xb], 0
jns 0x54281d
push dword [esi + 0x24]
call fcn.004cf0d6
add esp, 4
mov edi, dword [esi + 4]
lea eax, [edi + 1]
cmp eax, 2
jb 0x542836
call fcn.004bafe0
push edi
call fcn.004c1b90
add esp, 4
mov ecx, dword [esi + 0x88]
xor ecx, ebp
call fcn.004d25a3
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
lea ebx, [esi + 0x30]
push ebx
call fcn.00542340
add esp, 4
cmp byte [ebx + 0xb], 0
jns 0x542860
mov ebx, dword [esi + 0x30]
push ebx
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventW]
test eax, eax
je 0x542994
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, ebx
mov ebx, eax
mov dword [esi + 8], ecx
cmp ecx, 0xffffffff
je 0x542adf
call fcn.004bafe0
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [esi + 8]
cmp byte [esi + 0x3b], 0
jns 0x5428ae
push dword [esi + 0x30]
call fcn.004cf0d6
add esp, 4
mov dword [esi + 8], ebx
lea eax, [ebx + 1]
cmp eax, 1
jbe 0x54299b
push 8
call fcn.004cf0a6
add esp, 4
mov dword [esi + 0xc], eax
mov dword [esi + 0x14], esp
push eax
mov ebx, esp
mov dword [ebx], 0
call fcn.004bafe0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x10], eax
mov eax, dword [ebx]
inc eax
cmp eax, 2
jae 0x542aaa
mov eax, dword [esi + 8]
mov dword [ebx], eax
call fcn.004bafe0
push dword [esi + 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [esi + 0xc]
mov ecx, ebx
call fcn.00521240
mov esp, dword [esi + 0x14]
cmp dword [ebx], 0
je 0x542a36
call fcn.004bafe0
mov eax, dword [esi + 4]
cmp dword [eax], edi
je 0x54294d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esi + 4]
mov ebx, eax
mov eax, dword [ecx]
inc eax
cmp eax, 2
jae 0x542abe
mov dword [ecx], edi
call fcn.004bafe0
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 4]
mov ebx, dword [eax + 4]
mov ecx, dword [esi + 0xc]
mov dword [eax + 4], ecx
xor edi, edi
test ebx, ebx
je 0x54296c
mov ecx, ebx
call fcn.004c1b60
push ebx
call fcn.004cf0d6
add esp, 4
xor ebx, ebx
lea eax, [ebx + 1]
cmp eax, 2
jb 0x542820
call fcn.004bafe0
push ebx
call fcn.004c1b90
add esp, 4
jmp 0x542820
xor edi, edi
jmp 0x5427a9
xor ebx, ebx
jmp 0x54289d
mov dword [esi + 4], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esi + 0x24]
push eax
push edi
call fcn.00501dd0
add esp, 8
lea ecx, [esi + 0x30]
push edi
push 0x12f
push str.Open
push 1
call fcn.00501b30
lea ebx, [esi + 0x38]
lea ecx, [esi + 0x6c]
push 0x589980
push str.Cannot_open_
call fcn.004fc970
lea edi, [esi + 0x18]
push edi
call fcn.00542340
add esp, 4
mov ecx, ebx
push edi
call fcn.004fefd0
lea ecx, [eax + 0x34]
push 0x589997
push str._initialization_event
call fcn.004fc970
cmp byte [edi + 0xb], 0
jns 0x542a12
push dword [esi + 0x18]
call fcn.004cf0d6
add esp, 4
lea ecx, [esi + 0x30]
call fcn.00501b70
cmp byte [esi + 0x2f], 0
mov edi, dword [esi + 4]
jns 0x542a2e
push dword [esi + 0x24]
call fcn.004cf0d6
add esp, 4
mov ebx, dword [esi + 8]
jmp 0x54296e
mov dword [esi + 4], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esi + 0x24]
push eax
push edi
call fcn.00501dd0
add esp, 8
lea ebx, [esi + 0x30]
mov ecx, ebx
push edi
push 0x136
push str.Open
push 1
call fcn.00501b30
lea ecx, [esi + 0x6c]
push 0x5899b3
push str.Bad_handle_in_WaitableEvent
call fcn.004fc970
mov ecx, ebx
call fcn.00501b70
cmp byte [edi + 0xb], 0
jns 0x542a8d
push dword [esi + 0x24]
call fcn.004cf0d6
add esp, 4
mov edi, dword [esi + 0xc]
mov ecx, edi
call fcn.004c1b60
push edi
call fcn.004cf0d6
add esp, 4
xor ebx, ebx
mov edi, dword [esi + 4]
jmp 0x54296e
call fcn.004bafe0
push dword [ebx]
call fcn.004c1b90
add esp, 4
jmp 0x5428f0
call fcn.004bafe0
mov eax, dword [esi + 4]
push dword [eax]
call fcn.004c1b90
mov ecx, dword [esi + 4]
add esp, 4
jmp 0x54293c
xor edi, edi
jmp 0x5427a2
mov dword [esi + 8], 0
jmp 0x542893