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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov dword [ebp - 0x118], ecx
mov eax, dword [ebp + 0xc]
add eax, 0x108
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41ebcc
push 0x104
lea ecx, [ebp - 0x108]
push ecx
mov edx, dword [ebp + 0xc]
add edx, 0x108
push edx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [ebp - 0x108]
mov dword [ebp - 4], eax
movsx ecx, byte [ebp - 0x108]
cmp ecx, 0x22
jne 0x41e921
push 0x22
lea edx, [ebp - 0x107]
push edx
call fcn.0041eec0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x41e918
mov eax, dword [ebp - 4]
mov byte [eax], 0
lea ecx, [ebp - 0x107]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41e9ba
mov eax, dword [ebp - 4]
push eax
call sub.ntdll.dll_strlen
add esp, 4
mov ecx, dword [ebp - 4]
add ecx, eax
mov dword [ebp - 0x10c], ecx
mov edx, dword [ebp - 0x10c]
lea eax, [ebp - 0x108]
cmp edx, eax
jbe 0x41e9ba
mov ecx, dword [ebp - 0x10c]
mov dl, byte [ecx]
mov byte [ebp - 0x114], dl
movsx eax, byte [ebp - 0x114]
cmp eax, 0x20
je 0x41e981
movsx ecx, byte [ebp - 0x114]
cmp ecx, 9
jne 0x41e9a9
mov edx, dword [ebp - 0x10c]
mov byte [edx], 0
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x41e99b
jmp 0x41e9ba
mov ecx, dword [ebp - 0x10c]
mov dl, byte [ebp - 0x114]
mov byte [ecx], dl
mov eax, dword [ebp - 0x10c]
sub eax, 1
mov dword [ebp - 0x10c], eax
jmp 0x41e94b
mov ecx, dword [ebp + 0xc]
add ecx, 0x108
mov dword [ebp - 0x10c], ecx
push 0x4c5090
call sub.ntdll.dll_strlen
add esp, 4
mov dword [ebp - 0x110], eax
mov edx, dword [ebp - 0x110]
push edx
mov eax, dword [ebp - 4]
push eax
push 0x4c50a0
call fcn.00415220
add esp, 0xc
test eax, eax
jne 0x41ea41
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0x110]
mov dword [ebp - 4], ecx
push 0x104
mov edx, dword [ebp - 0x10c]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov ecx, dword [ebp - 0x10c]
add ecx, eax
mov dword [ebp - 0x10c], ecx
mov edx, dword [ebp - 0x10c]
mov byte [edx], 0x5c
mov eax, dword [ebp - 0x10c]
add eax, 1
mov dword [ebp - 0x10c], eax
jmp 0x41eaf1
push 0x4c50b0
call sub.ntdll.dll_strlen
add esp, 4
mov dword [ebp - 0x110], eax
mov ecx, dword [ebp - 0x110]
push ecx
mov edx, dword [ebp - 4]
push edx
push 0x4c50bc
call fcn.00415220
add esp, 0xc
test eax, eax
jne 0x41eab6
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x110]
mov dword [ebp - 4], eax
push 0x104
mov ecx, dword [ebp - 0x10c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edx, dword [ebp - 0x10c]
add edx, eax
mov dword [ebp - 0x10c], edx
mov eax, dword [ebp - 0x10c]
mov byte [eax], 0x5c
mov ecx, dword [ebp - 0x10c]
add ecx, 1
mov dword [ebp - 0x10c], ecx
jmp 0x41eaf1
push 0x4c50c8
call sub.ntdll.dll_strlen
add esp, 4
mov dword [ebp - 0x110], eax
mov edx, dword [ebp - 0x110]
push edx
mov eax, dword [ebp - 4]
push eax
push 0x4c50d0
call fcn.00415220
add esp, 0xc
test eax, eax
jne 0x41eaf1
mov ecx, dword [ebp - 4]
add ecx, dword [ebp - 0x110]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
push edx
push 0x4c50d8
mov eax, dword [ebp - 0x10c]
push eax
call dword [sym.imp.ntdll.dll_sprintf]
add esp, 0xc
push 0x5c
mov ecx, dword [ebp + 0xc]
add ecx, 0x108
push ecx
call fcn.0041eec0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x41eb3e
push 0x2f
mov edx, dword [ebp + 0xc]
add edx, 0x108
push edx
call fcn.0041eec0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x41ebcc
push 0x104
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea ecx, [ebp + eax - 0x108]
mov dword [ebp - 4], ecx
mov edx, dword [ebp + 0xc]
add edx, 0x108
push edx
push 0x4c50dc
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ntdll.dll_sprintf]
add esp, 0xc
lea ecx, [ebp - 0x108]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41ebae
mov edx, dword [ebp + 0xc]
add edx, 0x108
push edx
push 0x4c50e0
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ntdll.dll_sprintf]
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x108]
push ecx
mov edx, dword [ebp + 0xc]
add edx, 0x108
push edx
call fcn.0041eee0
add esp, 0xc
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
call fcn.0041efd0
mov esp, ebp
pop ebp
ret 8