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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x62c
mov eax, dword [0x4ad33b78]
push esi
mov esi, dword [ebp + 8]
mov cx, word [esi]
mov dword [ebp - 4], eax
mov ax, word [0x4ad33b8c]
cmp cx, ax
je 0x4ad174e9
cmp cx, 0x2e
je 0x4ad174fd
push edi
lea eax, [ebp - 0x214]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push dword [ebp - 0x214]
mov edi, dword [sym.imp.msvcrt.dll_towupper]
call edi
mov word [ebp - 0xc], 0x3d
mov dword [ebp - 0x62c], eax
xor eax, eax
mov ax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_iswalpha]
test eax, eax
pop ecx
pop ecx
je 0x4ad0b435
cmp word [esi + 2], 0x3a
jne 0x4ad0b435
xor eax, eax
mov ax, word [esi]
push eax
call edi
pop ecx
add esi, 4
push ebx
xor ebx, ebx
cmp esi, ebx
mov word [ebp - 0xa], ax
mov word [ebp - 8], 0x3a
mov word [ebp - 6], bx
je 0x4ad0425b
push esi
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
mov ebx, eax
mov ax, word [esi]
cmp ax, word [0x4ad33b8c]
jne 0x4ad0b44f
add ebx, 2
cmp ebx, 0x208
ja 0x4ad17530
mov ax, word [ebp - 0xa]
mov word [ebp - 0x624], ax
mov ax, word [ebp - 8]
mov word [ebp - 0x622], ax
lea eax, [ebp - 0x620]
push esi
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
xor ebx, ebx
pop ecx
pop ecx
lea eax, [ebp - 0x628]
push eax
lea eax, [ebp - 0x214]
push eax
push 0x103
lea eax, [ebp - 0x624]
push eax
mov word [ebp - 0xe], bx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
je 0x4ad1756d
mov eax, dword [ebp - 0x628]
cmp eax, ebx
je 0x4ad0f6a5
cmp word [eax], bx
je 0x4ad0f6c5
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea eax, [ebp - 0x214]
push eax
call esi
cmp eax, 0xffffffff
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
je 0x4ad17575
cmp byte [0x4ad2fa64], 0
je 0x4ad04321
push ebx
lea eax, [ebp - 0x214]
push eax
call fcn.4ad04479
test eax, eax
je 0x4ad17530
cmp dword [ebp + 0xc], 2
je 0x4ad04343
lea eax, [ebp - 0x214]
push eax
call esi
cmp eax, 0xffffffff
je 0x4ad17598
test ax, 0x410
je 0x4ad1758e
cmp dword [ebp + 0xc], ebx
je 0x4ad0435b
cmp dword [ebp + 0xc], 1
jne 0x4ad04370
mov ax, word [ebp - 0x62c]
cmp ax, word [ebp - 0xa]
jne 0x4ad04370
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
je 0x4ad175a7
push 0x4ad2b0d0
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0xc]
push eax
call fcn.4ad01594
test eax, eax
jne 0x4ad175ae
push ebx
push 0x4ad34400
call fcn.4ad01555
xor eax, eax
pop ebx
pop edi
mov ecx, dword [ebp - 4]
pop esi
call fcn.4ad01305
leave
ret 8
mov ax, word [ebp - 0x62c]
jmp 0x4ad0423c
cmp eax, 0x7b
jne 0x4ad0439a
jmp 0x4ad04303
lea eax, [ebp - 0xc]
push eax
call fcn.4ad01b84
test eax, eax
mov edi, dword [sym.imp.msvcrt.dll_wcscpy]
mov dword [ebp - 0x628], eax
je 0x4ad1753a
push eax
lea eax, [ebp - 0x624]
push eax
call edi
pop ecx
pop ecx
lea eax, [ebp - 0x624]
push eax
call fcn.4ad01a8d
mov cx, word [0x4ad33b8c]
mov dword [ebp - 0x628], eax
mov dx, word [eax]
test dx, dx
je 0x4ad1755d
cmp dx, cx
je 0x4ad0b4b5
mov word [eax + 2], cx
mov eax, dword [ebp - 0x628]
add eax, 4
mov dword [ebp - 0x628], eax
mov ecx, eax
lea edx, [ebp - 0x624]
sub ecx, edx
sar ecx, 1
add ecx, ebx
cmp ecx, 0x208
ja 0x4ad17530
xor ebx, ebx
cmp eax, ebx
je 0x4ad042a2
push esi
push eax
call edi
jmp 0x4ad042a0
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.msvcrt.dll_wcslen]
lea eax, [ebp + eax*2 - 0x214]
pop ecx
mov dword [ebp - 0x628], eax
jmp 0x4ad042dc
lea ecx, [ebp - 0x20e]
cmp eax, ecx
jbe 0x4ad042e5
add eax, 0xfffffffe
mov cx, word [eax]
cmp cx, word [0x4ad33b8c]
jne 0x4ad042e5
mov dword [ebp - 0x628], eax
mov word [eax], bx
jmp 0x4ad042e5
cmp word [esi + 2], ax
jne 0x4ad041d8
mov eax, 0x23c9
jmp 0x4ad0439c
cmp word [esi + 2], cx
jne 0x4ad041e2
push esi
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
push 2
pop ecx
cmp eax, ecx
jbe 0x4ad17526
cmp word [esi + ecx*2], 0x20
jne 0x4ad041e2
inc ecx
cmp ecx, eax
jb 0x4ad17516
and word [esi + 4], 0
jmp 0x4ad041e2
mov eax, 0xce
jmp 0x4ad0439a
mov ax, word [ebp - 0xa]
and word [ebp - 0x620], 0
mov word [ebp - 0x624], ax
mov ax, word [ebp - 8]
mov word [ebp - 0x622], ax
jmp 0x4ad0b478
mov word [eax], cx
mov eax, dword [ebp - 0x628]
inc eax
inc eax
jmp 0x4ad0b4af
push 5
pop eax
jmp 0x4ad0439a
call edi
cmp eax, 2
je 0x4ad04303
cmp eax, 3
je 0x4ad04303
jmp 0x4ad0b441
mov eax, 0x10b
jmp 0x4ad0439a
call edi
cmp eax, 2
jne 0x4ad0439a
push 3
jmp 0x4ad1756f
call edi
jmp 0x4ad0439a
push 8
jmp 0x4ad1756f