Function at 0x408550
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x40856e
mov ecx, dword [0x477f3c]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x47ffb8]
push ebx
push esi
push edi
lea ecx, [ecx + eax*2]
mov eax, 0x46eee0
cmp dword [ebp + 8], eax
mov edi, eax
jb 0x4087a5
mov edx, dword [ebp + 8]
sub edx, eax
sar edx, 1
cmp edx, 0x4000
jae 0x4087a5
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x4087a5
mov esi, edi
sub esi, eax
and esi, 0xfffffffe
cmp esi, 0x4000
jge 0x4087b4
push 2
mov esi, 0xe000
pop ebx
add ecx, ebx
test si, dx
je 0x40878f
cmp dx, si
jbe 0x408792
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 0x408730
push 2
pop esi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x40863b
cmp ax, 0x5a04
je 0x40863b
cmp dword [ebp - 0xc], 0x23
je 0x40863b
cmp dword [ebp - 0xc], 0x2e
je 0x40863b
and dword [ebp + 0xc], 0
jmp 0x408642
mov dword [ebp + 0xc], 1
cmp dword [0x47ffe4], 0
je 0x40864e
push 4
pop esi
test bl, bl
jns 0x40868c
mov eax, ebx
and ebx, 0x3f
and eax, 0x40
push eax
mov eax, dword [0x47ffb8]
push edi
lea eax, [eax + ebx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.004084b4
cmp word [edi], 0
jne 0x408717
push dword [ebp - 0xc]
push edi
call fcn.00408550
jmp 0x408711
cmp ebx, 0x25
jne 0x40869f
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x408711
cmp ebx, 0x24
jne 0x40870d
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor esi, esi
jmp 0x40870d
mov eax, dword [0x47ff84]
xor ecx, ecx
dec esi
cmp eax, ecx
je 0x4086d8
cmp dword [ebp + 0xc], ecx
je 0x4086d8
push edi
push ecx
push ecx
push dword [ebp + esi*4 - 0x18]
push dword [0x47ff88]
call eax
test eax, eax
je 0x408711
lea eax, [ebp - 4]
push eax
push dword [ebp + esi*4 - 0x18]
push dword [0x47ff88]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x408709
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 0x408711
and word [edi], 0
test esi, esi
jne 0x4086b4
cmp word [edi], 0
je 0x408728
cmp dword [ebp - 0xc], 0x1a
jne 0x408728
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call sub.KERNEL32.dll_lstrcatW
push edi
call fcn.004087ce
jmp 0x40877c
cmp word [ebp + 0xc], 0xe001
jne 0x408768
cmp esi, 0x1d
jne 0x40874d
push edi
push 0
push dword [0x47ff88]
call fcn.00404d49
jmp 0x40875e
mov eax, esi
shl eax, 0xe
add eax, section..ndata
push eax
push edi
call fcn.0040852e
add esi, 0xffffffeb
cmp esi, 7
jae 0x40877c
jmp 0x408728
cmp word [ebp + 0xc], 0xe003
jne 0x40877c
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00408550
push edi
call sub.KERNEL32.dll_lstrlenW
mov ecx, dword [ebp - 8]
lea edi, [edi + eax*2]
mov eax, 0x46eee0
jmp 0x4087a5
cmp dx, si
jne 0x4087a0
mov dx, word [ecx]
mov word [edi], dx
add edi, ebx
add ecx, ebx
jmp 0x4087a5
mov word [edi], dx
add edi, ebx
mov dx, word [ecx]
test dx, dx
mov dword [ebp + 0xc], edx
jne 0x4085a9
and word [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x4087ca
push eax
push dword [ebp + 8]
call fcn.0040852e
leave
ret 8