You already did the first step, which is debugging your code. When you notice RegOpenKeyEx fails, you should note the return value, as this will tell you what the actual problem is (search for the error code in Winerror.h or use FormatMessage api to convert to readable error message.)
I haven't looked at your code in much detail, but the first thing I noticed is that you are trying to retrieve the DefaultDomainName and not the CPUID. So maybe you are even using XP home and that key doesn't exist?
Try to retrieve the exact return value from RegOpenKeyEx. _________________ Ignorance is bliss, knowledge is power
The exact return value from RegOpenKeyEx is 3E6 (Invalid access to memory location). Sounds like I am using "wrong parameters" or something, but in ollydbg everything looks fine:
but still I return from the call with eax = 000003E6
I'm using WinXP Home and CPUID is stored in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] with name "AltDefaultDomainName" & "DefaultDomainName"... And many other places in my registry, I will try to choose the best when I get this to work.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum