Function at 0x406301
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 0x406331
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 0x40635e
mov eax, ebx
sub eax, edx
sar eax, 1
cmp eax, 0x4000
jae 0x40635e
mov edi, ebx
mov dword [esp + 0xc], ecx
mov ebx, ecx
movzx ecx, word [ebp]
test cx, cx
je 0x406586
push esi
push 2
pop esi
mov eax, edi
mov ebx, ebp
sub eax, edx
and eax, 0xfffffffe
cmp eax, 0x4000
jge 0x406581
push 4
movzx edx, cx
add ebp, esi
pop eax
cmp dx, ax
jae 0x40655a
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 0x406505
cmp dword [0x477e04], 0
push 4
pop ebx
cmovne eax, ebx
test cl, cl
jns 0x40642d
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.00406e70
xor esi, esi
cmp word [edi], si
mov esi, dword [esp + 0x2c]
jne 0x4064eb
push esi
push edi
call fcn.00406301
jmp 0x4064eb
cmp ecx, 0x25
jne 0x406443
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x4064e7
cmp ecx, 0x24
jne 0x406459
push 0x2000
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x4064e7
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 0x406495
push edi
push ebp
push ebp
push eax
push dword [0x46fd38]
mov ecx, esi
call dword [0x4092cc]
call esi
test eax, eax
je 0x4064e3
push 7
call fcn.00406ddf
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 0x4064d2
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 0x4064e3
xor eax, eax
mov word [edi], ax
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x40645b
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x2c]
xor eax, eax
cmp word [edi], ax
je 0x406536
cmp esi, 0x1a
jne 0x406536
push str.MicrosoftInternet_ExplorerQuick_Launch
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
jmp 0x406536
cmp edx, 3
jne 0x40653e
cmp esi, 0x1d
jne 0x40651d
push dword [0x46fd38]
push edi
call fcn.00406af0
jmp 0x40654c
mov eax, esi
shl eax, 0xe
add eax, section..nsdata
push eax
push edi
call fcn.0040702e
lea eax, [esi - 0x15]
cmp eax, 7
jae 0x40654c
push edi
call fcn.00407240
jmp 0x40654c
cmp edx, 1
jne 0x40654c
not esi
push esi
push edi
call fcn.00406301
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push 2
add eax, eax
pop esi
jmp 0x40656d
jne 0x406568
mov ax, word [ebp]
lea ebp, [ebx + 4]
mov word [edi], ax
jmp 0x40656b
mov word [edi], dx
mov eax, esi
movzx ecx, word [ebp]
add edi, eax
mov edx, 0x467ce0
test cx, cx
jne 0x40636f
mov ebx, dword [esp + 0x10]
pop esi
xor eax, eax
mov word [edi], ax
pop edi
pop ebp
test ebx, ebx
je 0x40659a
push edx
push ebx
call fcn.0040702e
jmp 0x40659c
mov eax, edx
mov ecx, dword [esp + 0x24]
pop ebx
xor ecx, esp
call fcn.00408561
add esp, 0x24
ret 8