Function at 0x4085e0
Capabilities:
Get common file path
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x18
mov eax, dword [0x431014]
xor eax, ebp
mov dword [ebp - 0x10], eax
xor ebx, ebx
push ebx
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x4087be
mov edi, eax
lea ebx, [eax + eax]
xor eax, eax
dec eax
test edi, edi
cmovs ebx, eax
push ebx
call fcn.00409fc3
add esp, 4
mov esi, eax
push ebx
push 0
push eax
call fcn.0040c1f0
add esp, 0xc
push edi
mov dword [ebp - 0x20], esi
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
xor ebx, ebx
test eax, eax
je 0x4087b3
lea eax, [ebp - 0x14]
mov dword [eax], ebx
push eax
push ebx
push ebx
push section..rdata
call sub.SHELL32.dll_SHGetKnownFolderPath
test eax, eax
js 0x4086d1
mov ebx, dword [ebp - 0x14]
push ebx
call fcn.00413ad9
add esp, 4
test eax, eax
je 0x4086c6
mov edi, eax
cmp word [ebx + eax*2 - 2], 0x5c
jne 0x4086d8
push edi
push ebx
push dword [ebp - 0x20]
call fcn.00411dc9
add esp, 0xc
test eax, eax
je 0x40873c
push ebx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
xor eax, eax
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
push ebx
push eax
push eax
push 0x10002
push 0x42c114
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
xor esi, esi
inc esi
test eax, eax
je 0x408747
xor eax, eax
jmp 0x4087ac
test ebx, ebx
je 0x4086d1
push ebx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
xor ebx, ebx
jmp 0x4087b3
lea eax, [edi + 1]
mov dword [ebp - 0x1c], eax
lea esi, [edi*2 + 4]
add edi, 2
mov eax, 0xffffffff
cmovs esi, eax
push esi
call fcn.00409fc3
add esp, 4
push esi
push 0
mov esi, eax
push eax
call fcn.0040c1f0
sub esp, 4
mov dword [esp + 0xc], ebx
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00401da0
add esp, 0x10
push dword [ebp - 0x1c]
push esi
push dword [ebp - 0x20]
call fcn.00411dc9
add esp, 0xc
mov edi, eax
push esi
call fcn.00409fcc
add esp, 4
test edi, edi
jne 0x408689
push ebx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
mov bl, 1
jmp 0x4087b3
mov ecx, dword [ebp - 0x18]
xor eax, eax
cmp ecx, 4
jb 0x4087ac
mov dword [ebp - 0x24], ecx
mov esi, ecx
and esi, 0xfffffffe
push esi
call fcn.00409fc3
add esp, 4
mov edi, eax
push esi
xor esi, esi
push esi
push eax
call fcn.0040c1f0
add esp, 0xc
push ebx
mov ebx, edi
push edi
mov dword [ebp - 0x1c], 0
push esi
push 0x10002
push 0x42c114
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
xor esi, esi
inc esi
test eax, eax
je 0x4087d2
mov edi, ebx
push edi
call fcn.00409fcc
add esp, 4
mov eax, dword [ebp - 0x1c]
test esi, esi
setne bl
and bl, al
push dword [ebp - 0x20]
call fcn.00409fcc
add esp, 4
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040a9b5
mov eax, ebx
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x24]
shr eax, 1
push eax
push ebx
call fcn.00413c01
add esp, 8
test eax, eax
mov edi, ebx
je 0x40880a
cmp word [edi + eax*2 - 2], 0x5c
jne 0x408813
push eax
push edi
push dword [ebp - 0x20]
call fcn.00411dc9
add esp, 0xc
test eax, eax
jne 0x40887d
mov al, 1
mov dword [ebp - 0x1c], eax
xor esi, esi
inc esi
jmp 0x4087a0
mov dword [ebp - 0x1c], 0
jmp 0x4087a0
lea ecx, [eax + 1]
mov dword [ebp - 0x1c], ecx
mov esi, eax
lea eax, [eax*2 + 4]
add esi, 2
mov ecx, 0xffffffff
mov dword [ebp - 0x24], edi
mov edi, ecx
cmovns edi, eax
push edi
call fcn.00409fc3
add esp, 4
mov ebx, eax
push edi
mov edi, dword [ebp - 0x24]
push 0
push eax
call fcn.0040c1f0
sub esp, 4
mov dword [esp + 0xc], edi
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00401da0
add esp, 0x10
push dword [ebp - 0x1c]
push ebx
push dword [ebp - 0x20]
call fcn.00411dc9
add esp, 0xc
mov esi, eax
push ebx
call fcn.00409fcc
add esp, 4
test esi, esi
je 0x408800
mov al, 1
mov dword [ebp - 0x1c], eax
xor esi, esi
jmp 0x4087a0