Function at 0x406c9e
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
sub esp, 0x1c
test eax, eax
jns 0x406cbc
mov ecx, dword [0x798500]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x799558]
push esi
lea esi, [ecx + eax*2]
mov ecx, dword [ebp + 8]
mov eax, 0x796ce0
mov dword [ebp + 0xc], eax
cmp ecx, eax
jb 0x406cea
mov edx, ecx
sub edx, eax
sar edx, 1
cmp edx, 0x800
jae 0x406cea
and dword [ebp + 8], 0
mov dword [ebp + 0xc], ecx
movzx ecx, word [esi]
test cx, cx
je 0x406f20
push ebx
push edi
mov edx, dword [ebp + 0xc]
sub edx, eax
and edx, 0xfffffffe
cmp edx, 0x800
jge 0x406f1e
push 2
movzx ecx, cx
pop edx
add esi, edx
cmp ecx, 4
jae 0x406efd
mov al, byte [esi]
movsx edi, byte [esi + 1]
movsx edx, al
and edx, 0x7f
and edi, 0x7f
movzx ebx, al
shl edi, 7
or edi, edx
mov eax, 0x8000
mov edx, ebx
or edx, eax
mov dword [ebp - 0x1c], edx
movzx edx, byte [esi + 1]
mov dword [ebp - 0x10], edx
or edx, eax
add esi, 2
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0xc], esi
cmp ecx, 2
jne 0x406e97
push ecx
pop edi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x406d86
mov ecx, 0x5a04
cmp ax, cx
je 0x406d86
cmp dword [ebp - 0x10], 0x23
je 0x406d86
cmp dword [ebp - 0x10], 0x2e
je 0x406d86
and dword [ebp - 4], 0
jmp 0x406d8d
mov dword [ebp - 4], 1
cmp dword [0x799e04], 0
je 0x406d99
push 4
pop edi
test bl, bl
jns 0x406dde
mov ecx, dword [0x799558]
mov edi, dword [ebp + 0xc]
mov eax, ebx
and ebx, 0x3f
lea ecx, [ecx + ebx*2]
push ecx
push str.SoftwareMicrosoftWindowsCurrentVersion
and eax, 0x40
push 0x80000002
mov esi, edi
call fcn.00406b5a
cmp word [edi], 0
jne 0x406e7a
push dword [ebp - 0x10]
push edi
call fcn.00406c9e
mov esi, dword [ebp - 0xc]
jmp 0x406e72
cmp ebx, 0x25
jne 0x406df3
push 0x400
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x406e6f
cmp ebx, 0x24
jne 0x406e6b
push 0x400
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor edi, edi
jmp 0x406e6b
mov eax, dword [0x799520]
xor ecx, ecx
dec edi
cmp eax, ecx
je 0x406e30
cmp dword [ebp - 4], ecx
je 0x406e30
push dword [ebp + 0xc]
push ecx
push ecx
push dword [ebp + edi*4 - 0x1c]
push dword [0x799524]
call eax
test eax, eax
je 0x406e6f
lea eax, [ebp - 8]
push eax
push dword [ebp + edi*4 - 0x1c]
push dword [0x799524]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406e63
push dword [ebp + 0xc]
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push dword [ebp - 8]
mov ebx, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test ebx, ebx
jne 0x406e6f
mov ecx, dword [ebp + 0xc]
xor eax, eax
mov word [ecx], ax
test edi, edi
jne 0x406e0a
mov edi, dword [ebp + 0xc]
cmp word [edi], 0
je 0x406e8f
jmp 0x406e7d
mov esi, dword [ebp - 0xc]
cmp dword [ebp - 0x10], 0x1a
jne 0x406e8f
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push edi
call fcn.00406f3b
jmp 0x406ee4
cmp ecx, 3
jne 0x406ed1
cmp edi, 0x1d
jne 0x406eb1
push dword [0x799524]
push dword [ebp + 0xc]
call fcn.00406bd1
jmp 0x406ec4
mov eax, edi
shl eax, 0xb
add eax, section..ndata
push eax
push dword [ebp + 0xc]
call fcn.00406c86
add edi, 0xffffffeb
cmp edi, 7
jae 0x406ee4
push dword [ebp + 0xc]
jmp 0x406e90
cmp ecx, 1
jne 0x406ee4
or eax, 0xffffffff
sub eax, edi
push eax
push dword [ebp + 0xc]
call fcn.00406c9e
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebp + 0xc]
lea eax, [ecx + eax*2]
mov dword [ebp + 0xc], eax
mov eax, 0x796ce0
jmp 0x406f12
mov edi, dword [ebp + 0xc]
jne 0x406f0c
mov cx, word [esi]
add dword [ebp + 0xc], edx
add esi, edx
jmp 0x406f0f
add dword [ebp + 0xc], edx
mov word [edi], cx
movzx ecx, word [esi]
test cx, cx
jne 0x406cf8
pop edi
pop ebx
mov edx, dword [ebp + 0xc]
xor ecx, ecx
mov word [edx], cx
pop esi
cmp dword [ebp + 8], ecx
je 0x406f37
push eax
push dword [ebp + 8]
call fcn.00406c86
leave
ret 8