Function at 0x406587
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x4065a5
mov ecx, dword [0x4300fc]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x430978]
push ebx
push esi
push edi
lea ebx, [eax + ecx]
mov eax, 0x42f0c0
cmp dword [ebp + 8], eax
mov edi, eax
jb 0x4067ac
mov ecx, dword [ebp + 8]
sub ecx, eax
cmp ecx, 0x800
jae 0x4067ac
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x4067ac
mov ecx, edi
sub ecx, eax
cmp ecx, 0x400
jge 0x4067b6
inc ebx
cmp dl, 4
mov dword [ebp + 0xc], ebx
jae 0x40679f
movsx eax, byte [ebx + 1]
movsx ecx, byte [ebx]
mov esi, eax
mov ebx, ecx
and esi, 0x7f
and ebx, 0x7f
shl esi, 7
or esi, ebx
mov ebx, ecx
or bh, 0x80
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ebx
mov ebx, eax
or bh, 0x80
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp + 0xc]
inc ebx
inc ebx
cmp dl, 2
jne 0x40674c
mov eax, dword [0x43092c]
push 2
test eax, eax
pop esi
jns 0x406659
cmp ax, 0x5a04
je 0x406659
cmp dword [ebp - 0xc], 0x23
je 0x406659
cmp dword [ebp - 0xc], 0x2e
je 0x406659
and dword [ebp + 0xc], 0
jmp 0x406660
mov dword [ebp + 0xc], 1
cmp dword [0x4309c4], 0
je 0x40666c
push 4
pop esi
test cl, cl
jns 0x4066a7
mov eax, ecx
and ecx, 0x3f
add ecx, dword [0x430978]
and eax, 0x40
push eax
push edi
push ecx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.0040644c
cmp byte [edi], 0
jne 0x406733
push dword [ebp - 0xc]
push edi
call fcn.00406587
jmp 0x40672e
cmp ecx, 0x25
jne 0x4066ba
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x40672e
cmp ecx, 0x24
jne 0x40672a
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
xor esi, esi
jmp 0x40672a
mov eax, dword [0x430924]
xor ecx, ecx
dec esi
cmp eax, ecx
je 0x4066f3
cmp dword [ebp + 0xc], ecx
je 0x4066f3
push edi
push ecx
push ecx
push dword [ebp + esi*4 - 0x18]
push dword [0x430928]
call eax
test eax, eax
je 0x40672e
lea eax, [ebp - 4]
push eax
push dword [ebp + esi*4 - 0x18]
push dword [0x430928]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406727
push edi
push dword [ebp - 4]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 4]
mov dword [ebp - 8], eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
cmp dword [ebp - 8], 0
jne 0x40672e
and byte [edi], 0
test esi, esi
jne 0x4066cf
cmp byte [edi], 0
je 0x406744
cmp dword [ebp - 0xc], 0x1a
jne 0x406744
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call sub.KERNEL32.dll_lstrcatA
push edi
call fcn.004067cf
jmp 0x406790
cmp dl, 3
jne 0x40677f
cmp esi, 0x1d
jne 0x406764
push dword [0x430928]
push edi
call fcn.004064c3
jmp 0x406775
mov eax, esi
shl eax, 0xa
add eax, section..ndata
push eax
push edi
call fcn.00406565
add esi, 0xffffffeb
cmp esi, 7
jae 0x406790
jmp 0x406744
cmp dl, 1
jne 0x406790
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00406587
push edi
call sub.KERNEL32.dll_lstrlenA
add edi, eax
mov eax, 0x42f0c0
jmp 0x4067ac
jne 0x4067a9
mov cl, byte [ebx]
mov byte [edi], cl
inc edi
inc ebx
jmp 0x4067ac
mov byte [edi], dl
inc edi
mov dl, byte [ebx]
test dl, dl
jne 0x4065de
and byte [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x4067cb
push eax
push dword [ebp + 8]
call fcn.00406565
leave
ret 8