Function at 0x405388
Capabilities:
Check if file exists
Get common file path
Get file attributes
Set current directory

Disassembly:
push 0x230
push 0x4055a8
call fcn.00402688
mov ebx, edx
push 0x5c
pop eax
cmp word [ecx], ax
je 0x4158a0
call fcn.00402508
mov esi, eax
mov dword [ebp - 0x240], esi
test esi, esi
je 0x418e76
xor edi, edi
mov dword [ebp - 4], edi
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x4053c4
sub ecx, edx
sar ecx, 1
lea eax, [esi + ecx*2]
mov dword [ebp - 0x23c], eax
cmp eax, esi
jbe 0x4053eb
cmp word [eax - 2], 0x20
je 0x4157e2
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x234]
push eax
push 0x104
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetCurrentDirectoryW]
push dword [ebp - 0x234]
call dword [sym.imp.msvcrt.dll_towupper]
mov word [ebp - 0x236], ax
push 0x3d
pop eax
mov word [ebp - 0x28], ax
movzx ecx, word [esi]
push ecx
call dword [sym.imp.msvcrt.dll_iswalpha]
pop ecx
pop ecx
push 0x3a
pop edi
test eax, eax
je 0x4157d6
cmp word [esi + 2], di
jne 0x4157d6
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov word [ebp - 0x26], ax
mov word [ebp - 0x24], di
xor eax, eax
mov word [ebp - 0x22], ax
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x234]
push eax
push 0x104
push esi
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFullPathNameW]
test eax, eax
je 0x4157ea
cmp eax, 0x104
ja 0x418eb2
cmp word [ebp - 0x234], 0
je 0x418e7a
cmp word [ebp - 0x232], di
jne 0x418e7a
lea ecx, [ebp - 0x234]
lea edx, [ecx + 2]
xor edi, edi
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x4054a9
sub ecx, edx
sar ecx, 1
lea eax, [ebp - 0x234]
lea eax, [eax + ecx*2]
push 0x5c
pop edx
mov dword [ebp - 0x23c], eax
lea ecx, [ebp - 0x22e]
cmp eax, ecx
jbe 0x4054de
cmp word [eax - 2], dx
je 0x4096a2
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x234]
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x418ecf
xor edi, edi
cmp byte [0x426004], 0
je 0x40551d
push edi
mov edx, 0x104
lea ecx, [ebp - 0x234]
call fcn.004051dc
test eax, eax
je 0x418eb2
cmp ebx, 2
je 0x405543
lea eax, [ebp - 0x234]
push eax
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x418f0c
test eax, 0x410
je 0x418f22
test ebx, ebx
je 0x405559
cmp ebx, 1
jne 0x40556e
mov ax, word [ebp - 0x236]
cmp ax, word [ebp - 0x26]
jne 0x40556e
lea eax, [ebp - 0x234]
push eax
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetCurrentDirectoryW]
test eax, eax
je 0x4157ea
lea edx, [ebp - 0x234]
lea ecx, [ebp - 0x28]
call fcn.004025a3
test eax, eax
jne 0x418e63
push edi
mov edx, 0x104
mov ecx, 0x4269e0
call fcn.00405193
mov dword [ebp - 4], 0xfffffffe
call fcn.004055c9
xor eax, eax
call fcn.004026d0
ret
add eax, 0xfffffffe
jmp 0x4054c4
mov ax, word [ebp - 0x236]
jmp 0x405448
add eax, 0xfffffffe
jmp 0x4053d6
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
jmp 0x4167fb
cmp word [ecx + 2], ax
jne 0x4053a5
jmp 0x418e59
mov esi, eax
jmp 0x418e98
mov eax, 0x400023c9
jmp 0x4055a2
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
push 8
jmp 0x418e8f
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
push 3
pop eax
jmp 0x4055a2
push 3
pop esi
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, esi
jmp 0x4055a2
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0xce
jmp 0x4055a2
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov edi, eax
cmp edi, 2
je 0x4054f9
cmp edi, 3
je 0x4054f9
cmp edi, 0x7b
je 0x4054f9
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, edi
jmp 0x4055a2
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov esi, eax
cmp esi, 2
je 0x418e95
jmp 0x418e98
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x4261d4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0x10b
jmp 0x4055a2