Sign in to follow this  
Followers 0
step887

RegDisableReflectionKey

2 posts in this topic

#1 ·  Posted (edited)

I am trying to run 32 bit app and read hklmsoftwaretest without using hklm64

I found http://msdn.microsoft.com/en-us/library/windows/desktop/ms724858(v=vs.85).aspx

using '?do=embed' frameborder='0' data-embedContent>>

I came up with this code, but it still does not work

any help would be appreciated.
 

#RequireAdmin
#include 'Z:\autoit\auto it\Autoit\Include\Functions\_RegFunc.au3'
$key = 'HKEY_LOCAL_MACHINE64\SOFTWARE\test'
$r = regredirect($key)
MsgBox(0,'',RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\test','test'))
Func regredirect($szkey)
    $dwOptions = $REG_OPTION_NON_VOLATILE
    Local $hKey = _RegOpenKey($szKey, 0xF003F, False, $dwOptions) ; open using RegCreateKeyExW KEY_ALL_ACCESS (0xF003F)
    If @error Then Return SetError(@error, @extended, 0)
    Local $ret = DllCall("Advapi32.dll", "long", "RegDisableReflectionKey", "ulong_ptr", $hKey)
        DllCall("advapi32.dll", "long", "RegCloseKey", "ulong_ptr", $hKey)
EndFunc

it always reads HKEY_LOCAL_MACHINESOFTWAREWow6432Nodetest

 

the dll call for RegDisableReflectionKey returns 0 .. so I am not sure why it does not work 

Edited by step887

Share this post


Link to post
Share on other sites



HKLMSoftware is redirected, not reflected. RegDisableReflectionKey fails as expected. Look here for what keys are shared, redirected or reflected.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0