Function at 0x104f49f
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 0x104f7db
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 0x104f7ce
cmp eax, ebx
je 0x104f7ce
lea esi, [edi + 1]
cmp dword [ebp - 0xc38], ebx
jne 0x104f593
push esi
lea eax, [ebp - 0x81c]
push eax
push 0x10179e0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, 1
jl 0x104f575
cmp eax, edi
jle 0x104f587
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 0x104f606
push esi
push eax
push 0x1017998
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
cmp eax, 1
jl 0x104f5dc
cmp eax, edi
jle 0x104f64a
lea eax, [ebp - 0x108]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
cmp eax, ebx
je 0x104f5f2
cmp eax, edi
jbe 0x104f64a
push 0x101795c
call dword [sym.imp.msvcrt.dll_wprintf]
pop ecx
mov byte [ebp - 0x108], bl
jmp 0x104f64a
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 0x104f633
push 0x1017920
call dword [sym.imp.msvcrt.dll_wprintf]
pop ecx
jmp 0x104f7ce
lea eax, [ebp - 0x108]
push 0x3b
push eax
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
cmp eax, ebx
je 0x104f64a
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 0x104f655
sub eax, edx
sar eax, 1
mov ecx, ebx
je 0x104f679
cmp word [edi + ecx*2], 0x3b
jne 0x104f674
inc dword [ebp - 0xc3c]
inc ecx
cmp ecx, eax
jb 0x104f667
mov dword [ebp - 0xc34], ebx
cmp dword [ebp - 0xc3c], ebx
jbe 0x104f7ce
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 0x104f6b2
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 0x104f753
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x104f78b
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 0x104f78b
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 0x104f7ce
push ebx
push ebx
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.01050f48
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x104f790
sub eax, edx
sar eax, 1
lea edi, [edi + eax*2 + 2]
cmp byte [ebp - 0xc2d], bl
je 0x104f7b6
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 0x104f68b
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