Function at 0x401708
Capabilities:
Access peb ldr_data
Get common file path
Query environment variable

Disassembly:
jmp 0x403430
push 0xffffffffffffffff
push 0x4672c8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push esi
mov esi, ecx
push edi
push 0x475a80
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::CString_2
mov eax, dword [esp + 0xc]
push 0
push 2
push eax
mov dword [esp + 0x30], 0
call fcn.004012d0
add esp, 0xc
lea ecx, [esp + 8]
push 0x47b1f4
call sub.MFC42u.DLL_CString::CString_2
push 0x104
push 0x104
lea ecx, [esp + 0x10]
mov byte [esp + 0x2c], 1
call sub.MFC42u.DLL_CString::GetBuffer
push eax
push 0x475a58
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x104
jbe 0x4034de
call edi
push eax
lea ecx, [esp + 0x10]
push 0x4759f8
push ecx
call sub.MFC42u.DLL_CString::Format
mov edx, dword [esp + 0x18]
push 0
push 1
push edx
call fcn.004012d0
add esp, 0x18
lea ecx, [esp + 8]
call sub.MFC42u.DLL_CString::Empty
push 0xffffffffffffffff
lea ecx, [esp + 0xc]
call sub.MFC42u.DLL_CString::ReleaseBuffer
push 0x4757dc
lea ecx, [esp + 0xc]
call sub.MFC42u.DLL_CString::TrimRight_2
lea eax, [esp + 0x10]
push 0x4759d8
lea ecx, [esp + 0x1c]
push eax
push ecx
call sub.MFC42u.DLL_CTime::GetTickCount
mov ecx, eax
call sub.MFC42u.DLL_CTime::Format
lea edx, [esp + 8]
mov ecx, esi
push edx
mov byte [esp + 0x28], 2
call sub.MFC42u.DLL_CString::operator_1
mov eax, dword [esp + 8]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x403542
mov ecx, dword [esp + 0x10]
push ecx
push eax
push 0x4759ac
push esi
call sub.MFC42u.DLL_CString::Format
add esp, 0x10
mov edx, dword [esi]
lea eax, [esp + 0xc]
push edx
push 0x475964
push eax
call sub.MFC42u.DLL_CString::Format
mov ecx, dword [esp + 0x18]
push 0
push 2
push ecx
call fcn.004012d0
mov eax, dword [esi]
push eax
call fcn.0040170d
add esp, 0x1c
test eax, eax
jne 0x40365a
call edi
push eax
lea edx, [esp + 0x10]
push 0x475908
push edx
call sub.MFC42u.DLL_CString::Format
mov eax, dword [esp + 0x18]
push 0
push 1
push eax
call fcn.004012d0
add esp, 0x18
lea ecx, [esp + 8]
push 0x47b1f4
call sub.MFC42u.DLL_CString::operator
push 0x104
push 0x104
lea ecx, [esp + 0x10]
call sub.MFC42u.DLL_CString::GetBuffer
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0xffffffffffffffff
lea ecx, [esp + 0xc]
call sub.MFC42u.DLL_CString::ReleaseBuffer
push 0x4757dc
lea ecx, [esp + 0xc]
call sub.MFC42u.DLL_CString::TrimRight_2
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 8]
push ecx
push edx
push 0x4758d0
push esi
call sub.MFC42u.DLL_CString::Format
mov eax, dword [esi]
add esp, 0x10
lea ecx, [esp + 0xc]
push eax
push 0x475964
push ecx
call sub.MFC42u.DLL_CString::Format
mov edx, dword [esp + 0x18]
push 0
push 2
push edx
call fcn.004012d0
mov esi, dword [esi]
push esi
call fcn.0040170d
add esp, 0x1c
test eax, eax
jne 0x40365a
call edi
push eax
lea eax, [esp + 0x10]
push 0x475908
push eax
call sub.MFC42u.DLL_CString::Format
mov ecx, dword [esp + 0x18]
push 0
push 1
push ecx
call fcn.004012d0
add esp, 0x18
lea edx, [esp + 0x14]
mov dword [esp + 0x14], 0
push 0x46ee50
push edx
call sub.MSVCRT.dll__CxxThrowException
lea ecx, [esp + 0x10]
mov byte [esp + 0x24], 1
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 8]
mov byte [esp + 0x24], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0xc]
mov dword [esp + 0x24], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov ecx, dword [esp + 0x1c]
pop edi
mov eax, 1
pop esi
mov dword fs:[0], ecx
add esp, 0x20
ret