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

Disassembly:
push ebp
lea ebp, [esp - 0x228]
sub esp, 0x228
push 0xffffffffffffffff
push 0x4ba940
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x4e27e0]
xor eax, ebp
mov dword [ebp + 0x224], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor eax, eax
mov edi, ecx
mov word [ebp - 0x24], ax
push 0x2c
mov eax, str.CSystemCommands::GetSafeEnv____bool____start
lea esi, [ebp - 0x28]
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x10], 7
mov dword [ebp - 0x14], 0
call fcn.004033f0
mov ecx, esi
push ecx
mov dword [ebp - 4], 0
call fcn.00403580
add esp, 4
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x10], 8
jb 0x40deab
mov edx, dword [ebp - 0x24]
push edx
call fcn.0047cc0e
add esp, 4
push 0
mov eax, 0x4c7eec
mov esi, edi
call fcn.004033f0
test ebx, ebx
je 0x40e16f
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40dec6
sub eax, edx
je 0x40e16f
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
inc esi
cmp esi, 0x3fffffff
jle 0x40deeb
xor eax, eax
jmp 0x40deff
lea eax, [esi + esi]
call fcn.004a2b80
mov eax, esp
push 3
push esi
push ebx
push eax
call fcn.0040b600
xor ecx, ecx
mov word [ebp + 4], cx
mov edi, 7
mov ecx, eax
mov dword [ebp + 0x18], edi
mov dword [ebp + 0x14], 0
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x40df20
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [ebp]
call fcn.004033f0
mov dword [ebp - 4], 2
mov dword [ebp - 0x10], edi
xor edx, edx
xor edi, edi
push 0x24
mov eax, str.CSystemCommands::GetSafeEnv__varName
lea esi, [ebp - 0x28]
mov dword [ebp - 0x14], edi
mov word [ebp - 0x24], dx
call fcn.004033f0
mov eax, esi
push eax
lea ecx, [ebp]
mov byte [ebp - 4], 3
call fcn.00402ec0
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x10], 8
jb 0x40df84
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.0047cc0e
add esp, 4
push 0x104
call fcn.0047cc03
add esp, 4
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
test esi, esi
jbe 0x40dfba
push esi
call fcn.0047cc03
add esp, 4
push esi
mov edi, eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
test esi, esi
jne 0x40e0c2
mov eax, str.CSystemCommands::GetSafeEnv__GetEnvironmentVariableA_fails
lea ecx, [ebp - 0x28]
call fcn.004034a0
lea edx, [ebp - 0x28]
push edx
mov byte [ebp - 4], 4
call fcn.00403580
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x10], 8
jb 0x40dff3
mov eax, dword [ebp - 0x24]
push eax
call fcn.0047cc0e
add esp, 4
push str.APPDATA
push ebx
call fcn.004ab649
add esp, 8
test eax, eax
jne 0x40e00e
push eax
push 0x1c
lea ecx, [ebp + 0x1c]
push ecx
jmp 0x40e042
push str.COMMONAPPDATA
push ebx
call fcn.004ab649
add esp, 8
test eax, eax
jne 0x40e029
push eax
push 0x23
lea edx, [ebp + 0x1c]
push edx
jmp 0x40e042
push str.ProgramFiles
push ebx
call fcn.004ab649
add esp, 8
test eax, eax
jne 0x40e04e
push eax
push 0x26
lea eax, [ebp + 0x1c]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
jne 0x40e080
mov eax, str.CSystemCommands::GetSafeEnv__failed_to_read_folder_name
lea ecx, [ebp - 0x48]
call fcn.004034a0
lea ecx, [ebp - 0x48]
push ecx
mov byte [ebp - 4], 5
call fcn.00403580
add esp, 4
lea esi, [ebp - 0x48]
call fcn.004092a0
lea esi, [ebp]
call fcn.004092a0
jmp 0x40e1b6
mov esi, dword [ebp - 0x2c]
push esi
lea eax, [ebp + 0x1c]
call fcn.0040ae50
mov eax, str.CSystemCommands::GetSafeEnv__using_SHGetSpecialFolderPath__returns:
lea ecx, [ebp - 0x48]
call fcn.004034a0
lea edx, [ebp - 0x48]
push edx
mov ecx, esi
mov byte [ebp - 4], 6
call fcn.00402ec0
add esp, 4
lea esi, [ebp - 0x48]
call fcn.004092a0
lea esi, [ebp]
call fcn.004092a0
mov al, 1
jmp 0x40e1b8
test edi, edi
jne 0x40e0ca
xor eax, eax
jmp 0x40e0f4
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
inc esi
cmp esi, 0x3fffffff
jle 0x40e0e0
xor eax, eax
jmp 0x40e0f4
lea eax, [esi + esi]
call fcn.004a2b80
mov eax, esp
push 3
push esi
push edi
push eax
call fcn.0040b600
mov ecx, eax
lea esi, [ecx + 2]
lea esp, [esp]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x40e100
sub ecx, esi
mov esi, dword [ebp - 0x2c]
sar ecx, 1
push ecx
call fcn.004033f0
test edi, edi
je 0x40e125
push edi
call fcn.0047cc0e
add esp, 4
mov eax, str.CSystemCommands::GetSafeEnv__returns:
lea ecx, [ebp - 0x48]
call fcn.004034a0
lea eax, [ebp - 0x48]
push eax
mov ecx, esi
mov byte [ebp - 4], 7
call fcn.00402ec0
mov esi, 8
add esp, 4
cmp dword [ebp - 0x30], esi
jb 0x40e15a
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.0047cc0e
add esp, 4
cmp dword [ebp + 0x18], esi
jb 0x40e16b
mov edx, dword [ebp + 4]
push edx
call fcn.0047cc0e
add esp, 4
mov al, 1
jmp 0x40e1b8
xor eax, eax
mov word [ebp - 0x24], ax
push 0x35
mov eax, str.CSystemCommands::GetSafeEnv____varName__NULL__quits
lea esi, [ebp - 0x28]
mov dword [ebp - 0x10], 7
mov dword [ebp - 0x14], 0
call fcn.004033f0
mov ecx, esi
push ecx
mov dword [ebp - 4], 1
call fcn.00403580
add esp, 4
cmp dword [ebp - 0x10], 8
jb 0x40e1b6
mov edx, dword [ebp - 0x24]
push edx
call fcn.0047cc0e
add esp, 4
xor al, al
lea esp, [ebp - 0x58]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp + 0x224]
xor ecx, ebp
call fcn.0049bee5
add ebp, 0x228
mov esp, ebp
pop ebp
ret