Function at 0x405310
Capabilities:
Check if file exists

Disassembly:
sub esp, 0x814
mov eax, dword [0x44dc1c]
xor eax, esp
mov dword [esp + 0x80c], eax
push esi
push edi
push 0x800
lea eax, [esp + 0x14]
push 0
push eax
mov esi, ecx
call fcn.004260b0
add esp, 0xc
test esi, esi
je 0x4053ca
mov eax, esi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405350
sub eax, edx
sar eax, 1
je 0x4053ca
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4053ca
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
je 0x4053ca
push 0x3ff
push esi
lea ecx, [esp + 0x18]
push 0x400
push ecx
call fcn.0042400b
lea eax, [esp + 0x20]
add esp, 0x10
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405396
sub eax, edx
sar eax, 1
cmp word [esp + eax*2 + 0xe], 0x5c
jne 0x4053f4
lea eax, [esp + 0x10]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4053b4
sub eax, edx
sar eax, 1
mov word [esp + eax*2 + 0xe], cx
jmp 0x4053f4
push 0x400
lea edx, [esp + 0x14]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x10]
push 0x5c
push eax
call fcn.00424764
add esp, 8
test eax, eax
je 0x4053f4
mov word [eax], 0
lea eax, [esp + 0x10]
lea edx, [eax + 2]
jmp 0x405400
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405400
sub eax, edx
sar eax, 1
je 0x405435
lea ecx, [esp + 0x10]
call fcn.00406710
test al, al
jne 0x40544e
lea ecx, [esp + 0x10]
push ecx
push str.find_manual_source_path_under___s__fail__
mov ecx, 0x45a600
call fcn.00412540
add esp, 8
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x80c]
xor ecx, esp
call fcn.0042397a
add esp, 0x814
ret
call fcn.004061e0
call fcn.00406a80
mov esi, 0x45a5f4
call fcn.00404a40
mov esi, dword [0x45a5dc]
test esi, esi
je 0x405435
mov ecx, dword [0x45a5e0]
mov edx, ecx
sub edx, esi
mov eax, 0x71493cd9
imul edx
sar edx, 0xb
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x405435
cmp word [0x45a5f8], 9
jne 0x4054fd
cmp esi, ecx
jbe 0x4054a2
call fcn.0042449d
mov ecx, dword [0x45a5e0]
cmp dword [0x45a5dc], ecx
mov edi, ecx
jbe 0x4054b7
call fcn.0042449d
mov ecx, dword [0x45a5e0]
cmp esi, edi
je 0x4054f7
cmp esi, ecx
jb 0x4054c4
call fcn.0042449d
movzx eax, word [0x45a5f6]
mov ecx, esi
call fcn.00404b50
test al, al
jne 0x4055cf
mov ecx, dword [0x45a5e0]
cmp esi, ecx
jb 0x4054ef
call fcn.0042449d
mov ecx, dword [0x45a5e0]
add esi, 0x1214
jmp 0x4054a2
mov esi, dword [0x45a5dc]
cmp esi, ecx
jbe 0x405510
call fcn.0042449d
mov ecx, dword [0x45a5e0]
lea esp, [esp]
cmp dword [0x45a5dc], ecx
mov edi, ecx
jbe 0x405525
call fcn.0042449d
mov ecx, dword [0x45a5e0]
cmp esi, edi
je 0x405565
cmp esi, ecx
jb 0x405532
call fcn.0042449d
movzx eax, word [0x45a5f8]
mov ecx, esi
call fcn.00404b50
test al, al
jne 0x4055cf
mov ecx, dword [0x45a5e0]
cmp esi, ecx
jb 0x40555d
call fcn.0042449d
mov ecx, dword [0x45a5e0]
add esi, 0x1214
jmp 0x405510
mov esi, dword [0x45a5dc]
cmp esi, ecx
jbe 0x405580
call fcn.0042449d
mov ecx, dword [0x45a5e0]
lea ebx, [ebx]
cmp dword [0x45a5dc], ecx
mov edi, ecx
jbe 0x405595
call fcn.0042449d
mov ecx, dword [0x45a5e0]
cmp esi, edi
je 0x4055cf
cmp esi, ecx
jb 0x4055a2
call fcn.0042449d
mov eax, 9
mov ecx, esi
call fcn.00404b50
test al, al
jne 0x4055cf
mov ecx, dword [0x45a5e0]
cmp esi, ecx
jb 0x4055c7
call fcn.0042449d
mov ecx, dword [0x45a5e0]
add esi, 0x1214
jmp 0x405580
mov ecx, dword [esp + 0x814]
pop edi
pop esi
xor ecx, esp
mov al, 1
call fcn.0042397a
add esp, 0x814
ret