Function at 0x406969
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x406987
mov ecx, dword [0x7a1f5c]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x7a27b8]
push ebx
push esi
push edi
lea edi, [eax + ecx]
mov eax, dword [ebp + 8]
mov ecx, 0x7a1720
sub eax, ecx
mov esi, ecx
cmp eax, 0x800
jae 0x4069ad
mov esi, dword [ebp + 8]
and dword [ebp + 8], 0
mov al, byte [edi]
test al, al
mov byte [ebp + 0xf], al
je 0x406b97
mov ebx, dword [ebp + 8]
mov edx, esi
sub edx, ecx
cmp edx, 0x400
jge 0x406b97
inc edi
cmp al, 0xfc
jbe 0x406a04
movsx eax, byte [edi + 1]
movsx ecx, byte [edi]
mov ebx, eax
mov edx, ecx
and ebx, 0x7f
and edx, 0x7f
shl ebx, 7
or ebx, edx
mov edx, SHGetPathFromIDListA
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x20], ecx
or eax, edx
or ecx, edx
mov dword [ebp - 0x14], eax
mov al, byte [ebp + 0xf]
inc edi
mov dword [ebp - 0x1c], ecx
inc edi
cmp al, 0xfc
jne 0x406a11
mov al, byte [edi]
mov byte [esi], al
inc esi
inc edi
jmp 0x406b85
cmp al, 0xfe
jne 0x406b3e
and dword [ebp - 8], 0
and dword [ebp + 0xc], 0
and byte [esi], 0
cmp dword [ebp - 0x18], 4
jne 0x406a38
mov dword [ebp - 8], str.MicrosoftInternet_ExplorerQuick_Launch
mov dword [ebp + 0xc], 2
cmp dword [ebp - 0x20], 0x2b
jne 0x406a53
push esi
push str.CommonFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.0040683e
cmp dword [ebp - 0x20], 0x26
jne 0x406a7e
push esi
push str.ProgramFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.0040683e
cmp byte [esi], 0
jne 0x406abe
push str.C:Program_Files
push esi
call fcn.0040694b
cmp dword [ebp - 0x20], 0x25
jne 0x406a90
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp dword [ebp - 0x20], 0x24
jne 0x406aa2
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp byte [esi], 0
jne 0x406abe
cmp dword [0x7a27e4], 0
mov dword [ebp + 0xc], 4
jne 0x406abe
mov dword [ebp + 0xc], 2
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
test eax, eax
je 0x406b19
mov eax, dword [ebp + 0xc]
lea eax, [ebp + eax*4 - 0x20]
mov dword [ebp - 4], eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
push dword [eax]
push dword [0x7a2784]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406b08
push esi
push dword [ebp - 0xc]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 0xc]
mov dword [ebp - 0x10], eax
call fcn.004062cb
cmp dword [ebp - 0x10], 0
jne 0x406b19
jmp 0x406b0b
and byte [esi], 0
mov eax, dword [ebp + 0xc]
dec dword [ebp + 0xc]
sub dword [ebp - 4], 4
test eax, eax
jne 0x406ad2
cmp byte [esi], 0
je 0x406b2e
cmp dword [ebp - 8], 0
je 0x406b2e
push dword [ebp - 8]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push esi
call fcn.00406bba
push esi
call fcn.0040695c
add esi, eax
jmp 0x406b85
cmp al, 0xfd
jne 0x406b70
cmp ebx, 0x1b
jne 0x406b55
push dword [0x7a2784]
push esi
call fcn.004068a8
jmp 0x406b66
mov eax, ebx
shl eax, 0xa
add eax, section..ndata
push eax
push esi
call fcn.0040694b
lea eax, [ebx - 0x15]
cmp eax, 6
jae 0x406b34
jmp 0x406b2e
cmp al, 0xff
jne 0x406b82
or eax, 0xffffffff
sub eax, ebx
push eax
push esi
call fcn.00406969
jmp 0x406b34
mov byte [esi], al
inc esi
mov al, byte [edi]
mov ecx, 0x7a1720
test al, al
mov byte [ebp + 0xf], al
jne 0x4069bd
and byte [esi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x406bb4
push 0x400
push ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
jmp 0x406bb6
mov eax, ecx
leave
ret 8