Function at 0x40640e
Capabilities:
Check os version
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov edx, dword [ebp + 0xc]
test edx, edx
jns 0x406428
mov eax, dword [0x430298]
not edx
mov edx, dword [eax + edx*4]
mov eax, dword [ebp + 8]
mov ecx, dword [0x42f970]
mov dword [ebp - 0x34], 0x4302a8
sub eax, 0x4302a8
cmp eax, 0x7ff
ja 0x406451
mov eax, dword [ebp + 8]
mov dword [ebp + 8], 0
mov dword [ebp - 0x34], eax
add edx, ecx
mov dword [ebp - 0x38], edx
jmp 0x406691
inc dword [ebp - 0x38]
cmp dl, 0xfc
jbe 0x40666f
mov eax, dword [ebp - 0x38]
movsx eax, byte [eax + 1]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x38]
movsx esi, byte [eax]
mov eax, esi
or ah, 0x80
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x1c], esi
or ah, 0x80
cmp dl, 0xfe
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x14], eax
jne 0x4065e2
call sub.KERNEL32.dll_GetVersion
test eax, eax
jns 0x4064c1
cmp ax, 0x5a04
je 0x4064c1
cmp dword [ebp - 0x3c], 0x23
sete al
cmp dword [ebp - 0x3c], 0x2e
sete dl
or eax, edx
movzx eax, al
mov dword [ebp - 0x30], eax
jmp 0x4064c8
mov dword [ebp - 0x30], 1
cmp dword [0x42f8ec], 1
mov edx, esi
sbb edi, edi
and edi, 0xfffffffe
add edi, 4
test dl, dl
jns 0x406529
mov eax, esi
sub esp, 0xc
and eax, 0x40
and esi, 0x3f
push eax
xor edi, edi
push dword [ebp - 0x34]
add esi, dword [0x42f970]
push esi
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.0040638e
mov eax, dword [ebp - 0x34]
add esp, 0xc
cmp byte [eax], 0
jne 0x406520
push ecx
push ecx
push dword [ebp - 0x3c]
push dword [ebp - 0x34]
call fcn.0040640e
pop eax
xor edi, edi
pop edx
lea esi, [ebp + edi*4 - 0x24]
jmp 0x4065bf
cmp esi, 0x25
jne 0x40653f
push esi
push esi
push 0x400
push dword [ebp - 0x34]
call sub.KERNEL32.dll_GetSystemDirectoryA
jmp 0x40651c
cmp esi, 0x24
jne 0x406520
push ebx
push ebx
push 0x400
push dword [ebp - 0x34]
call sub.KERNEL32.dll_GetWindowsDirectoryA
jmp 0x40651c
mov eax, dword [0x42f9d8]
dec edi
test eax, eax
je 0x406580
cmp dword [ebp - 0x30], 0
je 0x406580
sub esp, 0xc
push dword [ebp - 0x34]
push 0
push 0
push dword [esi]
push dword [0x42f9e8]
call eax
add esp, 0xc
test eax, eax
je 0x4065c3
lea edx, [ebp - 0x10]
push ecx
push edx
push dword [esi]
push dword [0x42f9e8]
call sub.SHELL32.DLL_SHGetSpecialFolderLocation
pop edx
test eax, eax
jne 0x4065b6
push eax
push eax
push dword [ebp - 0x34]
push dword [ebp - 0x10]
call sub.SHELL32.DLL_SHGetPathFromIDListA
mov ebx, eax
push eax
push dword [ebp - 0x10]
call sub.OLE32.dll_CoTaskMemFree
add esp, 0xc
test ebx, ebx
jne 0x4065c3
mov eax, dword [ebp - 0x34]
sub esi, 4
mov byte [eax], 0
test edi, edi
jne 0x406555
mov edx, dword [ebp - 0x34]
cmp byte [edx], 0
je 0x406635
cmp dword [ebp - 0x3c], 0x1a
jne 0x406635
push ecx
push ecx
push str.MicrosoftInternet_ExplorerQuick_Launch
push edx
call sub.KERNEL32.dll_lstrcatA
pop eax
pop edx
jmp 0x406635
mov ebx, dword [ebp - 0x3c]
and esi, 0x7f
and ebx, 0x7f
shl ebx, 7
or ebx, esi
cmp dl, 0xfd
jne 0x406645
cmp ebx, 0x1d
jne 0x406613
push eax
push dword [0x42f9e8]
push 0x40a4bf
push dword [ebp - 0x34]
call sub.USER32.dll_wsprintfA
add esp, 0x10
jmp 0x40662d
push eax
mov eax, ebx
shl eax, 0xa
push 0x400
add eax, section..ndata
push eax
push dword [ebp - 0x34]
call sub.KERNEL32.dll_lstrcpynA
pop eax
lea eax, [ebx - 0x15]
cmp eax, 6
ja 0x406658
sub esp, 0xc
push dword [ebp - 0x34]
call fcn.004061ff
add esp, 0xc
jmp 0x406658
inc dl
jne 0x406658
push edi
not ebx
push edi
push ebx
push dword [ebp - 0x34]
call fcn.0040640e
pop ebx
pop esi
sub esp, 0xc
push dword [ebp - 0x34]
add dword [ebp - 0x38], 2
call sub.KERNEL32.dll_lstrlenA
add dword [ebp - 0x34], eax
add esp, 0xc
jmp 0x406691
mov eax, dword [ebp - 0x34]
lea ecx, [eax + 1]
jne 0x406689
mov edx, dword [ebp - 0x38]
mov al, byte [edx]
mov edx, dword [ebp - 0x34]
mov byte [edx], al
mov dword [ebp - 0x34], ecx
inc dword [ebp - 0x38]
jmp 0x406691
mov eax, dword [ebp - 0x34]
mov byte [eax], dl
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x38]
mov dl, byte [eax]
test dl, dl
je 0x4066ad
mov eax, dword [ebp - 0x34]
sub eax, 0x4302a8
cmp eax, 0x3ff
jle 0x40645b
mov edx, dword [ebp - 0x34]
mov eax, 0x4302a8
mov byte [edx], 0
cmp dword [ebp + 8], 0
je 0x4066d2
push ecx
push 0x400
push 0x4302a8
push dword [ebp + 8]
call sub.KERNEL32.dll_lstrcpynA
pop edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8