Function at 0x4051b0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4086a8
push 0x40439e
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x1c
push ebx
push esi
push edi
mov edi, edx
mov esi, ecx
mov dword [ebp - 0x28], esi
xor ebx, ebx
mov dword [ebp - 0x20], ebx
cmp dword [0x40ae20], ebx
jne 0x4051f9
call dword [sym.imp.rtapi_w32.dll_RtIsInRtss]
neg eax
sbb eax, eax
add eax, 2
mov dword [0x40ae20], eax
cmp dword [0x40a1d4], 0xffffffff
jne 0x40520d
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x40a1d4], eax
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [esi + 0xc]
push ecx
call dword [sym.imp.rtapi_w32.dll_RtWaitForSingleObject]
mov dword [ebp - 0x1c], eax
cmp eax, 0x102
ja 0x4053bd
je 0x4053b3
cmp eax, ebx
je 0x40524e
cmp eax, 0x80
jne 0x4053c2
mov edi, 0x10000022
mov dword [ebp - 0x20], edi
jmp 0x40541f
mov dword [ebp - 4], 1
mov edx, dword [esi + 0x1c]
mov dword [edx + 8], 2
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 8]
mov dword [eax + 0xc], ecx
push 8
mov edx, edi
mov ecx, dword [esi + 0x1c]
add ecx, 0x20
call fcn.00405fd0
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, ebx
jne 0x40533f
mov edx, dword [ebp + 8]
cmp edx, ebx
je 0x4052af
mov ebx, dword [ebp + 0xc]
push ebx
mov ecx, dword [esi + 0x1c]
add ecx, 0x2c
call fcn.00405fd0
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
jne 0x40533f
mov edx, dword [esi + 0x1c]
mov dword [edx + 0x28], ebx
jmp 0x4052b5
mov eax, dword [esi + 0x1c]
mov dword [eax + 0x28], ebx
mov ecx, dword [esi + 0x1c]
mov dword [ecx + 8], 3
push 0
push 1
mov edx, dword [esi + 0x18]
push edx
call dword [sym.imp.rtapi_w32.dll_RtReleaseSemaphore]
mov dword [ebp - 0x24], eax
cmp eax, 1
je 0x405330
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov dword [ebp - 0x20], edi
cmp dword [0x40ae20], 2
push edi
jne 0x40530d
mov eax, dword [esi + 0x18]
push eax
push esi
push str.__MM____SendComResCommand_pComResHandle:_p_:_RtReleaseSemaphore_hSendSemaphore:0x_08X__Error._0x_08X_n
call fcn.00403a90
add esp, 0x10
mov dword [ebp - 4], 0
call fcn.00405356
jmp 0x40541f
mov ecx, dword [esi + 0x18]
push ecx
push esi
push str.__MC____SendComResCommand_pComResHandle:_p_:_RtReleaseSemaphore_hSendSemaphore:0x_08X__Error._0x_08X_n
call fcn.00403a90
add esp, 0x10
mov dword [ebp - 4], 0
call fcn.00405356
jmp 0x40541f
mov edx, dword [esi + 0x1c]
mov eax, dword [esi + 8]
mov dword [edx + 4], eax
mov eax, dword [esi + 0x1c]
inc dword [eax + 0x18]
mov dword [ebp - 4], 0
call fcn.00405356
jmp 0x40541f
mov edi, 0x10000021
mov dword [ebp - 0x20], edi
jmp 0x40541f
cmp eax, 0xffffffff
je 0x4053ec
mov edi, 0x10000023
mov dword [ebp - 0x20], edi
cmp dword [0x40ae20], 2
push edi
jne 0x4053e0
mov edx, dword [esi + 0xc]
push edx
push esi
push str.__MM____SendComResCommand_pComResHandle:_p_:_RtWaitForSingleObject_hResourceSemaphore:0x_08X__Unknown_Error._____0x_08X_n
jmp 0x405417
mov eax, dword [esi + 0xc]
push eax
push esi
push str.__MC____SendComResCommand_pComResHandle:_p_:_RtWaitForSingleObject_hResourceSemaphore:0x_08X__Unknown_Error._____0x_08X_n
jmp 0x405417
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov dword [ebp - 0x20], edi
cmp dword [0x40ae20], 2
push edi
jne 0x40540d
mov ecx, dword [esi + 0xc]
push ecx
push esi
push str.__MM____SendComResCommand_pComResHandle:_p_:_RtWaitForSingleObject_hResourceSemaphore:0x_08X__WAIT_FAILED._0x_08X_n
jmp 0x405417
mov edx, dword [esi + 0xc]
push edx
push esi
push str.__MC____SendComResCommand_pComResHandle:_p_:_RtWaitForSingleObject_hResourceSemaphore:0x_08X__WAIT_FAILED._0x_08X_n
call fcn.00403a90
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
call fcn.0040544f
test edi, edi
je 0x40545d
cmp edi, 0x10000021
je 0x40545d
cmp dword [0x40ae20], 2
push edi
push esi
jne 0x405450
push str.__MM____SendComResCommand_pComResHandle:_p_:_Error._0x_08X.
jmp 0x405455
push str.__MC____SendComResCommand_pComResHandle:_p_:_Error._0x_08X.
call fcn.00403a90
add esp, 0xc
mov eax, edi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc