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

Disassembly:
push 0xffffffffffffffff
push 0x4a3798
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 0x4c61d0
mov ecx, esi
mov dword [esp + 0x14], ebp
call sub.MFC42u.DLL_CString::TrimLeft_1
push 0x4c61d0
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 0x419a5b
push esi
lea ecx, [esp + 0x18]
call fcn.004a10b0
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 0x419a42
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 0x41999e
push 9
push ebp
call ebx
mov edi, eax
add esp, 8
test edi, edi
je 0x419a42
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 0x4c61d0
lea ecx, [esp + 0x18]
call sub.MFC42u.DLL_CString::TrimLeft_1
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x419a42
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 0x419a45
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 0x419a45
or ebx, 0xffffffff
lea ecx, [esp + 0x14]
mov dword [esp + 0x230], ebx
call sub.MFC42u.DLL_CString::CString
mov ebp, dword [esp + 0x10]
jmp 0x419a5e
or ebx, 0xffffffff
mov eax, dword [esi]
xor edi, edi
mov ecx, dword [eax - 8]
cmp ecx, edi
jle 0x419bf3
mov ax, word [eax]
cmp ax, 0x22
jne 0x419ac0
push 0x4c9bd8
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimLeft_1
push 0x22
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x419b24
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 0x419b1f
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
jne 0x419ada
push 0x2f
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x419ae7
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x419b24
push 0x20
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x419b24
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 0x4c9be4
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x419b64
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 0x419bba
mov edx, dword [ebp]
push esi
mov ecx, ebp
call dword [edx + 0xf8]
test al, al
jne 0x419bba
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 0x419bba
cmp eax, 0x103
jae 0x419bba
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4c61d8
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 0x419bf3
cmp eax, 0x103
jae 0x419bf3
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4c61d8
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 0x419c64
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 0x419c64
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 0x4c7fd0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x419cd5
add eax, 2
mov ecx, esi
push eax
push 0x4c7fd0
call sub.MFC42u.DLL_CString::Find_3
cmp eax, ebx
je 0x419cd5
test eax, eax
jle 0x419c8d
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 0x4c9bd8
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4c61d0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4c9bdc
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x419d15
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 0x4c7fd0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
jne 0x419d2e
push esi
call fcn.00402710
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax - 8]
cmp eax, 4
jle 0x419d5f
push 4
push 0x4cb120
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 0x419d5f
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 0x419d93
push eax
push 0x2e
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_2
cmp eax, ebx
jne 0x419d93
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x419d93
push 0x4c9bcc
mov ecx, esi
call fcn.004a1128
mov ecx, dword [esp + 0x228]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x224
ret 4