Function at 0x407017
Capabilities:
Get common file path

Disassembly:
sub esp, 0x18
push ebx
push ebp
mov ebp, dword [esp + 0x28]
test ebp, ebp
push esi
jge 0x407036
mov ecx, dword [0x425788]
lea eax, [ebp*4 + 4]
sub ecx, eax
mov ebp, dword [ecx]
mov eax, dword [0x425fd8]
add ebp, eax
mov eax, dword [esp + 0x28]
mov ebx, 0x424b40
sub eax, ebx
cmp eax, 0x800
mov esi, ebx
jae 0x40705a
mov esi, dword [esp + 0x28]
and dword [esp + 0x28], 0
mov dl, byte [ebp]
test dl, dl
je 0x407247
push edi
mov edi, dword [esp + 0x2c]
mov eax, esi
sub eax, ebx
cmp eax, 0x400
jge 0x407246
inc ebp
cmp dl, 0xfc
jbe 0x4070b9
movsx eax, byte [ebp + 1]
movsx ecx, byte [ebp]
mov edi, eax
and edi, 0x7f
mov ebx, ecx
and ebx, 0x7f
shl edi, 7
or edi, ebx
mov ebx, 0x8000
mov dword [esp + 0x18], ecx
or ecx, ebx
mov dword [esp + 0x20], eax
or eax, ebx
inc ebp
inc ebp
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], eax
mov ebx, 0x424b40
cmp dl, 0xfc
jne 0x4070c7
mov al, byte [ebp]
mov byte [esi], al
inc esi
inc ebp
jmp 0x40723b
cmp dl, 0xfe
jne 0x4071e2
xor ebx, ebx
cmp dword [esp + 0x20], 4
mov dword [esp + 0x30], ebx
mov byte [esi], bl
jne 0x4070ea
push 2
mov dword [esp + 0x34], str.MicrosoftInternet_ExplorerQuick_Launch
pop ebx
cmp dword [esp + 0x18], 0x2b
jne 0x407106
push esi
push str.CommonFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00406a89
cmp dword [esp + 0x18], 0x26
jne 0x407137
push esi
push str.ProgramFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00406a89
cmp byte [esi], 0
jne 0x4071b1
push str.C:Program_Files
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [esp + 0x18], 0x25
jne 0x40714a
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp dword [esp + 0x18], 0x24
jne 0x40715d
push 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp byte [esi], 0
jne 0x4071b1
cmp dword [0x426024], 0
push 4
pop ebx
jne 0x407173
push 2
pop ebx
jmp 0x4071b1
lea eax, [esp + 0x10]
push eax
push dword [esp + ebx*4 + 0x18]
dec ebx
push dword [0x425fa0]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x4071ae
push esi
push dword [esp + 0x14]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [esp + 0x10]
mov dword [esp + 0x18], eax
call fcn.00406862
cmp dword [esp + 0x14], 0
jne 0x4071b5
jmp 0x4071b1
mov byte [esi], 0
test ebx, ebx
jne 0x407173
cmp byte [esi], 0
je 0x4071cc
cmp dword [esp + 0x30], 0
je 0x4071cc
push dword [esp + 0x30]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push esi
call fcn.00406ba1
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add esi, eax
mov ebx, 0x424b40
jmp 0x40723b
cmp dl, 0xfd
jne 0x407225
cmp edi, 0x1b
jne 0x4071fa
push dword [0x425fa0]
push esi
call fcn.00406af3
jmp 0x40720c
mov eax, edi
shl eax, 0xa
add eax, section..ndata
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [edi - 0x15]
cmp eax, 6
jae 0x40721a
push esi
call fcn.00406ba1
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add esi, eax
jmp 0x40723b
cmp dl, 0xff
jne 0x407238
or eax, 0xffffffff
sub eax, edi
push eax
push esi
call fcn.00407017
jmp 0x40721a
mov byte [esi], dl
inc esi
mov dl, byte [ebp]
test dl, dl
jne 0x40706a
pop edi
cmp dword [esp + 0x28], 0
mov byte [esi], 0
je 0x407263
push 0x400
push ebx
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
jmp 0x407265
mov eax, ebx
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 8