Function at 0x409a20
Capabilities:
Query environment variable

Disassembly:
push 0xffffffffffffffff
push 0x40d780
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push esi
push edi
mov edi, ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x10]
mov dword [esp + 0x34], 0
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0xc]
mov byte [esp + 0x34], 1
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x14]
mov byte [esp + 0x34], 2
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x18]
mov byte [esp + 0x34], 3
call sub.MFC42.DLL_CString::CString_2
mov esi, dword [sym.imp.MSVCRT.dll_getenv]
mov bl, 4
push str.path
mov byte [esp + 0x38], bl
call esi
add esp, 4
lea ecx, [esp + 0x10]
push eax
call sub.MFC42.DLL_CString::operator
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x409d5c
cmp dword [edi + 0x88], 1
jne 0x409ac0
push str.windir
jmp 0x409ac5
push str.SystemRoot
call esi
add esp, 4
lea ecx, [esp + 0x14]
push eax
call sub.MFC42.DLL_CString::operator
push str.SystemDrive
call esi
add esp, 4
lea ecx, [esp + 0x18]
push eax
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x14]
push ecx
lea ecx, [edi + 0x94]
call sub.MFC42.DLL_CString::operator_1
lea edx, [esp + 0x10]
lea ecx, [esp + 0xc]
push edx
call sub.MFC42.DLL_CString::operator_1
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x409c15
push 0x3b
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::Find_3
mov esi, eax
test esi, esi
jle 0x409b96
lea ecx, [esp + 0x20]
push esi
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::Left
push eax
lea ecx, [esp + 0x10]
mov byte [esp + 0x38], 5
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x20]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
mov eax, dword [edx - 8]
sub eax, esi
dec eax
push eax
lea eax, [esp + 0x28]
push eax
call sub.MFC42.DLL_CString::Right
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x38], 6
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x24]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::operator_1
jmp 0x409bad
lea edx, [esp + 0x10]
lea ecx, [esp + 0xc]
push edx
call sub.MFC42.DLL_CString::operator_1
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::Empty
push 0x411114
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::TrimLeft_1
push 0x411114
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::TrimRight_1
mov eax, dword [esp + 0xc]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x409c06
lea ecx, [esp + 0xc]
push 0x412178
lea edx, [esp + 0x2c]
push ecx
push edx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [edi + 0x90]
mov byte [esp + 0x38], 7
call fcn.0040c9ee
lea ecx, [esp + 0x28]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 8]
test ecx, ecx
jne 0x409b15
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx - 8]
test eax, eax
jne 0x409c2e
push 0x4121ac
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::operator
mov edx, dword [esp + 0x18]
lea eax, [esp + 0xc]
push edx
push 0x4121a8
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea ecx, [esp + 0xc]
lea edx, [esp + 0x28]
push 0x412178
push ecx
push edx
call sub.MFC42.DLL_operator_1
lea esi, [edi + 0x90]
push eax
mov ecx, esi
mov byte [esp + 0x38], 8
call fcn.0040c9ee
lea ecx, [esp + 0x28]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x409d5c
push eax
lea eax, [esp + 0x10]
push str._sSYSTEM32DRIVERS
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea ecx, [esp + 0xc]
lea edx, [esp + 0x28]
push 0x412178
push ecx
push edx
call sub.MFC42.DLL_operator_1
push eax
mov ecx, esi
mov byte [esp + 0x38], 9
call fcn.0040c9ee
lea ecx, [esp + 0x28]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0xc]
push eax
push str._sAppPatch
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea edx, [esp + 0xc]
lea eax, [esp + 0x28]
push 0x412178
push edx
push eax
call sub.MFC42.DLL_operator_1
push eax
mov ecx, esi
mov byte [esp + 0x38], 0xa
call fcn.0040c9ee
lea ecx, [esp + 0x28]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
cmp dword [edi + 0x88], 1
jne 0x409d5c
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0xc]
push ecx
push str._sSYSTEM
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [esp + 0xc]
lea ecx, [esp + 0x28]
push 0x412178
push eax
push ecx
call sub.MFC42.DLL_operator_1
push eax
mov ecx, esi
mov byte [esp + 0x38], 0xb
call fcn.0040c9ee
lea ecx, [esp + 0x28]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
mov byte [esp + 0x34], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x34], 2
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov byte [esp + 0x34], 1
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov byte [esp + 0x34], 0
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
mov dword [esp + 0x34], 0xffffffff
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0x2c]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret