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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x47da27
push eax
mov dword fs:[0], esp
sub esp, 0x214
push ebx
push ebp
push esi
mov esi, dword [esp + 0x230]
push edi
mov edi, ecx
push 0x49b1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft
push 0x49b1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
mov eax, dword [esi]
xor ebx, ebx
or ebp, 0xffffffff
mov ecx, dword [eax - 8]
cmp ecx, ebx
jle 0x4129c3
mov ax, word [eax]
cmp ax, 0x22
jne 0x412891
push 0x49cf18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft
push 0x22
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x4128f5
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 + 0x230], ebx
call sub.MFC42u.DLL_CString::operator_1
mov dword [esp + 0x22c], ebp
lea ecx, [esp + 0x10]
jmp 0x4128f0
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
jne 0x4128ab
push 0x2f
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x4128b8
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x4128f5
push 0x20
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebp
je 0x4128f5
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 + 0x230], 1
call sub.MFC42u.DLL_CString::operator_1
mov dword [esp + 0x22c], ebp
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString
push 0x49cf24
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412935
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 + 0x230], 2
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov dword [esp + 0x22c], ebp
call sub.MFC42u.DLL_CString::CString
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
test eax, eax
jl 0x41298a
mov eax, dword [edi]
push esi
mov ecx, edi
call dword [eax + 0xf4]
test al, al
jne 0x41298a
mov eax, dword [esi]
lea ecx, [esp + 0x18]
push 0x104
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
jbe 0x41298a
cmp eax, 0x103
jae 0x41298a
lea edx, [esp + 0x18]
mov word [esp + 0x220], bx
push edx
push 0x49b1d8
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
mov eax, dword [esi]
lea ecx, [esp + 0x18]
push 0x104
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
cmp eax, ebx
jbe 0x4129c3
cmp eax, 0x103
jae 0x4129c3
lea edx, [esp + 0x18]
mov word [esp + 0x220], bx
push edx
push 0x49b1d8
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 0x412a34
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 0x412a34
lea edx, [esp + 0x18]
push 0x104
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [esp + 0x18]
mov word [esp + 0x21e], 0
push eax
push str._s_rundll32.exe
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
push 0x49c5a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412aa5
add eax, 2
mov ecx, esi
push eax
push 0x49c5a0
call sub.MFC42u.DLL_CString::Find_3
cmp eax, ebp
je 0x412aa5
test eax, eax
jle 0x412a5d
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 + 0x230], 3
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x10]
mov dword [esp + 0x22c], ebp
call sub.MFC42u.DLL_CString::CString
push 0x49cf18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x49b1d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x49cf1c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
je 0x412ae5
lea edx, [esp + 0x14]
push eax
push edx
mov ecx, esi
call sub.MFC42u.DLL_CString::Left
push eax
mov ecx, esi
mov dword [esp + 0x230], 4
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x14]
mov dword [esp + 0x22c], ebp
call sub.MFC42u.DLL_CString::CString
push 0x49c5a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebp
jne 0x412afe
push esi
call fcn.00402710
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax - 8]
cmp eax, 4
jle 0x412b2f
push 4
push 0x49e7d0
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 0x412b2f
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 0x412b63
push eax
push 0x2e
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_2
cmp eax, ebp
jne 0x412b63
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x412b63
push 0x49cf0c
mov ecx, esi
call fcn.0047bbb4
mov ecx, dword [esp + 0x224]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x220
ret 4