Function at 0x40d4f0
Capabilities:
Get common file path
Get session user name

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x214
push ebx
mov ebx, dword [ebp + 8]
test ebx, ebx
push esi
push edi
mov dword [esp + 0xc], 0
je 0x40d8f0
mov esi, dword [ebp + 0xc]
cmp esi, 1
jl 0x40d8f0
push 0x25
push ebx
call fcn.00414460
add esp, 8
test eax, eax
je 0x40d8e5
push esi
call fcn.00414902
add esp, 4
test eax, eax
mov dword [esp + 0x10], eax
je 0x40d8e5
jmp 0x40d550
xor eax, eax
push str._TEMP_
mov ecx, 0x82
lea edi, [esp + 0x1c]
push ebx
rep stosd dword es:[edi], eax
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d626
lea eax, [esp + 0x18]
push eax
push 0x207
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov al, byte [esp + 0x18]
test al, al
jne 0x40d5b3
mov edx, dword [0x422cfc]
mov ecx, dword [str.C:Temp]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x1c], edx
lea edx, [esp + 0x18]
push edx
push str._TEMP_
mov dword [esp + 0x20], ecx
push eax
jmp 0x40d76a
lea eax, [esp + 0x18]
push str._temp
push eax
call fcn.0040e560
add esp, 8
test eax, eax
jne 0x40d612
cmp byte [esp + 0x19], 0x3a
jne 0x40d5ff
cmp byte [esp + 0x1a], 0x5c
jne 0x40d5ff
mov dl, byte [0x422cec]
mov ecx, dword [str.Temp]
mov eax, dword [esp + 0x10]
mov byte [esp + 0x1f], dl
lea edx, [esp + 0x18]
push edx
push str._TEMP_
mov dword [esp + 0x23], ecx
push eax
jmp 0x40d76a
mov eax, dword [str.C:Temp]
mov ecx, dword [0x422cfc]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
push str._TEMP_
push eax
jmp 0x40d76a
push str._TMP_
push ebx
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d6eb
lea ecx, [esp + 0x18]
push ecx
push 0x207
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov al, byte [esp + 0x18]
test al, al
jne 0x40d67b
mov eax, dword [0x422cfc]
mov edx, dword [str.C:Temp]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x18]
push eax
push str._TMP_
mov dword [esp + 0x20], edx
push ecx
jmp 0x40d76a
lea ecx, [esp + 0x18]
push str._temp
push ecx
call fcn.0040e560
add esp, 8
test eax, eax
jne 0x40d6da
cmp byte [esp + 0x19], 0x3a
jne 0x40d6c6
cmp byte [esp + 0x1a], 0x5c
jne 0x40d6c6
mov al, byte [0x422cec]
mov edx, dword [str.Temp]
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x1f], al
lea eax, [esp + 0x18]
push eax
push str._TMP_
mov dword [esp + 0x23], edx
push ecx
jmp 0x40d76a
mov ecx, dword [str.C:Temp]
mov edx, dword [0x422cfc]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x18]
push eax
push str._TMP_
push ecx
jmp 0x40d76a
push str._USERNAME_
push ebx
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d72d
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
mov dword [esp + 0x1c], 0x207
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
mov al, byte [esp + 0x18]
test al, al
je 0x40d8d0
lea ecx, [esp + 0x18]
push ecx
push str._USERNAME_
jmp 0x40d765
push str._WINDIR_
push ebx
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d79c
push 0x207
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x40d8d0
lea ecx, [esp + 0x18]
push ecx
push str._WINDIR_
mov edx, dword [esp + 0x18]
push edx
push esi
push ebx
call fcn.0040d3a0
add esp, 0x14
test eax, eax
je 0x40d550
mov ecx, dword [esp + 0x10]
push ecx
mov dword [esp + 0x10], 0xffffffff
call fcn.004143d6
mov eax, dword [esp + 0x10]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str._SYSTEMROOT_
push ebx
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d886
push 0x207
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x40d8d0
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d7d5
sub eax, edx
mov esi, eax
cmp esi, 7
jl 0x40d7ff
lea edi, [esp + esi + 0x11]
push str._system
push edi
call fcn.0041f7a1
add esp, 8
test eax, eax
jne 0x40d7ff
mov byte [edi], al
jmp 0x40d85a
cmp esi, 8
jl 0x40d81e
lea edi, [esp + esi + 0x10]
push str._system_
push edi
call fcn.0041f7a1
add esp, 8
test eax, eax
jne 0x40d81e
mov byte [edi], al
jmp 0x40d85a
cmp esi, 9
jl 0x40d83d
lea edi, [esp + esi + 0xf]
push str._system32
push edi
call fcn.0041f7a1
add esp, 8
test eax, eax
jne 0x40d83d
mov byte [edi], al
jmp 0x40d85a
cmp esi, 0xa
jl 0x40d85a
lea esi, [esp + esi + 0xe]
push str._system32
push esi
call fcn.0041f7a1
add esp, 8
test eax, eax
jne 0x40d85a
mov byte [esi], al
mov edx, dword [esp + 0x10]
mov eax, dword [ebp + 0xc]
lea ecx, [esp + 0x18]
push ecx
push str._SYSTEMROOT_
push edx
push eax
push ebx
call fcn.0040d3a0
add esp, 0x14
test eax, eax
jne 0x40d77c
mov esi, dword [ebp + 0xc]
jmp 0x40d550
push str._SYSTEMDRIVE_
push ebx
call fcn.0040e560
add esp, 8
test eax, eax
je 0x40d8d8
push 0x207
lea ecx, [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x40d8d0
cmp byte [esp + 0x19], 0x3a
jne 0x40d8d0
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
push str._SYSTEMDRIVE_
mov byte [esp + 0x22], 0
push eax
jmp 0x40d76a
mov dword [esp + 0xc], 1
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004143d6
add esp, 4
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret