Function at 0x406321
Capabilities:
Get common file path

Disassembly:
sub esp, 0x24
mov eax, dword [0x40b0f8]
xor eax, esp
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x2c]
push ebx
mov ebx, dword [esp + 0x2c]
mov dword [esp + 4], ebx
test eax, eax
jns 0x406351
mov ecx, dword [0x46fd20]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x477d78]
mov edx, 0x467ce0
push ebp
push edi
mov edi, edx
lea ebp, [ecx + eax*2]
xor ecx, ecx
cmp ebx, edx
jb 0x40637e
mov eax, ebx
sub eax, edx
sar eax, 1
cmp eax, 0x4000
jae 0x40637e
mov edi, ebx
mov dword [esp + 0xc], ecx
mov ebx, ecx
movzx ecx, word [ebp]
test cx, cx
je 0x4065a6
push esi
push 2
pop esi
mov eax, edi
mov ebx, ebp
sub eax, edx
and eax, 0xfffffffe
cmp eax, 0x4000
jge 0x4065a1
push 4
movzx edx, cx
add ebp, esi
pop eax
cmp dx, ax
jae 0x40657a
movsx esi, byte [ebx + 3]
movsx eax, byte [ebp]
and esi, 0x7f
movzx ecx, byte [ebp]
and eax, 0x7f
shl esi, 7
or esi, eax
mov dword [esp + 0x24], ecx
mov eax, ecx
or eax, 0x8000
mov dword [esp + 0x20], eax
movzx eax, byte [ebp + 1]
lea ebp, [ebx + 4]
mov dword [esp + 0x2c], eax
or eax, 0x8000
push 2
mov dword [esp + 0x2c], eax
pop eax
mov dword [esp + 0x1c], ebp
cmp dx, ax
jne 0x406525
cmp dword [0x477e04], 0
push 4
pop ebx
cmovne eax, ebx
test cl, cl
jns 0x40644d
mov ebx, dword [0x477d78]
mov eax, ecx
and eax, 0x40
and ecx, 0x3f
push eax
push edi
lea eax, [ebx + ecx*2]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00406e90
xor esi, esi
cmp word [edi], si
mov esi, dword [esp + 0x2c]
jne 0x40650b
push esi
push edi
call fcn.00406321
jmp 0x40650b
cmp ecx, 0x25
jne 0x406463
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x406507
cmp ecx, 0x24
jne 0x406479
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x406507
xor ebp, ebp
mov esi, dword [0x46fd30]
dec eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + eax*4 + 0x20]
and eax, 0xffffffbf
mov ebx, eax
mov dword [esp + 0x14], eax
and ebx, 0x8000
test esi, esi
je 0x4064b5
push edi
push ebp
push ebp
push eax
push dword [0x46fd38]
mov ecx, esi
call dword [0x4092cc]
call esi
test eax, eax
je 0x406503
push 7
call fcn.00406dff
mov esi, eax
mov eax, dword [esp + 0x14]
push ebx
movzx eax, al
mov ecx, esi
push eax
push dword [0x46fd38]
call dword [0x4092cc]
call esi
mov ebx, eax
test ebx, ebx
je 0x4064f2
push edi
push ebx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push ebx
mov esi, eax
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test esi, esi
jne 0x406503
xor eax, eax
mov word [edi], ax
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x40647b
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x2c]
xor eax, eax
cmp word [edi], ax
je 0x406556
cmp esi, 0x1a
jne 0x406556
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
jmp 0x406556
cmp edx, 3
jne 0x40655e
cmp esi, 0x1d
jne 0x40653d
push dword [0x46fd38]
push edi
call fcn.00406b10
jmp 0x40656c
mov eax, esi
shl eax, 0xe
add eax, section..ndata
push eax
push edi
call fcn.0040704c
lea eax, [esi - 0x15]
cmp eax, 7
jae 0x40656c
push edi
call fcn.00407260
jmp 0x40656c
cmp edx, 1
jne 0x40656c
not esi
push esi
push edi
call fcn.00406321
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push 2
add eax, eax
pop esi
jmp 0x40658d
jne 0x406588
mov ax, word [ebp]
lea ebp, [ebx + 4]
mov word [edi], ax
jmp 0x40658b
mov word [edi], dx
mov eax, esi
movzx ecx, word [ebp]
add edi, eax
mov edx, 0x467ce0
test cx, cx
jne 0x40638f
mov ebx, dword [esp + 0x10]
pop esi
xor eax, eax
mov word [edi], ax
pop edi
pop ebp
test ebx, ebx
je 0x4065ba
push edx
push ebx
call fcn.0040704c
jmp 0x4065bc
mov eax, edx
mov ecx, dword [esp + 0x24]
pop ebx
xor ecx, esp
call fcn.00408581
add esp, 0x24
ret 8