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

Disassembly:
push 0xffffffffffffffff
push 0x4a8c18
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 0x4cb1f0
mov ecx, esi
mov dword [esp + 0x14], ebp
call sub.MFC42u.DLL_CString::TrimLeft_1
push 0x4cb1f0
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 0x41c9bb
push esi
lea ecx, [esp + 0x18]
call fcn.004a6210
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 0x41c9a2
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 0x41c8fe
push 9
push ebp
call ebx
mov edi, eax
add esp, 8
test edi, edi
je 0x41c9a2
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 0x4cb1f0
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 0x41c9a2
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 0x41c9a5
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 0x41c9a5
or ebx, 0xffffffff
lea ecx, [esp + 0x14]
mov dword [esp + 0x230], ebx
call sub.MFC42u.DLL_CString::CString
mov ebp, dword [esp + 0x10]
jmp 0x41c9be
or ebx, 0xffffffff
mov eax, dword [esi]
xor edi, edi
mov ecx, dword [eax - 8]
cmp ecx, edi
jle 0x41cb53
mov ax, word [eax]
cmp ax, 0x22
jne 0x41ca20
push 0x4cfa50
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 0x41ca84
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 0x41ca7f
push 0x5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
jne 0x41ca3a
push 0x2f
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x41ca47
push 0x25
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x41ca84
push 0x20
mov ecx, esi
call sub.MFC42u.DLL_CString::Find
cmp eax, ebx
je 0x41ca84
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 0x4cfa5c
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x41cac4
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 0x41cb1a
mov edx, dword [ebp]
push esi
mov ecx, ebp
call dword [edx + 0xf0]
test al, al
jne 0x41cb1a
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 0x41cb1a
cmp eax, 0x103
jae 0x41cb1a
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4cb1f8
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 0x41cb53
cmp eax, 0x103
jae 0x41cb53
lea edx, [esp + 0x1c]
mov word [esp + 0x224], di
push edx
push 0x4cb1f8
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 0x41cbc4
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 0x41cbc4
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 0x4cdbf0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x41cc35
add eax, 2
mov ecx, esi
push eax
push 0x4cdbf0
call sub.MFC42u.DLL_CString::Find_3
cmp eax, ebx
je 0x41cc35
test eax, eax
jle 0x41cbed
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 0x4cfa50
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4cb1f0
mov ecx, esi
call sub.MFC42u.DLL_CString::TrimRight
push 0x4cfa54
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
je 0x41cc75
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 0x4cdbf0
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_1
cmp eax, ebx
jne 0x41cc8e
push esi
call fcn.00402710
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax - 8]
cmp eax, 4
jle 0x41ccbf
push 4
push 0x4d0f7c
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 0x41ccbf
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 0x41ccf3
push eax
push 0x2e
mov ecx, esi
call sub.MFC42u.DLL_CString::Find_2
cmp eax, ebx
jne 0x41ccf3
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x41ccf3
push 0x4cfa44
mov ecx, esi
call fcn.004a62ac
mov ecx, dword [esp + 0x228]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x224
ret 4