Coder Social home page Coder Social logo

Comments (9)

denisbrodbeck avatar denisbrodbeck commented on August 18, 2024 2

@shahidhk @MikeFair In my testing the issue has been fixed. If there' s still an issue, feel free to reopen this issue.

from machineid.

denisbrodbeck avatar denisbrodbeck commented on August 18, 2024

Sorry for late response, holiday season 😄

That's kind of strange. Do you have a gist or minimal repo, where I could reproduce your issue?

You could use delve to drill into this with a debugger, or maybe modify the source to panic within id_windows.go.

You should be able to test the library by cd'ing into GOSRC\src\github.com\denisbrodbeck\machineid and running go test ./....

from machineid.

shahidhk avatar shahidhk commented on August 18, 2024

No probs. 😃

The error was reported by some of our users. We were unable to reproduce this with our test machines. Anyway, I will try to get the user to introduce panic, run the tests and get back to you.

from machineid.

MikeFair avatar MikeFair commented on August 18, 2024

I get the same error on a Windows 7 Home Premium laptop

from machineid.

MikeFair avatar MikeFair commented on August 18, 2024

Turns out the "HKLM\SOFTWARE\Wow6432Node\Microsoft\Cryptography" Key itself exists but doesn't seem to contain any values (or I just don't have permissions to see those values (even as an administrator)). All the values in that subtree appear blank on this machine.

This means the "MachineGuid" value is not found or truly isn't there.

Per this msdn post:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d617a579-278d-4e77-812e-99fa68135d0d/windows-installation-guid?forum=windowscompatibility

They say MachineGUID is not necessarily Unique (but they were also talking specifically about system reinstalls from backups and OS reinstalls)

They suggested the assembly: System.Identity.UniqueID,
Not sure if this correlates to a RegKey anywhere.

They also point to a discussion that says take CPUID + HD VOLUME SERIAL NUMBER [ + more hw id]
https://stackoverflow.com/questions/3474940/unique-computer-id

And https://www.nextofwindows.com/the-best-way-to-uniquely-identify-a-windows-machine
mentions the Windows ProductId / SerialId from the Activation (perhaps there's something else from the Activation process) ; though this is likely a problem for unactivated Windows machines...

Here's a link on what goes into the ProductId:
https://technet.microsoft.com/en-us/library/bb457054.aspx#EEAA

from machineid.

denisbrodbeck avatar denisbrodbeck commented on August 18, 2024

@MikeFair Thanks for your comment.

Just let me give my two cents 😄

Turns out the "HKLM\SOFTWARE\Wow6432Node\Microsoft\Cryptography" Key itself exists but doesn't seem to contain any values (or I just don't have permissions to see those values (even as an administrator)).

You are getting this strange empty view, because you're looking at the wrong registry node. The real key is always within HKLM\SOFTWARE\Microsoft\Cryptography. Some keys are x86 only, some keys are x64 only and some of them are shared. Everything below Wow6432Node would be your exclusive view into the x86 registry, where only apps live, which do not support x64 (as far I remember). Simetimes it's really confusing, because both HKLM\SOFTWARE\Wow6432Node\Microsoft\Cryptography and HKLM\SOFTWARE\Microsoft\Cryptography exist on a x64 system.

They suggested the assembly: System.Identity.UniqueID

I know of this thread, but I've never managed to get hold of that specific value. Information on google is +very+ sparse. I've tried to fetch that value with C#, but never found the specific assembly to get that variable from 😕

They also point to a discussion that says take CPUID + HD VOLUME SERIAL NUMBER

I've visited that thread before creating this library. One takeaway is that CPUID is not unique. At least, not since the last ~10 years. Intel deactivated that feature long ago. Usually some zero-ed string is returned, when someone tries to read the specific variable.

Using the SN of the HD volume actually works, though when testing it on various systems, I've sometimes needed more privileges, so I stopped pursuing that path. It fails when running from (Linux) Live-OS.

And https://www.nextofwindows.com/the-best-way-to-uniquely-identify-a-windows-machine
mentions the Windows ProductId / SerialId from the Activation

That works, too. There are probably caveats when using the ProductID, while windows is still not activated, and possibly more issues when the os got activated (some weeks later). Does the ID change? What happens on hardware changes? What happens when the user upgrades from Windows 7 Home to Windows 7 Pro?

In the end I turned to MachineGuid because that seemed to be the most stable and universally available identifier I could find 😃

from machineid.

denisbrodbeck avatar denisbrodbeck commented on August 18, 2024

@shahidhk @MikeFair I think I've found the issue.

If one creates a x86 app and runs that app on a x64 windows, the error is triggered. Fixing it now.

from machineid.

MikeFair avatar MikeFair commented on August 18, 2024

Just did:
go get -u github.com\denisbrodbeck\machineid
go install github.com\denisbrodbeck\machineid\cmd\machineid

And all is well! :)
Awesome work!

from machineid.

shahidhk avatar shahidhk commented on August 18, 2024

Thanks @denisbrodbeck

from machineid.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.