Function at 0x406a52
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
mov esi, dword [ebp + 0xc]
test esi, esi
jns 0x406a71
mov ecx, dword [0x791fe0]
lea eax, [esi*4 + 4]
sub ecx, eax
mov esi, dword [ecx]
mov ecx, dword [ebp + 8]
add esi, dword [0x792838]
mov eax, 0x7913c0
mov dword [ebp - 4], eax
cmp ecx, eax
jb 0x406a99
mov edx, ecx
sub edx, eax
cmp edx, 0x800
jae 0x406a99
and dword [ebp + 8], 0
mov dword [ebp - 4], ecx
mov cl, byte [esi]
mov byte [ebp + 0xf], cl
test cl, cl
je 0x406cbf
push ebx
push edi
jmp 0x406aad
mov cl, byte [ebp + 0xf]
mov edx, dword [ebp - 4]
sub edx, eax
cmp edx, 0x400
jge 0x406cbd
inc esi
cmp cl, 4
jae 0x406c9e
movsx eax, byte [esi + 1]
movsx ecx, byte [esi]
mov edi, eax
and edi, 0x7f
mov edx, ecx
and edx, 0x7f
shl edi, 7
or edi, edx
mov ebx, ecx
mov edx, 0x8000
or ebx, edx
mov dword [ebp - 0x1c], ebx
mov ebx, ecx
mov ecx, eax
or ecx, edx
add esi, 2
cmp byte [ebp + 0xf], 2
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], esi
jne 0x406c37
push 2
pop edi
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x406b32
mov ecx, 0x5a04
cmp ax, cx
je 0x406b32
cmp dword [ebp - 0x10], 0x23
je 0x406b32
cmp dword [ebp - 0x10], 0x2e
je 0x406b32
and dword [ebp + 0xc], 0
jmp 0x406b39
mov dword [ebp + 0xc], 1
cmp dword [0x792ce4], 0
je 0x406b45
push 4
pop edi
test bl, bl
jns 0x406b86
mov edi, dword [ebp - 4]
mov eax, ebx
and ebx, 0x3f
add ebx, dword [0x792838]
and eax, 0x40
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
mov esi, edi
call fcn.0040692d
cmp byte [edi], 0
jne 0x406c1f
push dword [ebp - 0x10]
push edi
call fcn.00406a52
mov esi, dword [ebp - 0xc]
jmp 0x406c15
cmp ebx, 0x25
jne 0x406b9b
push 0x400
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x406c15
cmp ebx, 0x24
jne 0x406c11
push 0x400
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
xor edi, edi
jmp 0x406c11
mov eax, dword [0x792800]
xor ecx, ecx
dec edi
cmp eax, ecx
je 0x406bd8
cmp dword [ebp + 0xc], ecx
je 0x406bd8
push dword [ebp - 4]
push ecx
push ecx
push dword [ebp + edi*4 - 0x1c]
push dword [0x792804]
call eax
test eax, eax
je 0x406c15
lea eax, [ebp - 8]
push eax
push dword [ebp + edi*4 - 0x1c]
push dword [0x792804]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406c0b
push dword [ebp - 4]
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 8]
mov ebx, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test ebx, ebx
jne 0x406c15
mov eax, dword [ebp - 4]
mov byte [eax], 0
test edi, edi
jne 0x406bb2
mov edi, dword [ebp - 4]
cmp byte [edi], 0
je 0x406c34
jmp 0x406c22
mov esi, dword [ebp - 0xc]
cmp dword [ebp - 0x10], 0x1a
jne 0x406c34
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push edi
jmp 0x406c70
cmp byte [ebp + 0xf], 3
jne 0x406c77
cmp edi, 0x1d
jne 0x406c52
push dword [0x792804]
push dword [ebp - 4]
call fcn.0040699d
jmp 0x406c65
mov eax, edi
shl eax, 0xa
add eax, section..ndata
push eax
push dword [ebp - 4]
call fcn.00406a3a
add edi, 0xffffffeb
cmp edi, 7
jae 0x406c8b
push dword [ebp - 4]
call fcn.00406cd9
jmp 0x406c8b
cmp byte [ebp + 0xf], 1
jne 0x406c8b
or eax, 0xffffffff
sub eax, edi
push eax
push dword [ebp - 4]
call fcn.00406a52
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add dword [ebp - 4], eax
mov eax, 0x7913c0
jmp 0x406cb0
mov edx, dword [ebp - 4]
jne 0x406cab
mov cl, byte [esi]
inc dword [ebp - 4]
inc esi
jmp 0x406cae
inc dword [ebp - 4]
mov byte [edx], cl
mov cl, byte [esi]
mov byte [ebp + 0xf], cl
test cl, cl
jne 0x406aaa
pop edi
pop ebx
cmp dword [ebp + 8], 0
mov ecx, dword [ebp - 4]
mov byte [ecx], 0
pop esi
je 0x406cd5
push eax
push dword [ebp + 8]
call fcn.00406a3a
leave
ret 8