Function at 0x405995
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
test eax, eax
jge 0x4059b3
mov ecx, dword [0x7a233c]
lea eax, [eax*4 + 4]
sub ecx, eax
mov eax, dword [ecx]
mov ecx, dword [0x7a2b98]
push ebx
push esi
push edi
lea ebx, [eax + ecx]
mov ecx, dword [ebp + 8]
mov eax, 0x7a1b00
sub ecx, eax
mov edi, eax
cmp ecx, 0x800
jae 0x405b9f
mov edi, dword [ebp + 8]
and dword [ebp + 8], 0
jmp 0x405b9f
mov ecx, edi
sub ecx, eax
cmp ecx, 0x400
jge 0x405ba9
inc ebx
cmp dl, 0xfc
mov dword [ebp + 0xc], ebx
jbe 0x405b8d
movsx eax, byte [ebx + 1]
movsx ecx, byte [ebx]
mov esi, eax
mov ebx, ecx
and esi, 0x7f
and ebx, 0x7f
shl esi, 7
or esi, ebx
mov ebx, 0x8000
mov dword [ebp - 0x10], eax
or eax, ebx
mov dword [ebp - 0x18], ecx
push 2
or ecx, ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
pop eax
add ebx, eax
cmp dl, 0xfe
mov dword [ebp - 0x14], ecx
jne 0x405b39
and dword [ebp - 4], 0
and dword [ebp + 0xc], 0
and byte [edi], 0
cmp dword [ebp - 0x10], 4
jne 0x405a57
mov dword [ebp - 4], str.MicrosoftInternet_ExplorerQuick_Launch
mov dword [ebp + 0xc], eax
mov esi, dword [ebp - 0x18]
cmp esi, 0x2b
jne 0x405a74
push edi
push str.CommonFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00405877
cmp esi, 0x26
jne 0x405aa2
push edi
push str.ProgramFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call fcn.00405877
cmp byte [edi], 0
jne 0x405b1d
push str.C:Program_Files
push edi
call sub.KERNEL32.dll_lstrcpyA
cmp esi, 0x25
jne 0x405ab3
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp esi, 0x24
jne 0x405ac4
push 0x400
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
cmp byte [edi], 0
jne 0x405b1d
cmp dword [0x7a2be4], 0
mov dword [ebp + 0xc], 4
jne 0x405ae2
mov dword [ebp + 0xc], 2
jmp 0x405b1d
dec dword [ebp + 0xc]
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp + 0xc]
push dword [ebp + eax*4 - 0x18]
push dword [0x7a2b64]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x405b1a
push edi
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
push dword [ebp - 8]
mov esi, eax
call fcn.004051ee
test esi, esi
jne 0x405b23
jmp 0x405b1d
and byte [edi], 0
cmp dword [ebp + 0xc], 0
jne 0x405ae2
cmp byte [edi], 0
je 0x405b6a
cmp dword [ebp - 4], 0
je 0x405b6a
push dword [ebp - 4]
push edi
call sub.KERNEL32.dll_lstrcatA
jmp 0x405b6a
cmp dl, 0xfd
jne 0x405b7a
cmp esi, 0x1b
jne 0x405b51
push dword [0x7a2b64]
push edi
call fcn.004058e1
jmp 0x405b62
mov eax, esi
shl eax, 0xa
add eax, section..ndata
push eax
push edi
call sub.KERNEL32.dll_lstrcpyA
add esi, 0xffffffeb
cmp esi, 6
jae 0x405b70
push edi
call fcn.00405bc8
push edi
call sub.KERNEL32.dll_lstrlenA
add edi, eax
jmp 0x405b9a
cmp dl, 0xff
jne 0x405b9a
or eax, 0xffffffff
sub eax, esi
push eax
push edi
call fcn.00405995
jmp 0x405b70
jne 0x405b97
mov al, byte [ebx]
mov byte [edi], al
inc edi
inc ebx
jmp 0x405b9a
mov byte [edi], dl
inc edi
mov eax, 0x7a1b00
mov dl, byte [ebx]
test dl, dl
jne 0x4059e3
and byte [edi], 0
cmp dword [ebp + 8], 0
pop edi
pop esi
pop ebx
je 0x405bc4
push 0x400
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
leave
ret 8