Function at 0x501c4c
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 0x501d8c
mov ecx, 8
lea eax, [edx + edx + 0x1e]
and eax, 0xfffffff0
call fcn.00597854
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 0x501dcc
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 0x10], 0xa9
mov dword [esp + 0xc], 0x6afe0c
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], 2
call fcn.004f33a4
mov dword [esp + 0x14], 0x6afe22
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x6afe25
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], str.fopen_
mov dword [esp], 5
call fcn.004f3500
call sub.msvcrt.dll__errno
cmp dword [eax], 2
je 0x501ebc
mov dword [esp + 0x10], 0xae
mov dword [esp + 0xc], 0x6afe0c
mov dword [esp + 8], 2
mov dword [esp + 4], 0x6d
mov dword [esp], 0x20
call fcn.004f33a4
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 0x501e78
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x459
jne 0x501ce7
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 0x501e29
jmp 0x501ce7
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 0x501ce7
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.msvcrt.dll__wfopen
mov esi, eax
test eax, eax
je 0x501efd
mov dword [esp], 0x5f67a0
call fcn.004ea410
mov ebx, eax
test eax, eax
je 0x501ef0
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.004ea56c
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x6a
mov dword [esp], ebx
call fcn.004eaaa4
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 0x501d9c
xor ecx, ecx
jmp 0x501ca6
mov dword [esp + 0x10], 0xac
mov dword [esp + 0xc], 0x6afe0c
mov dword [esp + 8], 0x80
mov dword [esp + 4], 0x6d
mov dword [esp], 0x20
call fcn.004f33a4
xor ebx, ebx
jmp 0x501d82
mov dword [esp], esi
call fcn.005a0ec8
jmp 0x501d82
call sub.msvcrt.dll__errno
cmp dword [eax], 2
je 0x501dac
call sub.msvcrt.dll__errno
cmp dword [eax], 9
jne 0x501ce7
jmp 0x501dac