Jump to content
  • Advertisement
Sign in to follow this  
pDK

Machine ID

This topic is 4711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quick and easy: What is the best way to derive a Machine ID (aka: System ID , Computer ID)? Looking for some API calls to get a few serial numbers and compile them into a 128bit ID. -Eric [edited for engrish] Also, I am not going to bother with the CPU serial number... becuase only PIII's support that :).

Share this post


Link to post
Share on other sites
Advertisement
MAC addresses are unigue. Assuming the machine has an ethernet card, it has a unigue identification right there. If it has more then one, just pick one. If it doesn't have any, there aren't any other machines to worry about anyway.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That is what I was thinking, but my NIC on my laptop has a programmable one...

I also looked into hard drive serials... but I forgot that API call...

The only other routes I can think of are dongles (which I'm never going to do) and registry/file (which is easy to edit).

I heard of some functions that also use the creation date of a folder (C:\windows or the program's ROOT folder)...

Share this post


Link to post
Share on other sites
Hi

You could use WMI - I think this is standard on w2k and newer windows OSes

VBScript example:

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM CIM_Chassis", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
WScript.Echo objitem.SerialNumber
Next

Share this post


Link to post
Share on other sites
WMI... wow.. never heard of that... prob cause I'm not a systems admin :). Let me see if I can whip up a C++ port of that code and see what that brings me...

Looking on the MSDN site, it does not give me the full details as to what serial number this is pulling from. Does this return the individual physical elements' S/Ns (ie: sound cards... hard drives... cd roms... etc)? Or on the system as the whole?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
That is what I was thinking, but my NIC on my laptop has a programmable one...

I seriously doubt it has a programmable MAC address. The entire point in MAC's is that they're static and unique.

Share this post


Link to post
Share on other sites
Quote:
Original post by Spoonbender
Quote:
Original post by Anonymous Poster
That is what I was thinking, but my NIC on my laptop has a programmable one...

I seriously doubt it has a programmable MAC address. The entire point in MAC's is that they're static and unique.

I don't wanna derail things here... So, quickly: both of the network routers that I've had recently can either clone or simply change their MAC addresses. I was always taught that MAC's were static/unique, but this little quirk always confused me [smile]

Cheers,
Jack

Share this post


Link to post
Share on other sites
You can alter the reported MAC address in software trivially.

Does CPUID include a unique CPU serial number? I can't remember. Hard drive and RAM serial numbers might be accessible too...maybe even mobo.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!