Function at 0x409020
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 0x409420
mov esi, dword [ebp + 0xc]
cmp esi, 1
jl 0x409420
push 0x25
push ebx
call fcn.0040e3c0
add esp, 8
test eax, eax
je 0x409415
push esi
call fcn.0040e365
add esp, 4
test eax, eax
mov dword [esp + 0x10], eax
je 0x409415
jmp 0x409080
xor eax, eax
push str._TEMP_
mov ecx, 0x82
lea edi, [esp + 0x1c]
push ebx
rep stosd dword es:[edi], eax
call fcn.0040a330
add esp, 8
test eax, eax
je 0x409156
lea eax, [esp + 0x18]
push eax
push 0x207
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov al, byte [esp + 0x18]
test al, al
jne 0x4090e3
mov edx, dword [0x41b80c]
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 0x40929a
lea eax, [esp + 0x18]
push str._temp
push eax
call fcn.0040a330
add esp, 8
test eax, eax
jne 0x409142
cmp byte [esp + 0x19], 0x3a
jne 0x40912f
cmp byte [esp + 0x1a], 0x5c
jne 0x40912f
mov dl, byte [0x41b7fc]
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 0x40929a
mov eax, dword [str.C:Temp]
mov ecx, dword [0x41b80c]
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 0x40929a
push str._TMP_
push ebx
call fcn.0040a330
add esp, 8
test eax, eax
je 0x40921b
lea ecx, [esp + 0x18]
push ecx
push 0x207
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov al, byte [esp + 0x18]
test al, al
jne 0x4091ab
mov eax, dword [0x41b80c]
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 0x40929a
lea ecx, [esp + 0x18]
push str._temp
push ecx
call fcn.0040a330
add esp, 8
test eax, eax
jne 0x40920a
cmp byte [esp + 0x19], 0x3a
jne 0x4091f6
cmp byte [esp + 0x1a], 0x5c
jne 0x4091f6
mov al, byte [0x41b7fc]
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 0x40929a
mov ecx, dword [str.C:Temp]
mov edx, dword [0x41b80c]
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 0x40929a
push str._USERNAME_
push ebx
call fcn.0040a330
add esp, 8
test eax, eax
je 0x40925d
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 0x409400
lea ecx, [esp + 0x18]
push ecx
push str._USERNAME_
jmp 0x409295
push str._WINDIR_
push ebx
call fcn.0040a330
add esp, 8
test eax, eax
je 0x4092cc
push 0x207
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x409400
lea ecx, [esp + 0x18]
push ecx
push str._WINDIR_
mov edx, dword [esp + 0x18]
push edx
push esi
push ebx
call fcn.00408ed0
add esp, 0x14
test eax, eax
je 0x409080
mov ecx, dword [esp + 0x10]
push ecx
mov dword [esp + 0x10], 0xffffffff
call fcn.0040e24d
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.0040a330
add esp, 8
test eax, eax
je 0x4093b6
push 0x207
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x409400
lea eax, [esp + 0x18]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409305
sub eax, edx
mov esi, eax
cmp esi, 7
jl 0x40932f
lea edi, [esp + esi + 0x11]
push str._system
push edi
call fcn.0040f01d
add esp, 8
test eax, eax
jne 0x40932f
mov byte [edi], al
jmp 0x40938a
cmp esi, 8
jl 0x40934e
lea edi, [esp + esi + 0x10]
push str._system_
push edi
call fcn.0040f01d
add esp, 8
test eax, eax
jne 0x40934e
mov byte [edi], al
jmp 0x40938a
cmp esi, 9
jl 0x40936d
lea edi, [esp + esi + 0xf]
push str._system32
push edi
call fcn.0040f01d
add esp, 8
test eax, eax
jne 0x40936d
mov byte [edi], al
jmp 0x40938a
cmp esi, 0xa
jl 0x40938a
lea esi, [esp + esi + 0xe]
push str._system32
push esi
call fcn.0040f01d
add esp, 8
test eax, eax
jne 0x40938a
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.00408ed0
add esp, 0x14
test eax, eax
jne 0x4092ac
mov esi, dword [ebp + 0xc]
jmp 0x409080
push str._SYSTEMDRIVE_
push ebx
call fcn.0040a330
add esp, 8
test eax, eax
je 0x409408
push 0x207
lea ecx, [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov al, byte [esp + 0x18]
test al, al
je 0x409400
cmp byte [esp + 0x19], 0x3a
jne 0x409400
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
push str._SYSTEMDRIVE_
mov byte [esp + 0x22], 0
push eax
jmp 0x40929a
mov dword [esp + 0xc], 1
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0040e24d
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