Function at 0x405ef7
Capabilities:
Get common file path

Disassembly:
mov ecx, dword [esp + 8]
sub esp, 0x1c
test ecx, ecx
jns 0x405f13
lea eax, [ecx*4 + 4]
mov ecx, dword [0x443fec]
sub ecx, eax
mov ecx, dword [ecx]
mov edx, dword [esp + 0x20]
push ebx
push ebp
mov ebp, dword [0x448038]
mov ebx, 0x43ffa0
add ebp, ecx
push edi
mov edi, ebx
cmp edx, ebx
jb 0x405f3f
mov eax, edx
sub eax, ebx
cmp eax, 0x4000
jae 0x405f3f
and dword [esp + 0x2c], 0
mov edi, edx
mov cl, byte [ebp]
test cl, cl
je 0x40614b
push esi
mov eax, edi
sub eax, ebx
cmp eax, 0x2000
jge 0x40614a
inc ebp
cmp cl, 4
jae 0x406131
movsx edx, byte [ebp + 1]
movsx ebx, byte [ebp]
mov esi, edx
and esi, 0x7f
mov eax, ebx
and eax, 0x7f
shl esi, 7
or esi, eax
mov eax, ebx
or eax, 0x8000
mov dword [esp + 0x1c], eax
mov eax, edx
or eax, 0x8000
add ebp, 2
mov dword [esp + 0x34], edx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edx
mov dword [esp + 0x18], ebp
cmp cl, 2
jne 0x4060d7
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov esi, dword [esp + 0x34]
test eax, eax
jns 0x405fd6
mov ecx, 0x5a04
cmp ax, cx
je 0x405fd6
cmp esi, 0x23
je 0x405fd6
cmp esi, 0x2e
je 0x405fd6
and dword [esp + 0x10], 0
jmp 0x405fde
mov dword [esp + 0x10], 1
cmp dword [0x4480c4], 0
push 2
pop ebp
push 4
pop eax
cmovne ebp, eax
test bl, bl
jns 0x406027
mov eax, ebx
and eax, 0x40
push eax
push edi
and ebx, 0x3f
add ebx, dword [0x448038]
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00406a00
cmp byte [edi], 0
jne 0x4060b8
push esi
push edi
call fcn.00405ef7
jmp 0x4060b3
cmp ebx, 0x25
jne 0x40603a
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x4060b3
cmp ebx, 0x24
jne 0x40604d
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
xor ebp, ebp
test ebp, ebp
je 0x4060b3
mov ebx, dword [esp + 0x10]
mov eax, dword [0x443ff0]
dec ebp
test eax, eax
je 0x406078
test ebx, ebx
je 0x406078
push edi
push 0
push 0
push dword [esp + ebp*4 + 0x28]
push dword [0x443ff8]
call eax
test eax, eax
je 0x4060b3
lea eax, [esp + 0x14]
push eax
push dword [esp + ebp*4 + 0x20]
push dword [0x443ff8]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x4060ac
push edi
push dword [esp + 0x18]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [esp + 0x14]
mov esi, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test esi, esi
jne 0x4060b3
mov byte [edi], 0
test ebp, ebp
jne 0x406055
cmp byte [edi], 0
je 0x4060cb
cmp dword [esp + 0x34], 0x1a
jne 0x4060cb
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push edi
call fcn.00406d0e
mov ebp, dword [esp + 0x18]
jmp 0x406121
cmp cl, 3
jne 0x406110
cmp esi, 0x1d
jne 0x4060ef
push dword [0x443ff8]
push edi
call fcn.00406574
jmp 0x406100
mov eax, esi
shl eax, 0xd
add eax, section..ndata
push eax
push edi
call fcn.00406b7d
lea eax, [esi - 0x15]
cmp eax, 7
jae 0x406121
push edi
call fcn.00406d0e
jmp 0x406121
cmp cl, 1
jne 0x406121
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00405ef7
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add edi, eax
mov ebx, 0x43ffa0
jmp 0x40613f
jne 0x40613c
mov al, byte [ebp]
mov byte [edi], al
inc edi
inc ebp
jmp 0x40613f
mov byte [edi], cl
inc edi
mov cl, byte [ebp]
test cl, cl
jne 0x405f4b
pop esi
mov eax, dword [esp + 0x2c]
mov byte [edi], 0
test eax, eax
je 0x40615f
push ebx
push eax
call fcn.00406b7d
jmp 0x406161
mov eax, ebx
pop edi
pop ebp
pop ebx
add esp, 0x1c
ret 8