Function at 0x40b4e0
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 [0x43300c]
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 0x40b6a8
mov edi, eax
xor eax, eax
dec eax
mov ebx, edi
add ebx, edi
cmovb ebx, eax
push ebx
call fcn.0040cf57
add esp, 4
mov esi, eax
push ebx
push 0
push eax
call fcn.0040f9d0
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 0x40b69d
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 0x40b59a
mov esi, dword [ebp - 0x14]
push esi
call fcn.0040d0bb
add esp, 4
test eax, eax
je 0x40b588
mov edi, eax
cmp word [esi + eax*2 - 2], 0x5c
jne 0x40b5a1
push edi
push esi
push dword [ebp - 0x20]
call fcn.00414b22
add esp, 0xc
test eax, eax
jne 0x40b5fe
mov bl, 1
jmp 0x40b58e
test esi, esi
je 0x40b59a
xor ebx, ebx
push esi
call dword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x40b69d
xor ebx, ebx
jmp 0x40b69d
lea eax, [edi + 1]
mov dword [ebp - 0x1c], eax
add edi, 2
mov ebx, edi
add ebx, edi
mov eax, 0xffffffff
cmovb ebx, eax
push ebx
call fcn.0040cf57
add esp, 4
push ebx
push 0
mov ebx, eax
push eax
call fcn.0040f9d0
sub esp, 4
mov dword [esp + 0xc], esi
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.0040b770
add esp, 0x10
push dword [ebp - 0x1c]
push ebx
push dword [ebp - 0x20]
call fcn.00414b22
add esp, 0xc
mov edi, eax
push ebx
call fcn.0040d268
add esp, 4
test edi, edi
je 0x40b584
push esi
call dword [sym.imp.ole32.dll_CoTaskMemFree]
xor eax, eax
lea edi, [ebp - 0x18]
mov dword [edi], eax
push edi
push eax
push eax
push 0x10002
push str.ProgramFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
xor ebx, ebx
inc ebx
test eax, eax
je 0x40b634
xor eax, eax
jmp 0x40b696
mov esi, dword [ebp - 0x18]
xor eax, eax
cmp esi, 4
jb 0x40b696
mov ebx, esi
and ebx, 0xfffffffe
push ebx
call fcn.0040cf57
add esp, 4
push ebx
xor ecx, ecx
push ecx
push eax
mov ebx, eax
call fcn.0040f9d0
add esp, 0xc
push edi
mov edi, ebx
push ebx
mov dword [ebp - 0x1c], 0
xor eax, eax
push eax
push 0x10002
push str.ProgramFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
xor ebx, ebx
inc ebx
test eax, eax
je 0x40b6bc
push edi
call fcn.0040d268
add esp, 4
mov eax, dword [ebp - 0x1c]
test ebx, ebx
setne bl
and bl, al
push dword [ebp - 0x20]
call fcn.0040d268
add esp, 4
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040dac1
mov eax, ebx
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret
shr esi, 1
push esi
push edi
call fcn.004160d7
add esp, 8
test eax, eax
je 0x40b6ec
cmp word [edi + eax*2 - 2], 0x5c
jne 0x40b6f5
push eax
push edi
push dword [ebp - 0x20]
call fcn.00414b22
add esp, 0xc
test eax, eax
jne 0x40b75f
mov al, 1
mov dword [ebp - 0x1c], eax
jmp 0x40b68a
mov dword [ebp - 0x1c], 0
jmp 0x40b68a
lea ecx, [eax + 1]
mov dword [ebp - 0x1c], ecx
add eax, 2
mov dword [ebp - 0x24], eax
mov esi, edi
mov edi, eax
add edi, eax
mov eax, 0xffffffff
cmovb edi, eax
push edi
call fcn.0040cf57
add esp, 4
push edi
mov edi, esi
push 0
push eax
mov esi, eax
call fcn.0040f9d0
sub esp, 4
mov dword [esp + 0xc], edi
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.0040b770
add esp, 0x10
push dword [ebp - 0x1c]
push esi
push dword [ebp - 0x20]
call fcn.00414b22
add esp, 0xc
mov dword [ebp - 0x1c], eax
push esi
call fcn.0040d268
add esp, 4
cmp dword [ebp - 0x1c], 0
je 0x40b6e5
mov al, 1
mov dword [ebp - 0x1c], eax
xor ebx, ebx
jmp 0x40b68a