Function at 0x501b30
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ab7b6
mov eax, dword fs:[0]
push eax
mov eax, 0x1818
call fcn.0056e430
mov eax, dword [0x608554]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1818], ecx
lea ecx, [ebp - 0x1814]
xor edi, edi
call fcn.0046a2f0
push 0x800
lea eax, [ebp - 0x1010]
mov dword [ebp - 4], edi
push edi
push eax
call fcn.00571c00
push 0x800
lea eax, [ebp - 0x810]
push edi
push eax
call fcn.00571c00
mov ecx, dword [0x6184f0]
lea eax, [ebp - 0x810]
add esp, 0x18
mov ecx, dword [ecx + 0x1c]
push eax
push str.TEMPPATH
call fcn.004f65f0
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push str.PMON
call ebx
push 0x5c692c
mov esi, eax
call ebx
push 0x5c692c
add esi, eax
call ebx
add esi, eax
lea eax, [ebp - 0x810]
push eax
call ebx
add eax, esi
mov esi, dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
cmp eax, 0x400
jae 0x501c68
lea eax, [ebp - 0x810]
push eax
call esi
push str.PMON
lea eax, [ebp - 0x810]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x810]
push eax
call esi
lea eax, [ebp - 0x810]
push eax
call ebx
cmp eax, 0x400
jae 0x501c68
push 0x400
lea eax, [ebp - 0x810]
push eax
lea eax, [ebp - 0x1010]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
test eax, eax
je 0x501c68
lea eax, [ebp - 0x1010]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x501c68
lea eax, [ebp - 0x1010]
push eax
lea ecx, [ebp - 0x1814]
call fcn.0046fb70
jmp 0x501c77
mov dword [0x6183ec], 9
mov edi, 0x80010009
push 0x800
lea eax, [ebp - 0x1810]
push 0
push eax
call fcn.00571c00
add esp, 0xc
test edi, edi
jne 0x501dd6
push 0x800
lea eax, [ebp - 0x810]
push edi
push eax
call fcn.00571c00
mov ecx, dword [0x6184f0]
lea eax, [ebp - 0x810]
add esp, 0xc
mov ecx, dword [ecx + 0x1c]
push eax
push str.SOURCEDIR
call fcn.004f65f0
push str.PMON
call ebx
push 0x5c692c
mov esi, eax
call ebx
push 0x5c692c
add esi, eax
call ebx
add esi, eax
lea eax, [ebp - 0x810]
push eax
call ebx
add eax, esi
cmp eax, 0x400
jae 0x501dc7
mov esi, dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x810]
push eax
call esi
push str.PMON
lea eax, [ebp - 0x810]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x810]
push eax
call esi
lea eax, [ebp - 0x810]
push eax
call ebx
cmp eax, 0x400
jae 0x501dc7
push 0x400
lea eax, [ebp - 0x810]
push eax
lea eax, [ebp - 0x1810]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
test eax, eax
je 0x501dc7
mov dword [ebp - 0x1824], edi
mov dword [ebp - 0x1820], edi
mov dword [ebp - 0x181c], edi
mov esi, dword [ebp - 0x1818]
lea eax, [ebp - 0x1824]
push eax
mov byte [ebp - 4], 1
lea ecx, [esi + 0xc]
call fcn.00500400
test eax, eax
je 0x501dab
push edi
lea eax, [ebp - 0x1824]
mov ecx, esi
push eax
lea eax, [ebp - 0x1810]
push eax
lea eax, [ebp - 0x1010]
push eax
call fcn.00502930
lea ecx, [ebp - 0x1824]
mov edi, eax
call fcn.00409b00
jmp 0x501dd6
lea ecx, [ebp - 0x1824]
mov dword [0x6183ec], 2
mov edi, 0x80010002
call fcn.00409b00
jmp 0x501dd6
mov edi, 0x80010009
mov dword [0x6183ec], 9
lea ecx, [ebp - 0x1814]
call fcn.0046a3c0
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0056d977
mov esp, ebp
pop ebp
ret