Function at 0x412710
Capabilities:
Get common file path
Query environment variable

Disassembly:
push 0xffffffffffffffff
push 0x4370c6
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x88
push ebp
push esi
push edi
mov edi, ecx
lea ecx, [esp + 0x28]
call fcn.00413eb0
xor ebp, ebp
lea ecx, [esp + 0x14]
mov dword [esp + 0x9c], ebp
call fcn.00413eb0
lea ecx, [esp + 0x34]
mov byte [esp + 0x9c], 1
call fcn.00413eb0
mov esi, dword [esp + 0xa4]
mov byte [esp + 0x9c], 2
cmp esi, 0x10000
mov dword [esp + 0xc], ebp
jne 0x4127d1
push str.userenv.dll
lea ecx, [esp + 0x18]
call fcn.00413ee0
cmp eax, 1
jne 0x412bff
push str.GetProfilesDirectoryW
lea ecx, [esp + 0x18]
call fcn.00413fb0
cmp eax, ebp
je 0x4127c3
mov edx, dword [esp + 0xa8]
lea ecx, [esp + 0x10]
push ecx
push edx
mov dword [esp + 0x18], 0x104
call eax
test eax, eax
je 0x4127c3
mov dword [esp + 0xc], 1
lea ecx, [esp + 0x14]
call fcn.00413f60
jmp 0x412bff
cmp esi, 0x10002
jne 0x412833
push str.userenv.dll
lea ecx, [esp + 0x18]
call fcn.00413ee0
cmp eax, 1
jne 0x412bff
push str.GetDefaultUserProfileDirectoryW
lea ecx, [esp + 0x18]
call fcn.00413fb0
cmp eax, ebp
je 0x412825
mov edx, dword [esp + 0xa8]
lea ecx, [esp + 0x10]
push ecx
push edx
mov dword [esp + 0x18], 0x104
call eax
test eax, eax
je 0x412825
mov dword [esp + 0xc], 1
lea ecx, [esp + 0x14]
call fcn.00413f60
jmp 0x412bff
cmp esi, 0x10004
jne 0x41288b
mov esi, dword [esp + 0xa8]
push 0x104
push esi
mov word [esi], bp
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebp
jle 0x412bff
lea ecx, [eax + 2]
cmp ecx, 0x104
jge 0x412bff
cmp word [esi + eax*2 - 2], 0x5c
je 0x412bff
mov word [esi + eax*2], 0x5c
mov word [esi + eax*2 + 2], bp
jmp 0x412bff
cmp esi, 0x10006
jne 0x4128c3
mov esi, dword [esp + 0xa8]
push 0x104
push esi
mov word [esi], bp
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebp
jle 0x412bff
lea edx, [eax + 2]
cmp edx, 0x104
jmp 0x412869
cmp esi, 0x10001
jne 0x41297f
push str.advapi32.dll
lea ecx, [esp + 0x38]
call fcn.00413ee0
cmp eax, 1
jne 0x412bff
push str.OpenProcessToken
lea ecx, [esp + 0x38]
call fcn.00413fb0
mov edi, eax
cmp edi, ebp
je 0x412971
push str.userenv.dll
lea ecx, [esp + 0x18]
call fcn.00413ee0
cmp eax, 1
jne 0x412971
push str.GetUserProfileDirectoryW
lea ecx, [esp + 0x18]
call fcn.00413fb0
mov esi, eax
cmp esi, ebp
je 0x412968
lea eax, [esp + 0x30]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
test eax, eax
je 0x412968
mov edx, dword [esp + 0xa8]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x104
push ecx
push edx
push eax
call esi
test eax, eax
je 0x41295d
mov dword [esp + 0xc], 1
mov ecx, dword [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x14]
call fcn.00413f60
lea ecx, [esp + 0x34]
call fcn.00413f60
jmp 0x412bff
cmp esi, 0x10003
jne 0x412ac7
lea ecx, [esp + 0x1c]
call fcn.00424950
lea ecx, [esp + 0x68]
mov byte [esp + 0x9c], 3
call fcn.0040de30
lea ecx, [esp + 0x3c]
mov byte [esp + 0x9c], 4
call fcn.0040de30
push ebp
lea edx, [esp + 0x6c]
push ebp
push edx
push 0x447160
push str.SYSTEMCurrentControlSetControlSession_ManagerEnvironment
push reloc.OLEAUT32.dll_SysReAllocString
lea ecx, [esp + 0x34]
mov byte [esp + 0xb4], 5
call fcn.00413e00
test eax, eax
jne 0x412a00
push ebp
lea eax, [esp + 0x6c]
push ebp
push eax
push str.TEMP
push str.SYSTEMCurrentControlSetControlSession_ManagerEnvironment
push reloc.OLEAUT32.dll_SysReAllocString
lea ecx, [esp + 0x34]
call fcn.00413e00
lea ecx, [esp + 0x68]
call fcn.0040ef30
test eax, eax
je 0x412a5a
lea ecx, [esp + 0x3c]
call fcn.0040ef70
push eax
push ebp
lea ecx, [esp + 0x44]
call fcn.0040eef0
push eax
push ebp
lea ecx, [esp + 0x74]
call fcn.0040eef0
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea ecx, [esp + 0x3c]
call fcn.0040e230
push 0x5c
lea ecx, [esp + 0x40]
call fcn.0040f520
mov ecx, dword [esp + 0xa8]
push ecx
lea ecx, [esp + 0x40]
call fcn.0040eef0
jmp 0x412a87
mov esi, dword [esp + 0xa8]
push 0x104
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
jbe 0x412a8f
push esi
mov ecx, edi
call fcn.004126e0
push str.Temp_
push esi
call fcn.0042b06f
add esp, 8
mov dword [esp + 0xc], 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0x9c], 4
call fcn.0040ded0
lea ecx, [esp + 0x68]
mov byte [esp + 0x9c], 3
call fcn.0040ded0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x9c], 2
call fcn.004139b0
jmp 0x412bff
cmp esi, 0x10005
jne 0x412afe
mov esi, dword [esp + 0xa8]
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jne 0x412ae9
mov word [esi], bp
push esi
mov ecx, edi
call fcn.004126e0
mov dword [esp + 0xc], 1
jmp 0x412bff
cmp esi, 0x10007
jne 0x412b1f
mov esi, dword [esp + 0xa8]
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
jne 0x412ae9
jmp 0x412ae6
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
test eax, eax
je 0x412b6b
lea ecx, [esp + 0x34]
mov byte [esp + 0x9c], 1
call fcn.00413ec0
lea ecx, [esp + 0x14]
mov byte [esp + 0x9c], 0
call fcn.00413ec0
lea ecx, [esp + 0x28]
mov dword [esp + 0x9c], 0xffffffff
call fcn.00413ec0
xor eax, eax
jmp 0x412c39
lea eax, [esp + 0x20]
mov dword [esp + 0x20], ebp
push eax
push esi
push ebp
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov edi, dword [esp + 0xa8]
cmp eax, ebp
jl 0x412ba1
mov ecx, dword [esp + 0x20]
push edi
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
test eax, eax
je 0x412ba1
mov dword [esp + 0xc], 1
jmp 0x412be2
push str.shfolder.dll
lea ecx, [esp + 0x2c]
call fcn.00413ee0
cmp eax, 1
jne 0x412be2
push str.SHGetFolderPathW
lea ecx, [esp + 0x2c]
call fcn.00413fb0
cmp eax, ebp
je 0x412bd9
push edi
push ebp
push ebp
push esi
push ebp
call eax
cmp eax, ebp
jne 0x412bd9
mov dword [esp + 0xc], 1
lea ecx, [esp + 0x28]
call fcn.00413f60
mov ecx, dword [esp + 0x20]
cmp ecx, ebp
je 0x412bf5
mov eax, dword [esp + 0x24]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x14]
mov eax, dword [esp + 0x24]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
lea ecx, [esp + 0x34]
mov byte [esp + 0x9c], 1
call fcn.00413ec0
lea ecx, [esp + 0x14]
mov byte [esp + 0x9c], 0
call fcn.00413ec0
lea ecx, [esp + 0x28]
mov dword [esp + 0x9c], 0xffffffff
call fcn.00413ec0
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x94
ret 8