Function at 0x5009ec
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp + 8]
repne scasb al, byte es:[edi]
mov esi, ecx
not esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], 8
mov dword [esp], 0xfde9
call sub.KERNEL32.dll_MultiByteToWideChar
sub esp, 0x18
mov edx, eax
test eax, eax
jle 0x500b2c
mov ecx, 8
lea eax, [edx + edx + 0x1e]
and eax, 0xfffffff0
call fcn.00596604
lea ebx, [esp + 0x27]
and ebx, 0xfffffff0
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], esi
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], 0xfde9
call sub.KERNEL32.dll_MultiByteToWideChar
sub esp, 0x18
test eax, eax
jne 0x500b6c
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 0x10], 0xa9
mov dword [esp + 0xc], 0x6934cc
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], 2
call fcn.004f2144
mov dword [esp + 0x14], 0x6934e2
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x6934e5
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], str.fopen_
mov dword [esp], 5
call fcn.004f22a0
call sub.msvcrt.dll__errno
cmp dword [eax], 2
je 0x500c5c
mov dword [esp + 0x10], 0xae
mov dword [esp + 0xc], 0x6934cc
mov dword [esp + 8], 2
mov dword [esp + 4], 0x6d
mov dword [esp], 0x20
call fcn.004f2144
xor ebx, ebx
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
leave
ret
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x3ec
je 0x500c18
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x459
jne 0x500a87
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov esi, eax
test eax, eax
jne 0x500bc9
jmp 0x500a87
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp + 0xc]
repne scasb al, byte es:[edi]
not ecx
mov dword [esp + 0x14], 8
lea esi, [ebp - 0x28]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ecx
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call sub.KERNEL32.dll_MultiByteToWideChar
sub esp, 0x18
test eax, eax
je 0x500a87
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.msvcrt.dll__wfopen
mov esi, eax
test eax, eax
je 0x500c9d
mov dword [esp], 0x5f53a0
call fcn.004e91b0
mov ebx, eax
test eax, eax
je 0x500c90
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.004e930c
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x6a
mov dword [esp], ebx
call fcn.004e9844
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
leave
ret
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call sub.KERNEL32.dll_MultiByteToWideChar
sub esp, 0x18
mov edx, eax
test eax, eax
jle 0x500b3c
xor ecx, ecx
jmp 0x500a46
mov dword [esp + 0x10], 0xac
mov dword [esp + 0xc], 0x6934cc
mov dword [esp + 8], pe_nt_image_headers32
mov dword [esp + 4], 0x6d
mov dword [esp], 0x20
call fcn.004f2144
xor ebx, ebx
jmp 0x500b22
mov dword [esp], esi
call fcn.0059fc68
jmp 0x500b22
call sub.msvcrt.dll__errno
cmp dword [eax], 2
je 0x500b4c
call sub.msvcrt.dll__errno
cmp dword [eax], 9
jne 0x500a87
jmp 0x500b4c