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

Disassembly:
push 0x684
mov eax, 0x58bfb5
call fcn.0055f097
mov esi, dword [ebp + 8]
mov dword [ebp - 0x690], esi
xor ebx, ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x1c], ebx
jne 0x40d6f4
push 0x58f4c4
mov ecx, esi
call fcn.00401302
jmp 0x40de49
push 0x590d50
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d744
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.00561510
push ebx
push 0x26
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0040e344
lea eax, [ebp - 0x218]
push 0x58f93c
push eax
call fcn.00564c0b
add esp, 0x24
lea eax, [ebp - 0x218]
push eax
jmp 0x40d6e8
push 0x590d58
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d76c
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.00561510
push ebx
push 5
jmp 0x40d71a
push str.desktop
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d7a8
push ebx
push ebx
lea eax, [ebp - 0x62c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x62c]
push 0x58f93c
push eax
call fcn.00564c0b
pop ecx
pop ecx
lea eax, [ebp - 0x62c]
jmp 0x40d741
push 0x590d70
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d7be
push ebx
push 6
jmp 0x40d77f
push str.program
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d84c
mov edi, 0x208
lea eax, [ebp - 0x218]
push edi
push ebx
push eax
call fcn.00561510
push ebx
push 0x26
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0040e344
lea eax, [ebp - 0x218]
push eax
call fcn.00564b19
add esp, 0x20
cmp eax, 3
jl 0x40d73b
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.00561510
push 3
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x62c]
push eax
call fcn.00572b8a
lea eax, [ebp - 0x62c]
push str.Program_Files_
push eax
call fcn.00564c0b
add esp, 0x20
lea eax, [ebp - 0x62c]
jmp 0x40d741
push str.curr
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d89d
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.00561510
add esp, 0xc
lea eax, [ebp - 0x62c]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x62c]
push 0x5c
push eax
call fcn.00561adb
pop ecx
pop ecx
xor ecx, ecx
mov word [eax + 2], cx
jmp 0x40d841
push str.temp
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d967
mov edi, 0x208
lea eax, [ebp - 0x218]
push edi
push ebx
push eax
call fcn.00561510
push edi
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.00561510
add esp, 0x18
call fcn.0040dfcd
test al, al
je 0x40d912
push ebx
push 0x1c
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0040e344
add esp, 0x10
test eax, eax
je 0x40d73b
push str.Temp_
lea eax, [ebp - 0x218]
push eax
call fcn.00564c0b
pop ecx
pop ecx
jmp 0x40d73b
lea eax, [ebp - 0x62c]
mov edi, 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push edi
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x62c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
lea eax, [ebp - 0x218]
push eax
call fcn.00564b19
pop ecx
test eax, eax
jne 0x40d73b
push edi
lea eax, [ebp - 0x218]
push eax
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x40d73b
push str.recirle
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40d9a2
push 0x208
lea eax, [ebp - 0x62c]
push ebx
push eax
call fcn.00561510
push ebx
push 0xa
lea eax, [ebp - 0x62c]
push eax
push ebx
call fcn.0040e344
add esp, 0x1c
jmp 0x40d841
push str.downloads
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40da49
push 0x208
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.00561510
push ebx
push 0x10
lea eax, [ebp - 0x218]
push eax
push ebx
call fcn.0040e344
lea eax, [ebp - 0x218]
push eax
call fcn.00564b19
add esp, 0x20
test eax, eax
lea eax, [ebp - 0x218]
je 0x40da19
push 0x5c
push eax
call fcn.00561adb
xor ecx, ecx
push 0x590e00
mov word [eax + 2], cx
lea eax, [ebp - 0x218]
push eax
call fcn.00564c0b
add esp, 0x10
jmp 0x40d73b
push 0x104
push eax
push 0x590e18
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push eax
call fcn.00564b19
pop ecx
test eax, eax
je 0x40d73b
push str.Downloads_
jmp 0x40d8ff
xor eax, eax
mov dword [ebp - 0x64c], ebx
mov dword [ebp - 0x648], 7
mov word [ebp - 0x65c], ax
push 0x208
lea eax, [ebp - 0x420]
mov byte [ebp - 4], 1
push ebx
push eax
call fcn.00561510
add esp, 0xc
lea eax, [ebp - 0x420]
push 0x104
push eax
push 0x590e18
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x420]
push str.AppDataLocalLow_
push eax
call fcn.00564c0b
lea eax, [ebp - 0x420]
push eax
call fcn.00564b19
add esp, 0xc
lea ecx, [ebp - 0x65c]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00401589
push str.locallow
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40db6f
push ebx
push 0x1a
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0040e344
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x644]
call fcn.00401302
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 2
call fcn.00401302
push str.Roaming
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 3
call fcn.00401302
lea eax, [ebp - 0x68c]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x674]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.0040ebfb
add esp, 0xc
lea ecx, [ebp - 0x674]
call fcn.004014e8
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x68c]
jmp 0x40dd97
push str.roaming
lea ecx, [ebp + 0xc]
call fcn.00403ae7
mov edi, str.Roaming
test al, al
jne 0x40dcc9
push edi
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
jne 0x40dcc9
push str.local
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40dc5f
push ebx
push 0x1c
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0040e344
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x420]
push eax
call fcn.0040954c
pop ecx
test al, al
jne 0x40dcfa
lea eax, [ebp - 0x65c]
mov dword [ebp - 0x634], ebx
push eax
lea ecx, [ebp - 0x644]
mov dword [ebp - 0x630], ebx
call fcn.00401cdd
push str.Local
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 8
call fcn.00401302
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 9
call fcn.00401302
lea eax, [ebp - 0x674]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x68c]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.0040ebfb
add esp, 0xc
lea ecx, [ebp - 0x68c]
call fcn.004014e8
mov byte [ebp - 4], 8
jmp 0x40dd91
push str.system
lea ecx, [ebp + 0xc]
call fcn.00403ae7
test al, al
je 0x40dca7
push ebx
push 0x29
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0040e344
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x420]
push eax
call fcn.0040954c
pop ecx
test al, al
je 0x40dddc
jmp 0x40dcfa
lea eax, [ebp + 0xc]
mov byte [ebp - 0x690], bl
mov ecx, esi
push dword [ebp - 0x690]
mov dword [esi + 0x14], ebx
push eax
mov dword [esi + 0x10], ebx
call fcn.004035af
jmp 0x40de3e
push ebx
push 0x1a
lea eax, [ebp - 0x420]
push eax
push ebx
call fcn.0040e344
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x420]
push eax
call fcn.0040954c
pop ecx
test al, al
je 0x40dd1f
lea eax, [ebp - 0x420]
push eax
call fcn.00564b19
pop ecx
push eax
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x65c]
call fcn.00401589
jmp 0x40dddc
lea eax, [ebp - 0x65c]
mov dword [ebp - 0x634], ebx
push eax
lea ecx, [ebp - 0x644]
mov dword [ebp - 0x630], ebx
call fcn.00401cdd
push edi
lea ecx, [ebp - 0x674]
mov byte [ebp - 4], 5
call fcn.00401302
push str.LocalLow
lea ecx, [ebp - 0x68c]
mov byte [ebp - 4], 6
call fcn.00401302
lea eax, [ebp - 0x674]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0x68c]
push eax
lea eax, [ebp - 0x644]
push eax
call fcn.0040ebfb
add esp, 0xc
lea ecx, [ebp - 0x68c]
call fcn.004014e8
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x674]
call fcn.004014e8
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
cmovae eax, dword [ebp - 0x644]
push eax
call fcn.0040954c
pop ecx
test al, al
je 0x40ddcd
lea eax, [ebp - 0x644]
push eax
lea ecx, [ebp - 0x65c]
call fcn.00403df9
lea ecx, [ebp - 0x644]
mov byte [ebp - 4], 1
call fcn.004014e8
cmp dword [ebp - 0x648], 8
lea eax, [ebp - 0x65c]
cmovae eax, dword [ebp - 0x65c]
push eax
call fcn.0040954c
pop ecx
test al, al
je 0x40de32
push ebx
push str.system32
lea ecx, [ebp - 0x65c]
call fcn.00404fbd
cmp eax, 0xffffffff
jne 0x40de32
push ebx
push str.systemprofile
lea ecx, [ebp - 0x65c]
call fcn.00404fbd
cmp eax, 0xffffffff
jne 0x40de32
lea eax, [ebp - 0x65c]
jmp 0x40dcaa
push 0x58f4c4
mov ecx, esi
call fcn.00401302
lea ecx, [ebp - 0x65c]
call fcn.004014e8
lea ecx, [ebp + 0xc]
call fcn.004014e8
mov eax, esi
call fcn.0055f052
ret