Function at 0x406a31
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x406a4f
mov ecx, dword [0x42bbbc]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x42cc38]
push ebx
push esi
push edi
lea edx, [ecx + eax*2]
mov eax, 0x429b80
cmp dword [ebp + 8], eax
mov esi, eax
jb 0x406c7d
mov ecx, dword [ebp + 8]
sub ecx, eax
sar ecx, 1
cmp ecx, 0x800
jae 0x406c7d
mov esi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x406c7d
mov ecx, esi
sub ecx, eax
and ecx, 0xfffffffe
cmp ecx, 0x800
jge 0x406c89
push 2
pop ecx
add edx, ecx
cmp di, 4
mov dword [ebp + 0xc], edx
jae 0x406c6a
mov cl, byte [edx + 1]
mov al, byte [edx]
mov dl, cl
mov bl, al
and edx, 0x7f
and ebx, 0x7f
shl edx, 7
movzx eax, al
or edx, ebx
mov ebx, eax
mov dword [ebp - 4], edx
mov edx, 0x8000
or ebx, edx
add dword [ebp + 0xc], 2
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], eax
movzx ebx, cl
mov ecx, ebx
mov dword [ebp - 0xc], ebx
or ecx, edx
cmp di, 2
mov dword [ebp - 0x10], ecx
jne 0x406c0d
mov ecx, dword [0x42cbec]
push 2
test ecx, ecx
pop edi
jns 0x406b17
cmp cx, 0x5a04
je 0x406b17
cmp ebx, 0x23
je 0x406b17
cmp ebx, 0x2e
je 0x406b17
and dword [ebp - 4], 0
jmp 0x406b1e
mov dword [ebp - 4], 1
cmp dword [0x42cc84], 0
je 0x406b2a
push 4
pop edi
test al, al
jns 0x406b67
mov ecx, eax
and eax, 0x3f
and ecx, 0x40
push ecx
mov ecx, dword [0x42cc38]
push esi
lea eax, [ecx + eax*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.004068dd
cmp word [esi], 0
jne 0x406bf5
push ebx
push esi
call fcn.00406a31
jmp 0x406bec
cmp eax, 0x25
jne 0x406b7a
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x406bec
cmp eax, 0x24
jne 0x406be8
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor edi, edi
jmp 0x406be8
mov eax, dword [0x42cbe4]
xor ecx, ecx
dec edi
cmp eax, ecx
je 0x406bb3
cmp dword [ebp - 4], ecx
je 0x406bb3
push esi
push ecx
push ecx
push dword [ebp + edi*4 - 0x18]
push dword [0x42cbe8]
call eax
test eax, eax
je 0x406bec
lea eax, [ebp - 8]
push eax
push dword [ebp + edi*4 - 0x18]
push dword [0x42cbe8]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406be4
push esi
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push dword [ebp - 8]
mov ebx, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test ebx, ebx
jne 0x406bec
and word [esi], 0
test edi, edi
jne 0x406b8f
cmp word [esi], 0
je 0x406c05
mov ebx, dword [ebp - 0xc]
cmp ebx, 0x1a
jne 0x406c05
push str.MicrosoftInternet_ExplorerQuick_Launch
push esi
call sub.KERNEL32.dll_lstrcatW
push esi
call fcn.00406ca3
jmp 0x406c57
cmp di, 3
jne 0x406c44
mov edi, dword [ebp - 4]
cmp edi, 0x1d
jne 0x406c29
push dword [0x42cbe8]
push esi
call fcn.00406956
jmp 0x406c3a
mov eax, edi
shl eax, 0xb
add eax, section..ndata
push eax
push esi
call fcn.00406a0f
add edi, 0xffffffeb
cmp edi, 7
jae 0x406c57
jmp 0x406c05
cmp di, 1
jne 0x406c57
or eax, 0xffffffff
sub eax, dword [ebp - 4]
push eax
push esi
call fcn.00406a31
push esi
call sub.KERNEL32.dll_lstrlenW
mov edx, dword [ebp + 0xc]
lea esi, [esi + eax*2]
mov eax, 0x429b80
jmp 0x406c7d
jne 0x406c78
mov di, word [edx]
mov word [esi], di
add esi, ecx
add edx, ecx
jmp 0x406c7d
mov word [esi], di
add esi, ecx
mov di, word [edx]
test di, di
jne 0x406a8a
and word [esi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x406c9f
push eax
push dword [ebp + 8]
call fcn.00406a0f
leave
ret 8