Function at 0x40857c
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov eax, dword [ebp + 0xc]
test eax, eax
lea esi, [eax + eax]
jns 0x40859c
mov edx, dword [0x471e24]
not eax
mov esi, dword [edx + eax*4]
add esi, esi
add esi, dword [0x469d98]
mov ebx, 0x471e40
cmp dword [ebp + 8], ebx
jb 0x408685
mov eax, dword [ebp + 8]
sub eax, ebx
cmp eax, 0x7fff
ja 0x408685
mov ebx, dword [ebp + 8]
mov dword [ebp + 8], 0
jmp 0x408685
mov eax, ebx
sub eax, 0x471e40
cmp eax, 0x3fff
jg 0x408691
cmp dx, 3
ja 0x40888e
mov al, byte [esi + 3]
add esi, 4
mov byte [ebp - 0x58], al
mov al, byte [esi - 2]
mov byte [ebp - 0x68], al
mov ax, word [esi - 2]
movzx ecx, al
mov byte [ebp - 0x39], al
mov dword [ebp - 0x24], ecx
or ch, 0x80
mov dword [ebp - 0x28], ecx
mov ecx, eax
shr cx, 8
movzx edi, cx
mov word [ebp - 0x3c], cx
or cx, 0x8000
movzx ecx, cx
cmp dx, 2
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x20], ecx
je 0x4086bf
mov edi, dword [ebp - 0x58]
and edi, 0x7f
mov eax, edi
mov edi, dword [ebp - 0x68]
shl eax, 7
and edi, 0x7f
or edi, eax
cmp dx, 3
jne 0x408871
cmp edi, 0x1d
jne 0x408829
mov eax, dword [0x469de8]
mov dword [esp], ebx
mov dword [esp + 4], eax
call fcn.004082ed
sub edi, 0x15
push eax
push eax
cmp edi, 6
jbe 0x408863
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, eax
push ecx
add ebx, eax
mov dx, word [esi]
test dx, dx
jne 0x4085cf
cmp dword [ebp + 8], 0
mov word [ebx], 0
mov eax, 0x471e40
je 0x4088b5
mov eax, dword [ebp + 8]
mov dword [esp + 4], 0x471e40
mov dword [esp], eax
call fcn.004083c8
push edx
push edx
jmp 0x4088b5
mov ecx, dword [0x469de0]
mov edx, 1
test ecx, ecx
jns 0x4086e6
cmp cx, 0x5a04
je 0x4086e6
cmp edi, 0x23
sete cl
cmp edi, 0x2e
sete dl
or edx, ecx
movzx edx, dl
cmp dword [0x469d24], 1
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, 4
test al, al
jns 0x408747
mov dl, al
and eax, 0x3f
mov dword [esp + 0xc], ebx
add eax, eax
add eax, dword [0x469d98]
and edx, 0x40
movzx edx, dl
mov dword [esp + 4], str.SoftwareMicrosoftWindowsCurrentVersion
mov dword [esp], 0x80000002
mov dword [esp + 0x10], edx
mov dword [esp + 8], eax
call fcn.00408240
sub esp, 0x14
cmp word [ebx], 0
jne 0x408844
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.0040857c
jmp 0x408785
cmp byte [ebp - 0x39], 0x25
jne 0x408760
mov dword [esp], ebx
mov dword [esp + 4], 0x2000
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x408785
cmp byte [ebp - 0x39], 0x24
je 0x408774
mov al, dl
lea edi, [ebp + ecx*4 - 0x28]
and eax, 1
mov byte [ebp - 0x39], al
jmp 0x4087c0
mov dword [esp + 4], 0x2000
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push edi
push edi
jmp 0x408844
mov eax, dword [0x469de4]
test eax, eax
jne 0x4087c9
lea eax, [ebp - 0x2c]
mov dword [esp + 8], eax
mov eax, dword [edi - 4]
mov dword [esp + 4], eax
mov eax, dword [0x469de8]
mov dword [esp], eax
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
sub esp, 0xc
test eax, eax
je 0x4087fe
mov word [ebx], 0
sub edi, 4
lea eax, [ebp - 0x28]
cmp edi, eax
jne 0x40878c
jmp 0x408844
cmp byte [ebp - 0x39], 0
je 0x408795
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov edx, dword [edi - 4]
mov dword [esp + 4], edx
mov edx, dword [0x469de8]
mov dword [esp], edx
call eax
sub esp, 0x14
test eax, eax
jne 0x408795
jmp 0x408844
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push edx
push edx
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x58], eax
mov dword [esp], edx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
mov eax, dword [ebp - 0x58]
push ecx
test eax, eax
je 0x4087b8
jmp 0x408844
mov eax, edi
mov dword [esp], ebx
shl eax, 0xe
add eax, section..ndata
mov dword [esp + 4], eax
call fcn.004083c8
jmp 0x408669
cmp word [ebx], 0
je 0x408863
cmp word [ebp - 0x3c], 0x1a
jne 0x408863
mov dword [esp + 4], str.MicrosoftInternet_ExplorerQuick_Launch
mov dword [esp], ebx
call fcn.004083fa
push eax
push eax
mov dword [esp], ebx
call fcn.00408499
push eax
jmp 0x408677
dec dx
jne 0x408677
not edi
mov dword [esp], ebx
mov dword [esp + 4], edi
call fcn.0040857c
push edi
push edi
jmp 0x408677
cmp dx, 4
lea eax, [ebx + 2]
jne 0x4088a8
mov dx, word [esi + 2]
add esi, 4
mov word [ebx], dx
mov ebx, eax
jmp 0x408685
mov word [ebx], dx
add esi, 2
mov ebx, eax
jmp 0x408685
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 8