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

Disassembly:
push ebx
push esi
push edi
add esp, 0xfffff9c8
mov byte [esp], dl
mov ebx, eax
cmp word [ebx], 0x5c
jne 0x42001d
cmp word [ebx + 2], 0x5c
jne 0x42001d
mov eax, 0x23bd
jmp 0x4202f4
lea eax, [esp + 0x426]
push eax
push 0x104
call sub.kernel32.dll_GetCurrentDirectoryW
movzx edx, word [esp + 0x426]
mov eax, edx
add edx, 0xffffff9f
sub dx, 0x1a
jae 0x42004e
movzx eax, word [esp + 0x426]
and ax, 0xffdf
mov edi, eax
mov word [esp + 2], 0x3d
mov eax, 0x420300
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
movzx esi, word [ebx]
mov edx, esi
cmp dx, 0xff
ja 0x420076
movzx edx, dx
bt dword [eax], edx
setb al
test al, al
je 0x420087
cmp word [ebx + 2], 0x3a
sete al
jmp 0x420089
xor eax, eax
test al, al
je 0x4200aa
mov eax, esi
mov edx, esi
add edx, 0xffffff9f
sub dx, 0x1a
jae 0x4200a0
mov eax, esi
and ax, 0xffdf
mov word [esp + 4], ax
add ebx, 4
jmp 0x4200af
mov word [esp + 4], di
mov word [esp + 6], 0x3a
mov word [esp + 8], 0
mov eax, ebx
call fcn.0040685c
mov esi, eax
cmp word [ebx], 0x5c
jne 0x420120
add esi, 2
mov dword [esp + 0x630], esi
xor eax, eax
mov dword [esp + 0x634], eax
fild qword [esp + 0x630]
fcomp dword [0x420320]
wait
fnstsw ax
sahf
jbe 0x4200fc
mov eax, 0xce
jmp 0x4202f4
movzx eax, word [esp + 4]
mov word [esp + 0x14], ax
movzx eax, word [esp + 6]
mov word [esp + 0x16], ax
lea eax, [esp + 0x18]
mov edx, ebx
call fcn.004179e4
jmp 0x4201db
lea eax, [esp + 2]
call fcn.0041e0ac
mov dword [esp + 0xc], eax
cmp dword [esp + 0xc], 0
je 0x420143
lea eax, [esp + 0x14]
mov edx, dword [esp + 0xc]
call fcn.004179e4
jmp 0x42015e
movzx eax, word [esp + 4]
mov word [esp + 0x14], ax
movzx eax, word [esp + 6]
mov word [esp + 0x16], ax
mov word [esp + 0x18], 0
lea eax, [esp + 0x14]
call fcn.0040685c
lea edx, [esp + 0x14]
add eax, eax
add edx, eax
mov dword [esp + 0xc], edx
mov eax, dword [esp + 0xc]
mov word [eax], 0x5c
add dword [esp + 0xc], 2
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x10]
pop edx
sub eax, edx
sar eax, 1
jns 0x420194
adc eax, 0
cdq
push edx
push eax
mov eax, esi
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
mov dword [esp + 0x630], eax
mov dword [esp + 0x634], edx
fild qword [esp + 0x630]
fcomp dword [0x420320]
wait
fnstsw ax
sahf
jbe 0x4201d0
mov eax, 0xce
jmp 0x4202f4
mov edx, ebx
mov eax, dword [esp + 0xc]
call fcn.004179e4
mov word [esp + 0x62e], 0
lea eax, [esp + 0xc]
push eax
lea eax, [esp + 0x42a]
push eax
push 0x104
lea eax, [esp + 0x20]
push eax
call sub.kernel32.dll_GetFullPathNameW
test eax, eax
jne 0x42020f
mov eax, 5
jmp 0x4202f4
cmp dword [esp + 0xc], 0
jne 0x420231
lea eax, [esp + 0x426]
call fcn.0040685c
lea edx, [esp + 0x426]
add eax, eax
add edx, eax
mov dword [esp + 0xc], edx
mov eax, dword [esp + 0xc]
cmp word [eax], 0
jne 0x420261
lea eax, [esp + 0x42c]
cmp eax, dword [esp + 0xc]
jae 0x420261
mov eax, dword [esp + 0xc]
cmp word [eax - 2], 0x5c
jne 0x420261
sub dword [esp + 0xc], 2
mov eax, dword [esp + 0xc]
mov word [eax], 0
mov eax, dword [0x432b04]
cmp byte [eax], 0
je 0x420279
lea eax, [esp + 0x426]
xor edx, edx
call fcn.0041fed8
cmp byte [esp], 0
je 0x4202cb
lea eax, [esp + 0x426]
push eax
call sub.kernel32.dll_GetFileAttributesW
cmp eax, 0xffffffff
je 0x420298
test eax, 0x410
jne 0x4202b3
inc eax
jne 0x4202ac
call sub.kernel32.dll_GetLastError_2
cmp eax, 2
jne 0x4202f4
mov eax, 3
jmp 0x4202f4
mov eax, 0x10b
jmp 0x4202f4
lea eax, [esp + 0x426]
push eax
call sub.kernel32.dll_SetCurrentDirectoryW
test eax, eax
jne 0x4202cb
call sub.kernel32.dll_GetLastError_2
jmp 0x4202f4
lea edx, [esp + 0x426]
lea eax, [esp + 2]
call fcn.0041e334
test eax, eax
je 0x4202e6
mov eax, 8
jmp 0x4202f4
mov eax, dword [0x432e10]
xor edx, edx
call fcn.0041fe3c
xor eax, eax
add esp, 0x638
pop edi
pop esi
pop ebx
ret