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

Disassembly:
push ebx
push esi
push edi
add esp, 0xfffff9d4
mov ebx, eax
cmp word [ebx], 0x5c
jne 0x420346
cmp word [ebx + 2], 0x5c
jne 0x420346
mov eax, 0x23bd
jmp 0x420650
cmp word [ebx], 0x2e
jne 0x420390
cmp word [ebx + 2], 0x2e
jne 0x420390
xor esi, esi
test ebx, ebx
je 0x420362
mov eax, ebx
call fcn.0040685c
jmp 0x420364
xor eax, eax
mov edi, eax
mov eax, edi
dec eax
sub eax, 2
jl 0x420386
inc eax
mov edx, 2
cmp word [ebx + edx*2], 0x20
je 0x420382
mov esi, 1
jmp 0x420386
inc edx
dec eax
jne 0x420374
test esi, esi
jne 0x420390
mov word [ebx + 4], 0
lea eax, [esp + 0x422]
push eax
push 0x104
call sub.kernel32.dll_GetCurrentDirectoryW
movzx edx, word [esp + 0x422]
mov eax, edx
add edx, 0xffffff9f
sub dx, 0x1a
jae 0x4203c1
movzx eax, word [esp + 0x422]
and ax, 0xffdf
mov esi, eax
mov word [esp], 0x3d
mov eax, 0x42065c
mov dword [esp + 0xc], eax
mov edx, dword [esp + 0xc]
movzx eax, word [ebx]
mov ecx, eax
cmp cx, 0xff
ja 0x4203e8
movzx ecx, cx
bt dword [edx], ecx
setb dl
test dl, dl
je 0x4203f9
cmp word [ebx + 2], 0x3a
sete dl
jmp 0x4203fb
xor edx, edx
test dl, dl
je 0x42041d
mov edx, eax
mov ecx, eax
add ecx, 0xffffff9f
sub cx, 0x1a
jae 0x420413
mov edx, eax
and dx, 0xffdf
mov word [esp + 2], dx
add ebx, 4
jmp 0x420422
mov word [esp + 2], si
mov word [esp + 4], 0x3a
mov word [esp + 6], 0
test ebx, ebx
je 0x42043d
mov eax, ebx
call fcn.0040685c
jmp 0x42043f
xor eax, eax
mov edi, eax
cmp word [ebx], 0x5c
jne 0x420480
add edi, 2
cmp edi, 0x208
jbe 0x42045c
mov eax, 0xce
jmp 0x420650
movzx eax, word [esp + 2]
mov word [esp + 0x10], ax
movzx eax, word [esp + 4]
mov word [esp + 0x12], ax
lea eax, [esp + 0x14]
mov edx, ebx
call fcn.004179e4
jmp 0x420530
mov eax, esp
call fcn.0041e0ac
mov dword [esp + 8], eax
cmp dword [esp + 8], 0
je 0x4204a1
lea eax, [esp + 0x10]
mov edx, dword [esp + 8]
call fcn.004179e4
jmp 0x4204bc
movzx eax, word [esp + 2]
mov word [esp + 0x10], ax
movzx eax, word [esp + 4]
mov word [esp + 0x12], ax
mov word [esp + 0x14], 0
lea eax, [esp + 0x10]
test eax, eax
je 0x4204cb
call fcn.0040685c
jmp 0x4204cd
xor eax, eax
lea edx, [esp + 0x10]
add eax, eax
add edx, eax
mov dword [esp + 8], edx
mov eax, dword [esp + 8]
mov word [eax], 0x5c
add dword [esp + 8], 2
lea eax, [esp + 0x10]
push eax
mov eax, dword [esp + 0xc]
pop edx
sub eax, edx
sar eax, 1
jns 0x4204fa
adc eax, 0
cdq
push edx
push eax
mov eax, edi
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
cmp edx, 0
jne 0x420519
cmp eax, 0x208
jbe 0x420525
jmp 0x42051b
jle 0x420525
mov eax, 0xce
jmp 0x420650
mov edx, ebx
mov eax, dword [esp + 8]
call fcn.004179e4
mov word [esp + 0x628], 0
lea eax, [esp + 8]
push eax
lea eax, [esp + 0x426]
push eax
push 0x104
lea eax, [esp + 0x1c]
push eax
call sub.kernel32.dll_GetFullPathNameW
test eax, eax
jne 0x420564
mov eax, 5
jmp 0x420650
cmp dword [esp + 8], 0
jne 0x42058e
lea eax, [esp + 0x422]
test eax, eax
je 0x42057d
call fcn.0040685c
jmp 0x42057f
xor eax, eax
lea edx, [esp + 0x422]
add eax, eax
add edx, eax
mov dword [esp + 8], edx
mov eax, dword [esp + 8]
cmp word [eax], 0
jne 0x4205be
lea eax, [esp + 0x428]
cmp eax, dword [esp + 8]
jae 0x4205be
mov eax, dword [esp + 8]
cmp word [eax - 2], 0x5c
jne 0x4205be
sub dword [esp + 8], 2
mov eax, dword [esp + 8]
mov word [eax], 0
mov eax, dword [0x432b04]
cmp byte [eax], 0
je 0x4205d6
lea eax, [esp + 0x422]
xor edx, edx
call fcn.0041fed8
lea eax, [esp + 0x422]
push eax
call sub.kernel32.dll_GetFileAttributesW
cmp eax, 0xffffffff
je 0x4205ef
test eax, 0x410
jne 0x42060a
inc eax
jne 0x420603
call sub.kernel32.dll_GetLastError_2
cmp eax, 2
jne 0x420650
mov eax, 3
jmp 0x420650
mov eax, 0x10b
jmp 0x420650
cmp si, word [esp + 2]
jne 0x420629
lea eax, [esp + 0x422]
push eax
call sub.kernel32.dll_SetCurrentDirectoryW
test eax, eax
jne 0x420629
call sub.kernel32.dll_GetLastError_2
jmp 0x420650
lea edx, [esp + 0x422]
mov eax, esp
call fcn.0041e334
test eax, eax
je 0x420642
mov eax, 8
jmp 0x420650
mov eax, dword [0x432e10]
xor edx, edx
call fcn.0041fe3c
xor eax, eax
add esp, 0x62c
pop edi
pop esi
pop ebx
ret