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

Disassembly:
push 0x240
push 0x42c9b0
call fcn.00417d90
mov dword [ebp - 0x24c], edx
mov esi, ecx
push 0x5c
pop eax
cmp word [esi], ax
je 0x41b5d4
lea ecx, [ebp - 0x244]
call fcn.00415a2e
xor eax, eax
cmp byte [ebp - 0x38], al
sete al
dec eax
and eax, 0x7ee3
add eax, 0x104
push eax
lea ecx, [ebp - 0x244]
call fcn.0040e3f0
test eax, eax
js 0x41b774
mov ecx, esi
call fcn.0040acb0
mov edi, eax
mov dword [ebp - 0x250], edi
test edi, edi
je 0x41b774
xor ebx, ebx
mov dword [ebp - 4], ebx
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x408c3d
sub ecx, edx
sar ecx, 1
lea eax, [edi + ecx*2]
mov ecx, eax
mov dword [ebp - 0x248], eax
cmp ecx, edi
jbe 0x408c66
cmp word [eax - 2], 0x20
je 0x41b5e8
xor ecx, ecx
mov word [eax], cx
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b5f0
push eax
push dword [ebp - 0x34]
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetCurrentDirectoryW]
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b5fb
movzx eax, word [eax]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov bx, ax
push 0x3d
pop eax
mov word [ebp - 0x28], ax
movzx ecx, word [edi]
push ecx
call dword [sym.imp.msvcrt.dll_iswalpha]
pop ecx
push 0x3a
pop esi
test eax, eax
je 0x41b606
cmp word [edi + 2], si
jne 0x41b606
movzx eax, word [edi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov word [ebp - 0x26], ax
mov word [ebp - 0x24], si
xor eax, eax
mov word [ebp - 0x22], ax
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b60f
lea ecx, [ebp - 0x248]
push ecx
push eax
push dword [ebp - 0x34]
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFullPathNameW]
test eax, eax
je 0x41b61a
cmp eax, dword [ebp - 0x34]
ja 0x41b64c
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
mov eax, ecx
je 0x41b674
xor edx, edx
cmp word [eax], dx
je 0x41b747
test ecx, ecx
mov eax, ecx
je 0x41b67f
cmp word [eax + 2], si
jne 0x41b747
test ecx, ecx
mov edx, ecx
je 0x41b68a
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 4]
jne 0x408d40
sub edx, esi
sar edx, 1
test ecx, ecx
je 0x41b695
lea edx, [ecx + edx*2]
mov esi, edx
mov dword [ebp - 0x248], edx
lea ecx, [ebp - 0x244]
call fcn.00417d82
add eax, 6
cmp esi, eax
jbe 0x408d82
push 0x5c
pop eax
cmp word [edx - 2], ax
je 0x408e77
xor eax, eax
mov word [edx], ax
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b6a0
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41b6ab
cmp byte [0x436755], 0
je 0x408dc9
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
je 0x41b6d3
xor eax, eax
push eax
mov edx, dword [ebp - 0x34]
call fcn.00410207
test eax, eax
je 0x41b64c
mov esi, dword [ebp - 0x24c]
cmp esi, 2
je 0x408dfa
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b6de
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41b6e9
test eax, 0x410
je 0x41b6ff
test esi, esi
je 0x408e09
cmp esi, 1
jne 0x408e1f
cmp bx, word [ebp - 0x26]
jne 0x408e1f
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x408e87
push eax
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetCurrentDirectoryW]
test eax, eax
je 0x41b61a
mov edx, dword [ebp - 0x3c]
test edx, edx
je 0x408e8f
lea ecx, [ebp - 0x28]
call fcn.0040a976
test eax, eax
jne 0x41b727
mov ecx, dword [0x448df8]
test ecx, ecx
je 0x408e97
xor eax, eax
push eax
mov edx, dword [0x448e00]
call fcn.00408e9e
mov dword [ebp - 4], 0xfffffffe
call fcn.00408e7f
lea ecx, [ebp - 0x244]
call fcn.004161e6
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret
lea edx, [esi - 2]
jmp 0x408d5b
lea eax, [ebp - 0x244]
jmp 0x408e10
lea edx, [ebp - 0x244]
jmp 0x408e26
mov ecx, 0x448bf0
jmp 0x408e40
cmp word [esi + 2], ax
jne 0x408bea
mov eax, 0x400023c9
jmp 0x408e67
lea eax, [ecx - 2]
jmp 0x408c4f
lea eax, [ebp - 0x244]
jmp 0x408c76
lea eax, [ebp - 0x244]
jmp 0x408c8b
mov word [ebp - 0x26], bx
jmp 0x408ccf
lea eax, [ebp - 0x244]
jmp 0x408ce4
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov esi, eax
jmp 0x41b627
push 3
pop esi
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42e0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, esi
jmp 0x408e67
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42e0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0xce
jmp 0x408e67
lea eax, [ebp - 0x244]
jmp 0x408d14
lea eax, [ebp - 0x244]
jmp 0x408d29
lea edx, [ebp - 0x244]
jmp 0x408d3d
lea ecx, [ebp - 0x244]
jmp 0x408d58
lea eax, [ebp - 0x244]
jmp 0x408d92
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov esi, eax
cmp esi, 2
je 0x408da2
cmp esi, 3
je 0x408da2
cmp esi, 0x7b
jne 0x41b627
jmp 0x408da2
lea ecx, [ebp - 0x244]
jmp 0x408db6
lea eax, [ebp - 0x244]
jmp 0x408ddf
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov esi, eax
cmp esi, 2
jne 0x41b627
jmp 0x41b624
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42e0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0x10b
jmp 0x408e67
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42e0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
jmp 0x41b77f
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42e0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
push 3
jmp 0x41b781
lea ecx, [ebp - 0x244]
call fcn.004161e6
push 8
pop eax
jmp 0x408e67