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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x47fca8
push eax
mov dword fs:[0], esp
sub esp, 0x218
push ebx
push ebp
push esi
mov esi, dword [esp + 0x234]
mov ebx, ecx
push edi
push 0x49e1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft
push 0x49e1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
mov eax, dword [esi]
push str.rundll32
mov edi, dword [eax - 8]
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
cmp edi, eax
jb 0x412a74
push esi
lea ecx, [esp + 0x18]
call fcn.0047ddc0
lea ecx, [esp + 0x14]
mov dword [esp + 0x230], 0
call sub.MFC42u.DLL_CString::MakeLower
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx - 8]
lea ecx, [esp + 0x14]
push eax
call sub.MFC42u.DLL_CString::GetBuffer
push str.rundll32
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
je 0x412a5f
mov ebp, dword [sym.imp.MSVCRT.dll_wcschr]
add eax, 2
push 0x20
push eax
call ebp
mov edi, eax
add esp, 8
test edi, edi
jne 0x4129bb
push 9
push 2
call ebp
mov edi, eax
add esp, 8
test edi, edi
je 0x412a5f
push 0
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::GetBuffer
sub edi, eax
lea ecx, [esp + 0x14]
shr edi, 1
push edi
push 0
call sub.MFC42u.DLL_CString::Delete
push 0x49e1d0
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::TrimLeft
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x412a5f
mov eax, ecx
lea edx, [esp + 0x10]
push eax
push edx
mov ecx, esi
call sub.MFC42u.DLL_CString::Right
push eax
mov ecx, esi
mov byte [esp + 0x234], 1
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov byte [esp + 0x230], 0
call sub.MFC42u.DLL_CString::CString
push 0x2c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
or ebp, 0xffffffff
cmp eax, ebp
je 0x412a62
push eax
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov byte [esp + 0x234], 2
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov byte [esp + 0x230], 0
call sub.MFC42u.DLL_CString::CString
jmp 0x412a62
or ebp, 0xffffffff
lea ecx, [esp + 0x14]
mov dword [esp + 0x230], ebp
call sub.MFC42u.DLL_CString::CString
jmp 0x412a77
or ebp, 0xffffffff
mov eax, dword [esi]
xor edi, edi
mov ecx, dword [eax - 8]
cmp ecx, edi
jle 0x412c0b
mov ax, word [eax]
cmp ax, 0x22
jne 0x412ad9
push 0x49ff18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft
push 0x22
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x412b3d
lea ecx, [esp + 0x10]
push eax
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x234], 3
call sub.MFC42u.DLL_CString::operator_1
mov dword [esp + 0x230], ebp
lea ecx, [esp + 0x10]
jmp 0x412b38
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
jne 0x412af3
push 0x2f
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x412b00
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x412b3d
push 0x20
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x412b3d
lea edx, [esp + 0x10]
push eax
push edx
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x234], 4
call sub.MFC42u.DLL_CString::operator_1
mov dword [esp + 0x230], ebp
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString
push 0x49ff24
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412b7d
push eax
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x234], 5
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov dword [esp + 0x230], ebp
call sub.MFC42u.DLL_CString::CString
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
test eax, eax
jl 0x412bd2
mov edx, dword [ebx]
push esi
mov ecx, ebx
call dword [edx + 0xf4]
test al, al
jne 0x412bd2
mov eax, dword [esi]
lea ecx, [esp + 0x1c]
push 0x104
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, edi
jbe 0x412bd2
cmp eax, 0x103
jae 0x412bd2
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x49e1d8
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
mov eax, dword [esi]
lea ecx, [esp + 0x1c]
push 0x104
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
cmp eax, edi
jbe 0x412c0b
cmp eax, 0x103
jae 0x412c0b
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x49e1d8
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
mov eax, dword [esi]
mov ebx, dword [sym.imp.MSVCRT.dll_wcslen]
push str.rundll32
mov edi, dword [eax - 8]
call ebx
add esp, 4
cmp edi, eax
jb 0x412c7c
mov ecx, dword [esi]
push str.rundll32
mov edi, dword [ecx - 8]
call ebx
add esp, 4
mov ecx, esi
push eax
push str.rundll32
push edi
call sub.MFC42u.DLL_CString::GetBuffer
push eax
call dword [sym.imp.MSVCRT.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x412c7c
lea edx, [esp + 0x1c]
push 0x104
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [esp + 0x1c]
mov word [esp + 0x222], 0
push eax
push str._s_rundll32.exe
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
push 0x49f5a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412ced
add eax, 2
mov ecx, esi
push eax
push 0x49f5a0
call sub.MFC42u.DLL_CString::Find_3
cmp eax, ebp
je 0x412ced
test eax, eax
jle 0x412ca5
dec eax
lea ecx, [esp + 0x10]
push eax
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x234], 6
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov dword [esp + 0x230], ebp
call sub.MFC42u.DLL_CString::CString
push 0x49ff18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x49e1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x49ff1c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412d2d
lea edx, [esp + 0x18]
push eax
push edx
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x234], 7
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x18]
mov dword [esp + 0x230], ebp
call sub.MFC42u.DLL_CString::CString
push 0x49f5a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
jne 0x412d46
push esi
call fcn.00402710
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax - 8]
cmp eax, 4
jle 0x412d77
push 4
push 0x4a1880
push eax
mov ecx, esi
call sub.MFC42u.DLL_CString::GetBuffer
push eax
call dword [sym.imp.MSVCRT.dll_wcsncmp]
add esp, 0xc
test eax, eax
jne 0x412d77
push 4
push eax
mov ecx, esi
call sub.MFC42u.DLL_CString::Delete
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::ReverseFind
cmp eax, ebp
je 0x412dab
push eax
push 0x2e
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_2
cmp eax, ebp
jne 0x412dab
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x412dab
push 0x49ff0c
mov ecx, esi
call fcn.0047dde4
mov ecx, dword [esp + 0x228]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x224
ret 4