Function at 0x406789
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub esp, 0x18
test eax, eax
jge 0x4067a7
mov ecx, dword [0x46ada8]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x472df8]
lea ecx, [ecx + eax*2]
mov eax, 0x462540
push edi
mov edi, eax
cmp dword [ebp + 8], eax
jb 0x4067d3
mov edx, dword [ebp + 8]
sub edx, eax
sar edx, 1
cmp edx, 0x4008
jae 0x4067d3
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
movzx edx, word [ecx]
test dx, dx
je 0x406a02
push ebx
push esi
mov esi, edi
sub esi, eax
and esi, 0xfffffffe
cmp esi, 0x4008
jge 0x406a00
movzx edx, dx
inc ecx
mov esi, 0xe000
inc ecx
mov dword [ebp + 0xc], edx
test esi, edx
je 0x4069de
mov ebx, esi
cmp dx, bx
jbe 0x4069de
movzx eax, word [ecx]
mov ebx, eax
mov esi, eax
shr eax, 8
and ebx, 0xff
mov dword [ebp - 0xc], eax
or eax, 0x8000
mov edx, ebx
or edx, 0x8000
and esi, 0x7fff
inc ecx
mov dword [ebp - 0x10], eax
inc ecx
mov eax, 0xe002
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], edx
mov dword [ebp - 8], ecx
cmp word [ebp + 0xc], ax
jne 0x406971
push 2
pop esi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x406880
mov ecx, 0x5a04
cmp ax, cx
je 0x406880
cmp dword [ebp - 0xc], 0x23
je 0x406880
cmp dword [ebp - 0xc], 0x2e
je 0x406880
and dword [ebp + 0xc], 0
jmp 0x406887
mov dword [ebp + 0xc], 1
cmp dword [0x472e84], 0
je 0x406893
push 4
pop esi
test bl, bl
jns 0x4068d1
mov eax, ebx
and eax, 0x40
push eax
mov eax, dword [0x472df8]
push edi
and ebx, 0x3f
lea eax, [eax + ebx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00405e89
cmp word [edi], 0
jne 0x40695d
push dword [ebp - 0xc]
push edi
call fcn.00406789
jmp 0x406957
cmp ebx, 0x25
jne 0x4068e4
push 0x2004
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x406957
cmp ebx, 0x24
jne 0x406953
push 0x2004
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor esi, esi
jmp 0x406953
mov eax, dword [0x472dd0]
xor ecx, ecx
dec esi
cmp eax, ecx
je 0x40691d
cmp dword [ebp + 0xc], ecx
je 0x40691d
push edi
push ecx
push ecx
push dword [ebp + esi*4 - 0x18]
push dword [0x472dd4]
call eax
test eax, eax
je 0x406957
lea eax, [ebp - 4]
push eax
push dword [ebp + esi*4 - 0x18]
push dword [0x472dd4]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x40694e
push edi
push dword [ebp - 4]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push dword [ebp - 4]
mov ebx, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test ebx, ebx
jne 0x406957
xor eax, eax
mov word [edi], ax
test esi, esi
jne 0x4068f9
cmp word [edi], 0
je 0x4069ab
cmp dword [ebp - 0xc], 0x1a
jne 0x4069ab
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
jmp 0x4069ab
mov eax, 0xe001
cmp word [ebp + 0xc], ax
jne 0x4069b3
cmp esi, 0x1d
jne 0x40698f
push dword [0x472dd4]
push edi
call fcn.00405f07
jmp 0x4069a3
mov eax, esi
imul eax, eax, 0x4008
add eax, section..ndata
push eax
push edi
call fcn.00405fc0
add esi, 0xffffffeb
cmp esi, 7
jae 0x4069ca
push edi
call fcn.00405fef
jmp 0x4069ca
mov eax, 0xe003
cmp word [ebp + 0xc], ax
jne 0x4069ca
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00406789
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebp - 8]
lea edi, [edi + eax*2]
mov eax, 0x462540
jmp 0x4069f4
cmp dx, si
jne 0x4069ef
mov dx, word [ecx]
mov word [edi], dx
inc edi
inc edi
inc ecx
inc ecx
jmp 0x4069f4
mov word [edi], dx
inc edi
inc edi
movzx edx, word [ecx]
test dx, dx
jne 0x4067e1
pop esi
pop ebx
xor ecx, ecx
mov word [edi], cx
pop edi
cmp dword [ebp + 8], ecx
je 0x406a16
push eax
push dword [ebp + 8]
call fcn.00405fc0
leave
ret 8