Function at 0x40854f
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x40856d
mov ecx, dword [0x438f1c]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x439f98]
push ebx
push esi
push edi
lea ecx, [ecx + eax*2]
mov eax, 0x436ee0
cmp dword [ebp + 8], eax
mov edi, eax
jb 0x4087a4
mov edx, dword [ebp + 8]
sub edx, eax
sar edx, 1
cmp edx, 0x800
jae 0x4087a4
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x4087a4
mov esi, edi
sub esi, eax
and esi, 0xfffffffe
cmp esi, 0x800
jge 0x4087b3
push 2
mov esi, 0xe000
pop ebx
add ecx, ebx
test si, dx
je 0x40878e
cmp dx, si
jbe 0x408791
movzx eax, word [ecx]
mov esi, eax
and eax, 0xff
mov ebx, eax
mov eax, 0x8000
mov edx, ebx
and esi, 0x7fff
or edx, eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], edx
movzx edx, byte [ecx + 1]
mov dword [ebp - 0xc], edx
or edx, eax
inc ecx
mov dword [ebp - 0x10], edx
inc ecx
cmp word [ebp + 0xc], 0xe002
mov dword [ebp - 8], ecx
jne 0x40872f
push 2
pop esi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x40863a
cmp ax, 0x5a04
je 0x40863a
cmp dword [ebp - 0xc], 0x23
je 0x40863a
cmp dword [ebp - 0xc], 0x2e
je 0x40863a
and dword [ebp + 0xc], 0
jmp 0x408641
mov dword [ebp + 0xc], 1
cmp dword [0x439fc4], 0
je 0x40864d
push 4
pop esi
test bl, bl
jns 0x40868b
mov eax, ebx
and ebx, 0x3f
and eax, 0x40
push eax
mov eax, dword [0x439f98]
push edi
lea eax, [eax + ebx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.004084b3
cmp word [edi], 0
jne 0x408716
push dword [ebp - 0xc]
push edi
call fcn.0040854f
jmp 0x408710
cmp ebx, 0x25
jne 0x40869e
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x408710
cmp ebx, 0x24
jne 0x40870c
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor esi, esi
jmp 0x40870c
mov eax, dword [0x439f64]
xor ecx, ecx
dec esi
cmp eax, ecx
je 0x4086d7
cmp dword [ebp + 0xc], ecx
je 0x4086d7
push edi
push ecx
push ecx
push dword [ebp + esi*4 - 0x18]
push dword [0x439f68]
call eax
test eax, eax
je 0x408710
lea eax, [ebp - 4]
push eax
push dword [ebp + esi*4 - 0x18]
push dword [0x439f68]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x408708
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 0x408710
and word [edi], 0
test esi, esi
jne 0x4086b3
cmp word [edi], 0
je 0x408727
cmp dword [ebp - 0xc], 0x1a
jne 0x408727
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call sub.KERNEL32.dll_lstrcatW
push edi
call fcn.004087cd
jmp 0x40877b
cmp word [ebp + 0xc], 0xe001
jne 0x408767
cmp esi, 0x1d
jne 0x40874c
push edi
push 0
push dword [0x439f68]
call fcn.00404d49
jmp 0x40875d
mov eax, esi
shl eax, 0xb
add eax, section..ndata
push eax
push edi
call fcn.0040852d
add esi, 0xffffffeb
cmp esi, 7
jae 0x40877b
jmp 0x408727
cmp word [ebp + 0xc], 0xe003
jne 0x40877b
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.0040854f
push edi
call sub.KERNEL32.dll_lstrlenW
mov ecx, dword [ebp - 8]
lea edi, [edi + eax*2]
mov eax, 0x436ee0
jmp 0x4087a4
cmp dx, si
jne 0x40879f
mov dx, word [ecx]
mov word [edi], dx
add edi, ebx
add ecx, ebx
jmp 0x4087a4
mov word [edi], dx
add edi, ebx
mov dx, word [ecx]
test dx, dx
mov dword [ebp + 0xc], edx
jne 0x4085a8
and word [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x4087c9
push eax
push dword [ebp + 8]
call fcn.0040852d
leave
ret 8