Function at 0x407660
Capabilities:
Get common file path

Disassembly:
mov ecx, dword [esp + 8]
sub esp, 0x18
test ecx, ecx
jns 0x40767c
lea eax, [ecx*4 + 4]
mov ecx, dword [0x437500]
sub ecx, eax
mov ecx, dword [ecx]
mov eax, dword [0x439578]
mov edx, dword [esp + 0x1c]
push ebx
push esi
mov esi, 0x4354c0
lea ebx, [eax + ecx*2]
cmp edx, esi
jb 0x4076aa
mov eax, edx
sub eax, esi
sar eax, 1
cmp eax, 0x1000
jae 0x4076aa
mov esi, edx
mov dword [esp + 0x24], 0
movzx ecx, word [ebx]
test cx, cx
je 0x4078fc
push ebp
push edi
jmp 0x4076c0
mov eax, esi
sub eax, 0x4354c0
and eax, 0xfffffffe
cmp eax, 0x1000
jge 0x4078fa
movzx edx, cx
add ebx, 2
cmp edx, 4
jae 0x4078d8
movsx edi, byte [ebx + 1]
movsx eax, byte [ebx]
and edi, 0x7f
movzx ebp, byte [ebx + 1]
and eax, 0x7f
shl edi, 7
or edi, eax
mov dword [esp + 0x24], ebp
movzx eax, byte [ebx]
add ebx, 2
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
or eax, 0x8000
mov dword [esp + 0x18], eax
mov eax, ebp
or eax, 0x8000
mov dword [esp + 0x14], ebx
mov dword [esp + 0x20], eax
cmp edx, 2
jne 0x407869
mov ebx, edx
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
jns 0x407751
mov ecx, 0x5a04
cmp ax, cx
je 0x407751
cmp ebp, 0x23
je 0x407751
cmp ebp, 0x2e
je 0x407751
xor ebp, ebp
jmp 0x407756
mov ebp, 1
cmp dword [0x439604], 0
mov eax, 4
mov ecx, dword [esp + 0x10]
cmovne ebx, eax
test cl, cl
jns 0x4077a2
mov eax, ecx
and ecx, 0x3f
and eax, 0x40
push eax
mov eax, dword [0x439578]
push esi
lea eax, [eax + ecx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00408310
cmp word [esi], 0
mov edi, dword [esp + 0x24]
jne 0x4077bd
push edi
push esi
call fcn.00407660
jmp 0x4077b7
cmp ecx, 0x25
jne 0x4077e7
push 0x800
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov edi, dword [esp + 0x24]
cmp word [esi], 0
je 0x4077ce
cmp edi, 0x1a
jne 0x4077ce
push str.MicrosoftInternet_ExplorerQuick_Launch
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push esi
call fcn.00408730
mov ebx, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [esi + eax*2]
jmp 0x4078ee
cmp ecx, 0x24
jne 0x4077fa
push 0x800
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x4077b3
test ebx, ebx
je 0x4077b3
mov edi, edi
mov eax, dword [0x437510]
dec ebx
test eax, eax
je 0x407823
test ebp, ebp
je 0x407823
push esi
push 0
push 0
push dword [esp + ebx*4 + 0x24]
push dword [0x437518]
call eax
test eax, eax
je 0x4077b3
lea eax, [esp + 0x30]
push eax
push dword [esp + ebx*4 + 0x1c]
push dword [0x437518]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x40785b
push esi
push dword [esp + 0x34]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push dword [esp + 0x30]
mov edi, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test edi, edi
jne 0x4077b3
xor eax, eax
mov word [esi], ax
test ebx, ebx
jne 0x407800
jmp 0x4077ce
cmp edx, 3
jne 0x4078bb
cmp edi, 0x1d
jne 0x40788a
push dword [0x437518]
push 0x40c9d8
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
jmp 0x4078a1
mov eax, edi
shl eax, 0xc
push 0x800
add eax, section..ndata
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
lea eax, [edi - 0x15]
cmp eax, 7
jae 0x4078cc
push esi
call fcn.00408730
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [esi + eax*2]
jmp 0x4078ee
cmp edx, 1
jne 0x4078cc
or eax, 0xffffffff
sub eax, edi
push eax
push esi
call fcn.00407660
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [esi + eax*2]
jmp 0x4078ee
jne 0x4078e8
mov ax, word [ebx]
mov word [esi], ax
add esi, 2
add ebx, 2
jmp 0x4078ee
mov word [esi], dx
add esi, 2
movzx ecx, word [ebx]
test cx, cx
jne 0x4076c0
pop edi
pop ebp
xor eax, eax
mov word [esi], ax
mov eax, dword [esp + 0x24]
pop esi
pop ebx
test eax, eax
je 0x407922
push 0x800
push 0x4354c0
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
add esp, 0x18
ret 8
mov eax, 0x4354c0
add esp, 0x18
ret 8