Function at 0x104f4af
Capabilities:
Check if file exists
Get common file path
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xc50
mov eax, dword [0x1055908]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0xc34], eax
mov eax, dword [ebp + 0xc]
push edi
mov dword [ebp - 0xc40], eax
mov eax, dword [ebp + 0x10]
mov edi, 0x103
xor ebx, ebx
push edi
mov dword [ebp - 0xc38], eax
lea eax, [ebp - 0x107]
push ebx
push eax
mov byte [ebp - 0x108], bl
call sub.msvcrt.dll_memset
add esp, 0xc
push 0x1017a24
mov dword [ebp - 0xc3c], 1
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0xc48], eax
cmp eax, ebx
je 0x104f7eb
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x1017a10
push eax
call esi
push 0x1017a00
push dword [ebp - 0xc48]
mov dword [ebp - 0xc44], eax
call esi
mov dword [ebp - 0xc50], eax
cmp dword [ebp - 0xc44], ebx
je 0x104f7de
cmp eax, ebx
je 0x104f7de
lea esi, [edi + 1]
cmp dword [ebp - 0xc38], ebx
jne 0x104f5a3
push esi
lea eax, [ebp - 0x81c]
push eax
push 0x10179e0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, 1
jl 0x104f585
cmp eax, edi
jle 0x104f597
push 0x10179b4
push esi
lea eax, [ebp - 0x81c]
push eax
call fcn.0101bc13
lea eax, [ebp - 0x81c]
mov dword [ebp - 0xc38], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push ebx
push dword [ebp - 0xc38]
mov dword [ebp - 0xc4c], eax
push eax
call dword [ebp - 0xc50]
push 0x680
call dword [sym.imp.dbghelp.dll_SymSetOptions]
lea eax, [ebp - 0x108]
cmp dword [ebp - 0xc34], ebx
jne 0x104f616
push esi
push eax
push 0x1017998
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
cmp eax, 1
jl 0x104f5ec
cmp eax, edi
jle 0x104f65a
lea eax, [ebp - 0x108]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
cmp eax, ebx
je 0x104f602
cmp eax, edi
jbe 0x104f65a
push 0x101795c
call dword [sym.imp.msvcrt.dll_wprintf]
pop ecx
mov byte [ebp - 0x108], bl
jmp 0x104f65a
push ebx
push ebx
push esi
push eax
push 0xffffffffffffffff
push dword [ebp - 0xc34]
push 0x220
push ebx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x104f643
push 0x1017920
call dword [sym.imp.msvcrt.dll_wprintf]
pop ecx
jmp 0x104f7de
lea eax, [ebp - 0x108]
push 0x3b
push eax
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
cmp eax, ebx
je 0x104f65a
mov byte [eax], bl
mov edi, dword [ebp - 0xc40]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x104f665
sub eax, edx
sar eax, 1
mov ecx, ebx
je 0x104f689
cmp word [edi + ecx*2], 0x3b
jne 0x104f684
inc dword [ebp - 0xc3c]
inc ecx
cmp ecx, eax
jb 0x104f677
mov dword [ebp - 0xc34], ebx
cmp dword [ebp - 0xc3c], ebx
jbe 0x104f7de
push 0x3b
push edi
mov byte [ebp - 0xc2d], bl
call dword [sym.imp.msvcrt.dll_wcschr]
pop ecx
pop ecx
mov dword [ebp - 0xc40], eax
cmp eax, ebx
je 0x104f6c2
xor ecx, ecx
mov word [eax], cx
mov byte [ebp - 0xc2d], 1
push esi
lea eax, [ebp - 0xc2c]
push eax
push esi
lea eax, [ebp - 0x614]
push eax
push 2
push edi
push ebx
push dword [ebp - 0xc4c]
call dword [ebp - 0xc44]
test eax, eax
jne 0x104f763
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x104f79b
push 0x100
lea eax, [ebp - 0x40c]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push edi
call sub.msvcrt.dll__wsplitpath_s
push 0x5c
pop eax
mov word [ebp - 0x40c], ax
lea eax, [ebp - 0x40c]
push eax
push dword [ebp - 0xc38]
lea eax, [ebp - 0xa24]
push 0x1017914
push esi
push eax
call fcn.0101bca7
add esp, 0x38
push esi
lea eax, [ebp - 0xc2c]
push eax
push esi
lea eax, [ebp - 0x614]
push eax
push 2
push edi
lea eax, [ebp - 0xa24]
push eax
push dword [ebp - 0xc4c]
call dword [ebp - 0xc44]
test eax, eax
je 0x104f79b
push ebx
push ebx
push esi
lea eax, [ebp - 0x20c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x614]
push eax
push 0x220
push ebx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x104f7de
push ebx
push ebx
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.01050f55
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x104f7a0
sub eax, edx
sar eax, 1
lea edi, [edi + eax*2 + 2]
cmp byte [ebp - 0xc2d], bl
je 0x104f7c6
mov ecx, dword [ebp - 0xc40]
push 0x3b
pop eax
mov word [ecx], ax
inc dword [ebp - 0xc34]
mov eax, dword [ebp - 0xc34]
cmp eax, dword [ebp - 0xc3c]
jb 0x104f69b
push dword [ebp - 0xc48]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.0101ca75
leave
ret 0xc