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

Disassembly:
push 0xffffffffffffffff
push 0x481848
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x218
push ebx
push ebp
push esi
mov esi, dword [esp + 0x234]
mov ebp, ecx
push edi
push 0x4a01d0
mov ecx, esi
mov dword [esp + 0x14], ebp
call sub.MFC42u.DLL_CString::TrimLeft
push 0x4a01d0
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 0x412b9b
push esi
lea ecx, [esp + 0x18]
call fcn.0047f960
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 0x412b82
mov ebx, dword [sym.imp.MSVCRT.dll_wcschr]
lea ebp, [eax + 2]
push 0x20
push ebp
call ebx
mov edi, eax
add esp, 8
test edi, edi
jne 0x412ade
push 9
push ebp
call ebx
mov edi, eax
add esp, 8
test edi, edi
je 0x412b82
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 0x4a01d0
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::TrimLeft
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x412b82
mov eax, ecx
lea edx, [esp + 0x18]
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 + 0x18]
mov byte [esp + 0x230], 0
call sub.MFC42u.DLL_CString::CString
push 0x2c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
or ebx, 0xffffffff
cmp eax, ebx
je 0x412b85
push eax
lea eax, [esp + 0x1c]
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 + 0x18]
mov byte [esp + 0x230], 0
call sub.MFC42u.DLL_CString::CString
jmp 0x412b85
or ebx, 0xffffffff
lea ecx, [esp + 0x14]
mov dword [esp + 0x230], ebx
call sub.MFC42u.DLL_CString::CString
mov ebp, dword [esp + 0x10]
jmp 0x412b9e
or ebx, 0xffffffff
mov eax, dword [esi]
xor edi, edi
mov ecx, dword [eax - 8]
cmp ecx, edi
jle 0x412d33
mov ax, word [eax]
cmp ax, 0x22
jne 0x412c00
push 0x4a1f18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft
push 0x22
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x412c64
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], ebx
lea ecx, [esp + 0x10]
jmp 0x412c5f
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
jne 0x412c1a
push 0x2f
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x412c27
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x412c64
push 0x20
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x412c64
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], ebx
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString
push 0x4a1f24
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x412ca4
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], ebx
call sub.MFC42u.DLL_CString::CString
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
test eax, eax
jl 0x412cfa
mov edx, dword [ebp]
push esi
mov ecx, ebp
call dword [edx + 0xf4]
test al, al
jne 0x412cfa
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 0x412cfa
cmp eax, 0x103
jae 0x412cfa
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4a01d8
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 0x412d33
cmp eax, 0x103
jae 0x412d33
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4a01d8
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0xc
mov eax, dword [esi]
mov ebp, dword [sym.imp.MSVCRT.dll_wcslen]
push str.rundll32
mov edi, dword [eax - 8]
call ebp
add esp, 4
cmp edi, eax
jb 0x412da4
mov ecx, dword [esi]
push str.rundll32
mov edi, dword [ecx - 8]
call ebp
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 0x412da4
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 0x4a15a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x412e15
add eax, 2
mov ecx, esi
push eax
push 0x4a15a0
call sub.MFC42u.DLL_CString::Find_3
cmp eax, ebx
je 0x412e15
test eax, eax
jle 0x412dcd
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], ebx
call sub.MFC42u.DLL_CString::CString
push 0x4a1f18
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4a01d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4a1f1c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x412e55
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], ebx
call sub.MFC42u.DLL_CString::CString
push 0x4a15a0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
jne 0x412e6e
push esi
call fcn.00402710
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax - 8]
cmp eax, 4
jle 0x412e9f
push 4
push 0x4a3840
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 0x412e9f
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, ebx
je 0x412ed3
push eax
push 0x2e
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_2
cmp eax, ebx
jne 0x412ed3
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x412ed3
push 0x4a1f0c
mov ecx, esi
call fcn.0047f984
mov ecx, dword [esp + 0x228]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x224
ret 4