Function at 0x406106
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x406124
mov ecx, dword [0x472ebc]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x47af18]
push ebx
push esi
push edi
lea ecx, [ecx + eax*2]
mov eax, 0x46ae80
cmp dword [ebp + 8], eax
mov esi, eax
jb 0x406352
mov edx, dword [ebp + 8]
sub edx, eax
sar edx, 1
cmp edx, 0x4000
jae 0x406352
mov esi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x406352
mov edx, esi
sub edx, eax
and edx, 0xfffffffe
cmp edx, 0x4000
jge 0x40635e
push 2
pop edx
add ecx, edx
cmp di, 4
mov dword [ebp - 4], ecx
jae 0x40633f
mov al, byte [ecx + 1]
mov cl, byte [ecx]
mov dl, al
mov bl, cl
and edx, 0x7f
and ebx, 0x7f
shl edx, 7
add dword [ebp - 4], 2
or edx, ebx
movzx ebx, cl
movzx eax, al
mov dword [ebp + 0xc], edx
mov edx, ebx
mov ecx, 0x8000
mov dword [ebp - 0xc], eax
or edx, ecx
or eax, ecx
cmp di, 2
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x10], eax
jne 0x4062e0
push 2
pop edi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x4061eb
cmp ax, 0x5a04
je 0x4061eb
cmp dword [ebp - 0xc], 0x23
je 0x4061eb
cmp dword [ebp - 0xc], 0x2e
je 0x4061eb
and dword [ebp + 0xc], 0
jmp 0x4061f2
mov dword [ebp + 0xc], 1
cmp dword [0x47af64], 0
je 0x4061fe
push 4
pop edi
test bl, bl
jns 0x40623c
mov eax, ebx
and ebx, 0x3f
and eax, 0x40
push eax
mov eax, dword [0x47af18]
push esi
lea eax, [eax + ebx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00405fb1
cmp word [esi], 0
jne 0x4062c7
push dword [ebp - 0xc]
push esi
call fcn.00406106
jmp 0x4062c1
cmp ebx, 0x25
jne 0x40624f
push 0x2000
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x4062c1
cmp ebx, 0x24
jne 0x4062bd
push 0x2000
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor edi, edi
jmp 0x4062bd
mov eax, dword [0x47aee4]
xor ecx, ecx
dec edi
cmp eax, ecx
je 0x406288
cmp dword [ebp + 0xc], ecx
je 0x406288
push esi
push ecx
push ecx
push dword [ebp + edi*4 - 0x18]
push dword [0x47aee8]
call eax
test eax, eax
je 0x4062c1
lea eax, [ebp - 8]
push eax
push dword [ebp + edi*4 - 0x18]
push dword [0x47aee8]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x4062b9
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 0x4062c1
and word [esi], 0
test edi, edi
jne 0x406264
cmp word [esi], 0
je 0x4062d8
cmp dword [ebp - 0xc], 0x1a
jne 0x4062d8
push str.MicrosoftInternet_ExplorerQuick_Launch
push esi
call sub.KERNEL32.dll_lstrcatW
push esi
call fcn.00406378
jmp 0x40632c
cmp di, 3
jne 0x406319
cmp dword [ebp + 0xc], 0x1d
jne 0x4062fa
push dword [0x47aee8]
push esi
call fcn.0040602b
jmp 0x40630c
mov eax, dword [ebp + 0xc]
shl eax, 0xe
add eax, section..ndata
push eax
push esi
call fcn.004060e4
mov eax, dword [ebp + 0xc]
add eax, 0xffffffeb
cmp eax, 7
jae 0x40632c
jmp 0x4062d8
cmp di, 1
jne 0x40632c
or eax, 0xffffffff
sub eax, dword [ebp + 0xc]
push eax
push esi
call fcn.00406106
push esi
call sub.KERNEL32.dll_lstrlenW
mov ecx, dword [ebp - 4]
lea esi, [esi + eax*2]
mov eax, 0x46ae80
jmp 0x406352
jne 0x40634d
mov di, word [ecx]
mov word [esi], di
add esi, edx
add ecx, edx
jmp 0x406352
mov word [esi], di
add esi, edx
mov di, word [ecx]
test di, di
jne 0x40615f
and word [esi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x406374
push eax
push dword [ebp + 8]
call fcn.004060e4
leave
ret 8