Function at 0x401d30
Capabilities:
Get common file path
Get startup folder
Query or enumerate registry value

Disassembly:
sub esp, 0x118
push ebp
push esi
mov esi, dword [esp + 0x124]
push edi
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
xor ebp, ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edx, 1
cmp ecx, 3
mov dword [esp + 0x10], edx
jle 0x401f86
cmp byte [ecx + esi - 1], 0x5c
jne 0x401d72
push esi
mov ebp, edx
call fcn.004012f0
add esp, 4
push ebx
lea eax, [esp + 0x24]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea ecx, [esp + 0x24]
push ecx
call fcn.004012f0
lea edx, [esp + 0x28]
push esi
push edx
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea eax, [esp + 0x24]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea ecx, [esp + 0x24]
push ecx
call fcn.004012f0
lea edx, [esp + 0x28]
push esi
push edx
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
lea eax, [esp + 0x10]
push eax
push 0
push 0
call edi
mov edx, dword [esp + 0x10]
mov ebx, dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
lea ecx, [esp + 0x24]
push ecx
push edx
call ebx
lea eax, [esp + 0x24]
push eax
call fcn.004012f0
lea ecx, [esp + 0x28]
push esi
push ecx
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea edx, [esp + 0x10]
push edx
push 0x14
push 0
call edi
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x24]
push eax
push ecx
call ebx
lea edx, [esp + 0x24]
push edx
call fcn.004012f0
lea eax, [esp + 0x28]
push esi
push eax
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea ecx, [esp + 0x10]
push ecx
push 2
push 0
call edi
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x24]
push edx
push eax
call ebx
lea ecx, [esp + 0x24]
push ecx
call fcn.004012f0
lea edx, [esp + 0x28]
push esi
push edx
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea eax, [esp + 0x10]
push eax
push 0xb
push 0
call edi
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x24]
push ecx
push edx
call ebx
lea eax, [esp + 0x24]
push eax
call fcn.004012f0
lea ecx, [esp + 0x28]
push esi
push ecx
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea edx, [esp + 0x10]
push edx
push 7
push 0
call edi
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x24]
push eax
push ecx
call ebx
lea edx, [esp + 0x24]
push edx
call fcn.004012f0
lea eax, [esp + 0x28]
push esi
push eax
call fcn.004037a0
add esp, 0xc
test eax, eax
je 0x401f6a
lea ecx, [esp + 0x18]
push ecx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x401f55
mov dword [esp + 0x20], eax
lea edx, [esp + 0x1c]
lea eax, [esp + 0x24]
push edx
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x24]
push eax
push ecx
push 0
push str.ProgramFilesDir
push edx
mov dword [esp + 0x34], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x401f4a
lea eax, [esp + 0x24]
push esi
push eax
call fcn.004037a0
add esp, 8
test eax, eax
je 0x401f5f
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp + 0x14], 0
jmp 0x401f6a
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebp, ebp
pop ebx
je 0x401f78
push esi
call fcn.004012a0
add esp, 4
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
add esp, 0x118
ret
pop edi
pop esi
mov eax, edx
pop ebp
add esp, 0x118
ret