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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x624
mov ax, word [0x4ad1c744]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov cx, word [esi]
cmp cx, ax
jne 0x4ad151ed
cmp word [esi + 2], ax
jne 0x4ad151ed
mov eax, 0x23c9
jmp 0x4ad154f2
cmp cx, 0x2e
jne 0x4ad1522f
cmp word [esi + 2], cx
jne 0x4ad1522f
xor edi, edi
test esi, esi
je 0x4ad15209
push esi
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
jmp 0x4ad1520b
xor eax, eax
push 2
pop edx
cmp eax, edx
jbe 0x4ad15227
lea ecx, [esi + 4]
cmp word [ecx], 0x20
jne 0x4ad15224
inc edx
inc ecx
inc ecx
cmp edx, eax
jb 0x4ad15215
jmp 0x4ad15227
push 1
pop edi
test edi, edi
jne 0x4ad1522f
and word [esi + 4], di
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 dword [ebp - 0xc], eax
mov ax, word [esi]
pop ecx
mov word [ebp - 8], 0x3d
push eax
call dword [sym.imp.MSVCRT.dll_iswalpha]
test eax, eax
pop ecx
je 0x4ad1527f
cmp word [esi + 2], 0x3a
jne 0x4ad1527f
mov ax, word [esi]
push eax
call edi
pop ecx
mov word [ebp - 6], ax
add esi, 4
jmp 0x4ad15287
mov ax, word [ebp - 0xc]
mov word [ebp - 6], ax
xor ebx, ebx
mov word [ebp - 4], 0x3a
cmp esi, ebx
mov word [ebp - 2], bx
je 0x4ad152a1
push esi
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
mov ebx, eax
mov ax, word [esi]
cmp ax, word [0x4ad1c744]
jne 0x4ad152fb
add ebx, 2
cmp ebx, 0x208
ja 0x4ad15462
mov ax, word [ebp - 6]
mov word [ebp - 0x624], ax
mov ax, word [ebp - 4]
mov word [ebp - 0x622], ax
lea eax, [ebp - 0x620]
test eax, eax
je 0x4ad153a7
test esi, esi
je 0x4ad153a7
lea eax, [ebp - 0x620]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
jmp 0x4ad153a5
lea eax, [ebp - 8]
push eax
call fcn.4ad06377
mov edi, dword [sym.imp.MSVCRT.dll_wcscpy]
mov dword [ebp + 8], eax
test eax, eax
je 0x4ad15329
lea ecx, [ebp - 0x624]
test ecx, ecx
je 0x4ad15347
push eax
lea eax, [ebp - 0x624]
push eax
call edi
pop ecx
pop ecx
jmp 0x4ad15347
mov ax, word [ebp - 6]
and word [ebp - 0x620], 0
mov word [ebp - 0x624], ax
mov ax, word [ebp - 4]
mov word [ebp - 0x622], ax
lea eax, [ebp - 0x624]
test eax, eax
je 0x4ad15361
lea eax, [ebp - 0x624]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
jmp 0x4ad15363
xor eax, eax
mov cx, word [0x4ad1c744]
lea eax, [ebp + eax*2 - 0x624]
mov dword [ebp + 8], eax
mov word [eax], cx
add dword [ebp + 8], 2
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x624]
sub eax, ecx
sar eax, 1
add eax, ebx
cmp eax, 0x208
ja 0x4ad15462
cmp dword [ebp + 8], 0
je 0x4ad153a7
test esi, esi
je 0x4ad153a7
push esi
push dword [ebp + 8]
call edi
pop ecx
pop ecx
lea eax, [ebp + 8]
xor ebx, ebx
push eax
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x624]
push 0x103
push eax
mov word [ebp - 0xe], bx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
cmp eax, ebx
jne 0x4ad153d5
push 5
jmp 0x4ad154e2
mov eax, dword [ebp + 8]
cmp eax, ebx
jne 0x4ad153f4
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
lea eax, [ebp + eax*2 - 0x214]
pop ecx
mov dword [ebp + 8], eax
cmp word [eax], bx
jne 0x4ad15419
lea ecx, [ebp - 0x20e]
cmp eax, ecx
jbe 0x4ad15419
mov cx, word [eax - 2]
add eax, 0xfffffffe
cmp cx, word [0x4ad1c744]
jne 0x4ad15419
mov dword [ebp + 8], eax
mov word [eax], bx
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea eax, [ebp - 0x214]
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xffffffff
jne 0x4ad15448
call edi
cmp eax, 2
je 0x4ad15448
cmp eax, 3
je 0x4ad15448
cmp eax, 0x7b
jne 0x4ad154f2
cmp byte [0x4ad1cf7c], 0
je 0x4ad1546c
lea eax, [ebp - 0x214]
push ebx
push eax
call fcn.4ad15085
test eax, eax
jne 0x4ad1546c
mov eax, 0xce
jmp 0x4ad154f2
cmp dword [ebp + 0xc], 2
je 0x4ad1549d
lea eax, [ebp - 0x214]
push eax
call esi
cmp eax, 0xffffffff
je 0x4ad1548b
test ax, 0x410
jne 0x4ad1549d
cmp eax, 0xffffffff
jne 0x4ad15496
call edi
cmp eax, 2
jne 0x4ad154f2
push 3
jmp 0x4ad154e2
mov eax, 0x10b
jmp 0x4ad154f2
cmp dword [ebp + 0xc], ebx
je 0x4ad154b2
cmp dword [ebp + 0xc], 1
jne 0x4ad154c7
mov ax, word [ebp - 0xc]
cmp ax, word [ebp - 6]
jne 0x4ad154c7
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x4ad154c7
call edi
jmp 0x4ad154f2
lea eax, [ebp - 0x214]
push 0x4ad23b00
push eax
lea eax, [ebp - 8]
push eax
call fcn.4ad062e7
test eax, eax
je 0x4ad154e5
push 8
pop eax
jmp 0x4ad154f2
push ebx
push 0x4ad228a0
call fcn.4ad14ffd
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8