Function at 0x4064e8
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
test ebx, ebx
jge 0x406509
mov ecx, dword [0x44eb1c]
lea eax, [ebx*4 + 4]
sub ecx, eax
mov ebx, dword [ecx]
mov eax, dword [0x452b78]
mov ecx, dword [ebp + 8]
add ebx, eax
mov eax, 0x442ac0
sub ecx, eax
mov edi, eax
cmp ecx, 0x4000
jae 0x40652b
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
mov dl, byte [ebx]
test dl, dl
je 0x40670f
mov ecx, edi
sub ecx, eax
cmp ecx, 0x2000
jge 0x40670f
inc ebx
cmp dl, 0xfc
mov dword [ebp + 0xc], ebx
jbe 0x4066fa
movsx eax, byte [ebx + 1]
movsx ecx, byte [ebx]
mov esi, eax
mov ebx, ecx
and esi, 0x7f
and ebx, 0x7f
shl esi, 7
or esi, ebx
mov ebx, 0x8000
mov dword [ebp - 0x14], eax
or eax, ebx
mov dword [ebp - 0x1c], ecx
push 2
or ecx, ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x10], eax
pop eax
add ebx, eax
cmp dl, 0xfe
mov dword [ebp - 0x18], ecx
jne 0x4066a4
and dword [ebp - 4], 0
and dword [ebp + 0xc], 0
and byte [edi], 0
push 4
pop esi
cmp dword [ebp - 0x14], esi
jne 0x4065ad
mov dword [ebp - 4], 0x40aab0
mov dword [ebp + 0xc], eax
jmp 0x40661c
mov eax, dword [ebp - 0x1c]
cmp eax, 0x2b
jne 0x4065cc
push edi
push 0x40aaa0
push 0x40aa74
push 0x80000002
call fcn.004063a7
jmp 0x40661c
cmp eax, 0x26
jne 0x4065f8
push edi
push 0x40aa64
push 0x40aa74
push 0x80000002
call fcn.004063a7
cmp byte [edi], 0
jne 0x406634
push 0x40aa50
push edi
call fcn.004064b4
jmp 0x40661c
cmp eax, 0x25
jne 0x40660b
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x40661c
cmp eax, 0x24
jne 0x40661c
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp byte [edi], 0
jne 0x406634
cmp dword [0x452bc4], 0
mov dword [ebp + 0xc], esi
jne 0x406634
mov dword [ebp + 0xc], 2
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
test eax, eax
je 0x406688
mov eax, dword [ebp + 0xc]
lea esi, [ebp + eax*4 - 0x1c]
lea eax, [ebp - 8]
push eax
push dword [esi]
push dword [0x452b44]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406678
push edi
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 8]
mov dword [ebp - 0xc], eax
call fcn.00405ca1
cmp dword [ebp - 0xc], 0
jne 0x406688
jmp 0x40667b
and byte [edi], 0
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
sub esi, 4
test eax, eax
jne 0x406645
cmp byte [edi], 0
je 0x40669c
cmp dword [ebp - 4], 0
je 0x40669c
push dword [ebp - 4]
push edi
call fcn.004064d7
push edi
call fcn.00406728
jmp 0x4066e8
cmp dl, 0xfd
jne 0x4066d7
cmp esi, 0x1b
jne 0x4066bc
push dword [0x452b44]
push edi
call fcn.00406411
jmp 0x4066cd
mov eax, esi
shl eax, 0xd
add eax, section..ndata
push eax
push edi
call fcn.004064b4
add esi, 0xffffffeb
cmp esi, 6
jae 0x4066e8
jmp 0x40669c
cmp dl, 0xff
jne 0x4066e8
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.004064e8
push edi
call fcn.004064ca
add edi, eax
mov eax, 0x442ac0
jmp 0x40652b
jne 0x406707
mov cl, byte [ebx]
mov byte [edi], cl
inc edi
inc ebx
jmp 0x40652b
mov byte [edi], dl
inc edi
jmp 0x40652b
and byte [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x406724
push eax
push dword [ebp + 8]
call fcn.004064b4
leave
ret 8