473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to retrieve serial number of OS or CPU for copy protection?

In order to protect software from being copied without licence, I would like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.

Could you help?
Klaus

Jul 21 '05
79 13908
"R.Wieser" <ad*****@not.available> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...

[...]
Sorry, but this (ages +/10 thru 18) is the largest group of offenders.
This has a lot more to do with social and educational aspects
than with lost revenues.
Which is again why the youth should not be discarded as being
non-important: It's those people that should be made aware of the
implications of not honoring interlectual property.


I must confess I do not have a solution. I know that if everybody believes
that copying software, books, films, etc is "OK" then many will do so and
that will affect the producers severely. It is easy to pass a law that says
"copying is forbidden" and many adults will abide, but with kids and
teenagers it is a different story. I still believe that the only kind of
software that really suffers from unauthorized copying by kids is games, and
that makes the problem moot, for me.

[...]
*Only* when the software-company thinks it's benificiary to do so. And
only for the time that you are a student.
There are many such companies and a person is a student for a long time.
This may not be a perfect solution, but it is as best as it gets now.
And that means that at the moment you are no student anymore, you should
remove the software from your computer. And that gives you two choices :
buy their software for it's "normal" price (enabeling you to continue
working with a known product, continue using your build-up knowledge &
created data, *or* find another (maybe even cheaper and/or better)
package, and having the re-learn about everything, as well as having to
re-create old work .... I think we can make a safe gues that the first
option will be choosen, generating new revenue for the software-company.
Option three: find a job that will provide you with this software. This is
way to go, at least for me. Home use does not require all these expensive
applications -- most of the time you can buy a PC and it will have more than
adequate software installation.
Yes, they are called "microcontrollers". The only problem is that the
bottle-neck of such a solution (letting all calculations be done in such a
"dongle") is the transfer-speed of the data, as well as the easiness of
replacing such modules (by another piece of "software").
You misunderstood. There is no transfer. Everything is done in that
"super-dongle". A play station does not even have a CPU, it only has
video/sound/networking/HID and possibly external RAM.

This solution is not appropriate for a general purpose computer where
multiple applications must coexist, but it is entirely appropriate for a
play station.

[...]
And, in the past any kind of external device ment for continuous usage has
been cracked.


You would need an electron microscope and a high precision laser slicer to
crack that dongle. Not impossible, but very expensive.

S
Jul 21 '05 #51
Slava M. Usov <st************@gmx.net> schreef in berichtnieuws
uy**************@TK2MSFTNGP09.phx.gbl...

Hello Slava,
"R.Wieser" <ad*****@not.available> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...

[...]
Sorry, but this (ages +/10 thru 18) is the largest group of offenders.
This has a lot more to do with social and educational
aspects than with lost revenues.
Which is again why the youth should not be discarded as
being non-important: It's those people that should be made
aware of the implications of not honoring interlectual property.


I must confess I do not have a solution. I know that if everybody
believes that copying software, books, films, etc is "OK" then
many will do so and that will affect the producers severely. It is
easy to pass a law that says "copying is forbidden" and many
adults will abide,

but with kids and teenagers it is a different story. I still believe
that the only kind of software that really suffers from unauthorized
copying by kids is games, and that makes the problem moot, for me.
Not to the games-industry (which is software too), who complains loudly :-)
[...]
*Only* when the software-company thinks it's benificiary to
do so. And only for the time that you are a student.
There are many such companies and a person is a student for a
long time. This may not be a perfect solution, but it is as best as
it gets now.


It's not *a solution* at all. It's what you get, only because the
software-companies think they will benifit from it. That the students can
use the software for lower prices than other people, is nothing more than
a(n un-wanted) side-effect.
And that means that at the moment you are no student anymore,
you should remove the software from your computer. And that
gives you two choices : buy their software for it's "normal" price
(enabeling you to continue working with a known product,
continue using your build-up knowledge & created data, *or*
find another (maybe even cheaper and/or better) package, and
having the re-learn about everything, as well as having to re-create
old work .... I think we can make a safe gues that the first
option will be choosen, generating new revenue for the
software-company.


Option three: find a job that will provide you with this software.


Same problems apply : Those persons will have to learn a new package, which
(outside of people like in this newgroup) they might not desire ...
This is way to go, at least for me. Home use does not require
all these expensive applications -- most of the time you can
buy a PC and it will have more than adequate software installation.
Yes, they are called "microcontrollers". The only problem is
that the bottle-neck of such a solution (letting all calculations
be done in such a "dongle") is the transfer-speed of the data,
as well as the easiness of replacing such modules (by another
piece of "software").
You misunderstood. There is no transfer. Everything is done in that
"super-dongle". A play station does not even have a CPU, it only has
video/sound/networking/HID and possibly external RAM.


Well, I just can imagine a cubicle for a software-engeneer, having (quite a
number) of those "super dongles" sitting around :-)

But, maybe they could be linked to the LAN, which would take away the need
for having them in the persons vincinity ... Ofcourse, these kind of
solutions would only apply for companies, as now the software *as well as
the protecting hardware* have to be payed for.

Funily enough, that is mostly the very reason why most software-companies
have not applied such methods :-) Complaining about others being "wrong"
is a lot cheaper, and may actually, with aid of some horrendous laws, be
even more benificiary to them ...
This solution is not appropriate for a general purpose computer
where multiple applications must coexist, but it is entirely
appropriate for a play station.


Alas, playstation software has allready been cracked, and can be copied too.
The only reason why it does not happen on a wide scale is because they need
a sort of Mod-chip, which is quite difficult to come by, costly to install,
and will disable the persons ability to get on the play-stations
internet-servers. No such restrictions apply (yet) for PC's.
And, in the past any kind of external device ment for continuous usage has been cracked.


You would need an electron microscope and a high precision laser slicer to
crack that dongle. Not impossible, but very expensive.


Maybe. But just *one* crack would be enough, the internet would take care
of a rapid spread of the resulting, unencumbered software.

Regards,
Rudy Wieser

Jul 21 '05 #52
"R.Wieser" <ad*****@not.available> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...

[...]
Option three: find a job that will provide you with this software.
Same problems apply : Those persons will have to learn a new package,
which (outside of people like in this newgroup) they might not desire ...


Why? They use the same software.

[...]
Well, I just can imagine a cubicle for a software-engeneer, having (quite
a number) of those "super dongles" sitting around :-)
Who's talking about software engineers? We're talking about play stations.

[...]
Alas, playstation software has allready been cracked, and can be copied
too.
Because they do not use a "single-chip" technology. If you have a bit of
silicone that cannot be programmed, how are you going to crack it? Your only
option is to crack it _physically_, which is a bit too expensive to do.

[...]
Maybe. But just *one* crack would be enough, the internet would take care
of a rapid spread of the resulting, unencumbered software.


How? What are going to be the results of this crack? Code that executes on
hardware that does not exist except for this very software? This is as
useful as cracking P4 for its microcode.

S
Jul 21 '05 #53
> Coming from communist and atheist Russia you probably have never read the
following:

Exodus 20 15-Thou shalt not steal.

I saw everybody giving their opinion so I just thought you would like to
know God's.


What about this:
“For you have dishonored the poor person. Do not the rich oppress you? Are
not the rich those who drag you into law-courts?” [James 2:6 NCMM]

or this:

"you shall not harden your heart or shut your hand against your poor brother,
8 but you shall open your hand to him, and lend him sufficient for his need,
whatever it may be."

or this:

“[Yahweh] stands at the side of the poor, to save their lives from those who
sit in judgment of them.” [Psalm 109:31]

or this:

“He who oppresses the poor insults his Maker; he who is generous to the needy
honors Him.” [Proverbs 14:31 NEB]

Just pick, in the Bible there are plenty of parables and proverbs about rich
and poor. And I don't think there are many favoring the rich against the
poor. But for this you have to read the whole bible.

Now, tell me where is the bible does it condemn thing like copying a book,
a picture, (and leaving the original to the owner), singing a song you did
hear somewhere else and other acts considered now intelectual property
violation.

So, stop calling copying software "stealing". It is not that, not even the
American law calls it that. It is copyright violation, but not stealing.
Don't bring God into this and don't insult someone because it was not born
in USA. In general they know to appreciate the freedom you take for granted.
And they may know more about bible, geography, history, science, and many
other subjects foreign to you.
--
Mihai
-------------------------
Replace _year_ with _ to get the real email
Jul 21 '05 #54
Slava M. Usov <st************@gmx.net> schreef in berichtnieuws
e2**************@TK2MSFTNGP12.phx.gbl...

Hello Slava,
"R.Wieser" <ad*****@not.available> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...

[...]
Option three: find a job that will provide you with this software.
Same problems apply : Those persons will have to learn a new package,
which (outside of people like in this newgroup) they might not desire ....
Why? They use the same software.
Sorry, I over-read the "same" word :-\

Yes, if you can find a company that will want to do that, you can continue
using your accumulated knowledge & data.

But what are the chances to that ? When you enter a company where there
are more people doing a job like yours, or to replace someone, you will have
to adapt to whatever is allready there ....
[...]
Well, I just can imagine a cubicle for a software-engeneer, having
(quite a number) of those "super dongles" sitting around :-)


Who's talking about software engineers? We're talking about play stations.


And I was projecting your "super dongle"/playstation-idea to a
software-engeneers work-cubicle :-) What I ment is that such a "super
dongle" which, as far as I understood, cannot be tampered with, as it's an
(allmost) self-enclosed piece of firmware, only accepting input, and
providing output, would look like a play-station, would take a lot of space.

Now I say that, I do remember having seen a computer with multiple old-style
dongles plugged in into it's printer-port : they actually had an
extention-cord between the computer and the dongles, so they could place the
dongles on a flat surface, not mechanical tugging on the computer (about 5
attached to each other !)
[...]
Alas, playstation software has allready been cracked, and can be copied
too.
Because they do not use a "single-chip" technology. If you have a bit of
silicone that cannot be programmed, how are you going to crack it? Your

only option is to crack it _physically_, which is a bit too expensive to do.
Well, I've worked with micro-controllers which where fitted with a "disable
reading-out of the contents" -bit (you could leave it clear, or set it in
software). The controllers where based on EPROM technology, but without the
erasure-window fitted (you could actually order some with such a window, for
experimenting purposes, but they where four times the price), making it
PROM's.

The "read-disable" -bit could be erased, just like the rest of the memory,
although they made sure that that specific cell would need a lot more time
to get erased.

Later versions that cell could not be disabled anymore, as (so the story
goes) some handy gauy had found a method to remove the plastic body from
above the chip, and use some sort of laser-UV to erase just that cell
(enabeling him to read-out the chip again)

I did not hear of the cost that was involved with it, but the process was
described as "easy" ... :-\ :-)
[...]
Maybe. But just *one* crack would be enough, the internet would take care of a rapid spread of the resulting, unencumbered software.


How? What are going to be the results of this crack? Code that executes on
hardware that does not exist except for this very software? This is as
useful as cracking P4 for its microcode.


Did not think of that. Well, you got me there :-)

Ofcourse, if that specific processor could be bought, I do think that some
people would just place the ripped code in a new procesor, and merrily
continue their way (much like chip-cards that are used to unscramble
sattelite-tv receiver signals can be bought empty, and the code that should
be put in it is available within certain circles ...)

Regards,
Rudy Wieser

Jul 21 '05 #55
"R.Wieser" <ad*****@not.available> wrote in message
news:#q**************@TK2MSFTNGP12.phx.gbl...

[...]
> Option three: find a job that will provide you with this software.

[...]
But what are the chances to that ? When you enter a company where there
are more people doing a job like yours, or to replace someone, you will
have to adapt to whatever is allready there ....
If you cannot find a job that will pay you for using the software that you
have learned to use, then why do you need to have that software? The only
software that you need is that for home use, and you get that software when
you buy your PC.

[...]
What I ment is that such a "super dongle" which, as far as I understood,
cannot be tampered with, as it's an (allmost) self-enclosed piece of
firmware, only accepting input, and providing output, would look like a
play-station, would take a lot of space.
Hardly. I imagine that you can package a decent CPU with lots of ROM and
some RAM within a PII cartridge easily. Looking at the modern mobile phones,
it can probably be much less than that.

[...]
Well, I've worked with micro-controllers which where fitted with a
"disable reading-out of the contents" -bit (you could leave it clear, or
set it in software). The controllers where based on EPROM technology,
So, do not make it EPROM. The entire ROM (with its contents) can be printed
in the silicon.

[...]
Ofcourse, if that specific processor could be bought, I do think that some
people would just place the ripped code in a new procesor,
If you consider again that the CPU I'm talking about is printed together
with ROM and RAM, then it might be difficult to "reprogram" it. Your only
option would be to get a CPU with the same architecture and instruction set,
which may not be available. The latter can be made harder if the
architecture and the instruction set of the super dongles changes for each
game. Then you would have to buy either a very high performance generic
"emulator", which will cost a lot more than a few games, or buy a "blank"
super-dongle for each game, which will probably cost more than the game
itself.
(much like chip-cards that are used to unscramble sattelite-tv receiver
signals can be bought empty, and the code that should be put in it is
available within certain circles ...)


Right. Which forces you to spend money and effort, which is a lot less
comfortable than downloading a cracked game. Do you think that the number of
"cracked" sat-TV receivers is comparable with the number of "regular"
receivers?

S
Jul 21 '05 #56
Slava M. Usov <st************@gmx.net> schreef in berichtnieuws
uY**************@TK2MSFTNGP10.phx.gbl...

Hello Slava,
"R.Wieser" <ad*****@not.available> wrote in message
news:#q**************@TK2MSFTNGP12.phx.gbl...

[...]
> > Option three: find a job that will provide you with this software.
[...]
But what are the chances to that ? When you enter a company
where there are more people doing a job like yours, or to replace
someone, you will have to adapt to whatever is allready there ....
If you cannot find a job that will pay you for using the software
that you have learned to use, then why do you need to have
that software?


Because you needed *some*/any program to enable you to learn the generics of
a certain type of software ?

Hmm .. I think we where talking next to each other here ... :-\ :-)

Although the generics of all types of spreadsheets are the same, every
company's implementation of it has got it's specifics.
The only software that you need is that for home use, and you
get that software when you buy your PC.
I've got no idea what software nowerday's is sold as part of the OS, but it
better contain an layout-program (for electronics -use), as that is what I
use at home (in my hobby) :-)
What I ment is that such a "super dongle" which, as far as I understood,
cannot be tampered with, as it's an (allmost) self-enclosed piece of
firmware, only accepting input, and providing output, would look like a
play-station, would take a lot of space.


Hardly. I imagine that you can package a decent CPU with lots of ROM and
some RAM within a PII cartridge easily. Looking at the modern mobile

phones, it can probably be much less than that.
That leaves the question of how it will be connected to your computer
(keyboard, screen, harddisk) ...
Well, I've worked with micro-controllers which where fitted with a
"disable reading-out of the contents" -bit (you could leave it clear, or
set it in software). The controllers where based on EPROM technology,


So, do not make it EPROM. The entire ROM (with its contents) can be

printed in the silicon.
The story was an example. Think of *any* solution, and probably a
counter-solution will be thought of within shortly. If not intended to
make copying possible, than just as an exercise in solving a puzzle :-)
Ofcourse, if that specific processor could be bought, I do think that some people would just place the ripped code in a new procesor,


If you consider again that the CPU I'm talking about is printed together
with ROM and RAM, then it might be difficult to "reprogram" it. Your only
option would be to get a CPU with the same architecture and instruction

set, which may not be available. The latter can be made harder if the
architecture and the instruction set of the super dongles changes for each
game. Then you would have to buy either a very high performance generic
"emulator", which will cost a lot more than a few games, or buy a "blank"
super-dongle for each game, which will probably cost more than the game
itself.
Things that where thought to be true for DVD-decoding chips too (locking the
customer to a certain region), but yet, just a few weeks ago some company
was charged with illegal producing of "unlocked" chips ...
(much like chip-cards that are used to unscramble sattelite-tv receiver
signals can be bought empty, and the code that should be put in it is
available within certain circles ...)


Right. Which forces you to spend money and effort, which is a lot less
comfortable than downloading a cracked game. Do you think that the number

of "cracked" sat-TV receivers is comparable with the number of "regular"
receivers?


I would not know, as I can't remember ever having seen such numbers. :-)

But I do know that using those hacked cards was/is as easy as going to your
nearest hack-dealer. In other words : you just buy the hacked hardware from
someone else, and do not do it yourself at all.

Regards,
Rudy Wieser

But shall we stop here ? My response was aimed at software-companies
artificially upping their loss-figures, and we have deviated from it quite a
bit. :-) It's maybe possible to get at a point at which, due to a
combination of points (of which not all may be of a technical nature), it's
not doable/advicable to copy software. The future will tell us. Let's wait
for it :-)

Jul 21 '05 #57
Kazi,

Do you know whether or not, this activation signature is changed when
hardware configuration is modified?
Furthermore, what about OS upgrades? When Longhorn will be installed over
XP, is the activation signature affected?

Thanks and regards,
Klaus
Jul 21 '05 #58
"Klaus Bonadt" <Bo****@hotmail.com> wrote:

Do you know whether or not, this activation signature is changed when
hardware configuration is modified?
Yes, it is. There is a description of the activation signature process on
Microsoft's licensing web site. There are about 10 hardware configuration
items included in the signature. Some small number of them be modified
without invalidating the signature.
Furthermore, what about OS upgrades? When Longhorn will be installed over
XP, is the activation signature affected?


Service packs and hotfixes do not affect the signature, but a brand-new
operating system (assuming that Longhorn is not release as XP SP4) will
probably have a new activation scheme.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc
Jul 21 '05 #59
"Klaus Bonadt" wrote:
In order to protect software from being copied without licence, I would like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.


I presume you would need to use interop (or some C/C++ code) to retrieve
some of this information from within in the Win32 API.

We have tried to set up a similar thing for our software, and some values
are available from the registry, Environment class and the WMI store (via
ManagementObject class).

The code we use to generate a unique hardware installation code is below.

One improvement I would like to make is to allow parts of the hash to vary
without requiring a re-authorisation (e.g. allow IP address to change, but
still work). We did not have time to implement this the first time around.

(You need to store the original hash, then do two comparisons: one that the
original hash is valid (according to your product signature) and then that
the current hash is similar enough to the original hash.)

Note that this is the approach the Microsoft products use. I'd also like to
use the same structure of hardware hash as them.

Technical details of the Microsoft activation is available at:

http://www.microsoft.com/technet/pro...e/xpactiv.mspx

Let us know if you find the right Win32 API functions, registry keys, etc.

- Stephen Gryphon

private static string GenerateInstallationID( string productID )
{
StringBuilder systemInfo = new StringBuilder( productID );

RegistryKey processorKey = Registry.LocalMachine.OpenSubKey(
@"HARDWARE\DESCRIPTION\System\CentralProcessor\ 0" );
systemInfo.Append( processorKey.GetValue("Identifier") );
systemInfo.Append( processorKey.GetValue("ProcessorNameString") );

RegistryKey windowsKey = Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\Microsoft\Windows NT\CurrentVersion" );
systemInfo.Append( processorKey.GetValue("ProductId") );

systemInfo.Append( Environment.MachineName );
systemInfo.Append( Environment.OSVersion );
systemInfo.Append( Environment.SystemDirectory );

try
{
foreach( ManagementObject physicalMedia in new
ManagementClass("Win32_PhysicalMedia").GetInstance s() )
{
systemInfo.Append( physicalMedia["SerialNumber"] );
break;
}
}
catch( Exception ) {}

try
{
foreach( ManagementObject bios in new
ManagementClass("Win32_BIOS").GetInstances() )
{
systemInfo.Append( bios["Name"] );
systemInfo.Append( bios["SerialNumber"] );
break;
}
}
catch( Exception ) {}

try
{
foreach( ManagementObject disk in new
ManagementClass("Win32_DiskDrive").GetInstances() )
{
systemInfo.Append( disk["Model"] );
systemInfo.Append( disk["Signature"] );
break;
}
}
catch( Exception ) {}

//Console.WriteLine( systemInfo.ToString() );

byte[] sysInfoBytes = System.Text.Encoding.ASCII.GetBytes(
systemInfo.ToString() );
System.Security.Cryptography.HashAlgorithm hashAlg =
System.Security.Cryptography.HashAlgorithm.Create( );
byte[] hash = hashAlg.ComputeHash( sysInfoBytes );

/*
StringBuilder hashHex = new StringBuilder();
foreach( byte b in hash )
{
hashHex.AppendFormat( "{0:x2} ", b );
}
Console.WriteLine( "HASH '{0}'", hashHex.ToString(0, hashHex.Length - 1) );
*/

ToBase64Transform tx = new ToBase64Transform();
int blocks = (int)Math.Ceiling( hash.Length / tx.InputBlockSize );
byte[] hash64 = new byte[ blocks * tx.OutputBlockSize ];

for( int block = 0; block < blocks; block++ )
{
tx.TransformBlock( hash, block * tx.InputBlockSize, tx.InputBlockSize,
hash64, block * tx.OutputBlockSize );
}

//byte[] hash64 = tx.TransformFinalBlock( hash, 0, hash.Length );

return System.Text.Encoding.ASCII.GetString( hash64 );
}

Jul 21 '05 #60
I have found code to do this, but why is the VB.NET code still so much
different than what is used in Access today ?

Imports System
Imports System.Management
Public Function GetMacAddress() As String()
Dim Query As ManagementObjectSearcher
Dim QueryCollection As ManagementObjectCollection
Dim Oq As ObjectQuery
Dim Co As ConnectionOptions = New ConnectionOptions()
Dim Ms As ManagementScope = New ManagementScope("\\\\\\\\\\\\\\\\" +
Environment.MachineName + "\\\\\\\\root\\\\\\\\cimv2", Co)
Oq = New ObjectQuery("SELECT * FROM
Win32_NetworkAdapterConfiguration")
Query = New ManagementObjectSearcher(Ms, Oq)
QueryCollection = Query.Get
Dim Mo As ManagementObject
Dim Tablo() As String
Dim Compteur As Integer = 0
For Each Mo In QueryCollection
If CType(Mo("IPEnabled"), Boolean) = True Then
ReDim Preserve Tablo(Compteur)
Tablo(Compteur) = CType(Mo("MacAddress"), String)
Compteur += 1
End If
Next
Return Tablo
End Function

Henry

"Jerry Pisk" wrote:
There is nothing like that. A NIC's MAC address should be unique but not
everybody has a network card and some cards allow you to change their MAC
address.

Jerry

"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP11.phx.gbl...

"Jakob Christensen" <jc*******@pension.dk> schrieb im Newsbeitrag
news:85**********************************@microsof t.com...
You can obtain this information using WMI. E.g. to get the serial number

of
the OS, you would use the Win32_OperatingSystem WMI class. You can use

WMI
using the System.Management namespace of .net

Let me know if you need some more information on how to use WMI from .net

:-)

Jakob,

This seems to be something like a product version number. It is probably
not
unique among users. I am looking for a serial number, which is unique for
each system, something like the CD key of the operating system.

Best regards,
Klaus


Jul 21 '05 #61
I tried on two machines (Win2k and XP), both gave the following result:
Hardware ID:
UUID : FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
Vendor :
Name :
IdentifyingNumber :
Feedback:

UUID : not valid
Vendor : empty
Name : empty
IdentifyingNumber : empty
Regards,
Klaus
Jul 21 '05 #62
Hmmm, It's very interesting. We have about 50 computers on our network, 20
of them are running WinXP or Win2000 (the rest is NT4). 15 are brand PCs, 5
are noname. All of them have this kind of hardware information.
"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:un**************@TK2MSFTNGP15.phx.gbl...
I tried on two machines (Win2k and XP), both gave the following result:
Hardware ID:
UUID : FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
Vendor :
Name :
IdentifyingNumber :
Feedback:

UUID : not valid
Vendor : empty
Name : empty
IdentifyingNumber : empty
Regards,
Klaus

Jul 21 '05 #63
I wondered if you would consider using the MAC address for this?

http://www.codeguru.com/Cpp/I-N/netw...cle.php/c5451/
"Kazi" <no****@please.com> wrote in message
news:eC**************@TK2MSFTNGP11.phx.gbl...
I'm researching this problem heavily, and maybe I have found a better
solution. There is a Win32_ComputerSystemProduct class in WMI, which may
contain the information what we need.

http://msdn.microsoft.com/library/en...temproduct.asp
I have created a simple little app (WMI and .Net 1.1 runtime needed), which displays this info and I have run it on several computers. The result a bit surprising to me, almost every computer have this kind of hardware
identification information. The application contains two separate section:
the first section displays the computer identification data (HardwareID),
the second contains the result of checking the data (Feedback).

I would like to ask everybody run my attached app, and please post the
result back to this newsgroup. The result must be on of the following:

-- 1. -------------------------
UUID : ok
Vendor : ok
Name : ok
IdentifyingNumber: ok

-- 2. -------------------------
UUID : not valid
Vendor : ok
Name : ok
IdentifyingNumber: ok

-- 3. -------------------------
UUID : ok
Vendor : empty
Name : empty
IdentifyingNumber: empty

-- 4. -------------------------
The HardwareID not found!

So you can see, the feedback section of my app does not contain any
confidential data. It would be nice to see lot of feedback to get to know,
does it really works.

Thanks in advance:
Kazi

"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Kazi,

Do you know whether or not, this activation signature is changed when
hardware configuration is modified?
Furthermore, what about OS upgrades? When Longhorn will be installed over XP, is the activation signature affected?

Thanks and regards,
Klaus


Jul 21 '05 #64
Many Thanks for beeing that concrete !
However, I've tried to do the same with a Visual6 Application, but I suppose
the code you generously offer is based on a update version and many types are
herein so unrecognised !... for instance StringBuilder, what to do to make it
known from the compil (what #include, lib... ?)

Regards.

S

"Stephen Gryphon" wrote:
"Klaus Bonadt" wrote:
In order to protect software from being copied without licence, I would like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.


I presume you would need to use interop (or some C/C++ code) to retrieve
some of this information from within in the Win32 API.

We have tried to set up a similar thing for our software, and some values
are available from the registry, Environment class and the WMI store (via
ManagementObject class).

The code we use to generate a unique hardware installation code is below.

One improvement I would like to make is to allow parts of the hash to vary
without requiring a re-authorisation (e.g. allow IP address to change, but
still work). We did not have time to implement this the first time around.

(You need to store the original hash, then do two comparisons: one that the
original hash is valid (according to your product signature) and then that
the current hash is similar enough to the original hash.)

Note that this is the approach the Microsoft products use. I'd also like to
use the same structure of hardware hash as them.

Technical details of the Microsoft activation is available at:

http://www.microsoft.com/technet/pro...e/xpactiv.mspx

Let us know if you find the right Win32 API functions, registry keys, etc.

- Stephen Gryphon

private static string GenerateInstallationID( string productID )
{
StringBuilder systemInfo = new StringBuilder( productID );

RegistryKey processorKey = Registry.LocalMachine.OpenSubKey(
@"HARDWARE\DESCRIPTION\System\CentralProcessor\ 0" );
systemInfo.Append( processorKey.GetValue("Identifier") );
systemInfo.Append( processorKey.GetValue("ProcessorNameString") );

RegistryKey windowsKey = Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\Microsoft\Windows NT\CurrentVersion" );
systemInfo.Append( processorKey.GetValue("ProductId") );

systemInfo.Append( Environment.MachineName );
systemInfo.Append( Environment.OSVersion );
systemInfo.Append( Environment.SystemDirectory );

try
{
foreach( ManagementObject physicalMedia in new
ManagementClass("Win32_PhysicalMedia").GetInstance s() )
{
systemInfo.Append( physicalMedia["SerialNumber"] );
break;
}
}
catch( Exception ) {}

try
{
foreach( ManagementObject bios in new
ManagementClass("Win32_BIOS").GetInstances() )
{
systemInfo.Append( bios["Name"] );
systemInfo.Append( bios["SerialNumber"] );
break;
}
}
catch( Exception ) {}

try
{
foreach( ManagementObject disk in new
ManagementClass("Win32_DiskDrive").GetInstances() )
{
systemInfo.Append( disk["Model"] );
systemInfo.Append( disk["Signature"] );
break;
}
}
catch( Exception ) {}

//Console.WriteLine( systemInfo.ToString() );

byte[] sysInfoBytes = System.Text.Encoding.ASCII.GetBytes(
systemInfo.ToString() );
System.Security.Cryptography.HashAlgorithm hashAlg =
System.Security.Cryptography.HashAlgorithm.Create( );
byte[] hash = hashAlg.ComputeHash( sysInfoBytes );

/*
StringBuilder hashHex = new StringBuilder();
foreach( byte b in hash )
{
hashHex.AppendFormat( "{0:x2} ", b );
}
Console.WriteLine( "HASH '{0}'", hashHex.ToString(0, hashHex.Length - 1) );
*/

ToBase64Transform tx = new ToBase64Transform();
int blocks = (int)Math.Ceiling( hash.Length / tx.InputBlockSize );
byte[] hash64 = new byte[ blocks * tx.OutputBlockSize ];

for( int block = 0; block < blocks; block++ )
{
tx.TransformBlock( hash, block * tx.InputBlockSize, tx.InputBlockSize,
hash64, block * tx.OutputBlockSize );
}

//byte[] hash64 = tx.TransformFinalBlock( hash, 0, hash.Length );

return System.Text.Encoding.ASCII.GetString( hash64 );
}

Jul 21 '05 #65
Off the top I would like to say I am a beginner in C# and was not able to
understand your code from your previous posting for protecting my software. I
am trying to add this security to my C# windows form software.

Such as:
1) What is in the foreach statement mean? Could you tell me how this
actually would be written as if I am adding it to my software?
2) Also I assume after adding this method to my main class, how does it
actually prevent the copying? Does this mean that I need to actually check
each customers OS ID and customize it to the OS:
a. Get users OS ID
b. Set key to OS ID so it can only be loaded to that computer.
If so how does this work if I have no direct access to my customers?

Appreciate All your help,

Kidus.
"Kazi" wrote:
The number one problem of a copy protection algorithm is identifying
machines. Is there a number that uniquely identify a computer? Let’s call
this number as "Serial Number" (SN).

What are the requirements for a Serial Number? There are two:

1. A Serial Number must be different on different computers.
2. A Serial Number must be the same on the same computer.

Today’s PCs do not contain such a hardware id which meet these requirements.
Because of this, we should loosen these hard requirements. I’ve modified the
second requirement this way:

2. The Serial Number must be the same on the same computer, but if somebody
successfully changes the serial number on a computer, it involves serious
consequences.

I think, there is such a "Number" in Windows XP, it’s the following value in
the registry:

HKEY_LOCAL_MACHINE\SYSTEM\WPA\SigningHash-*...*\SigningHashData

It’s a byte array and it contains the Windows Product activation signature.
It’s hard to overwrite (the kernel protects it), but it isn’t worth to
overwrite, because the attacker can’t reactivate his copy of Windows again.

You can read that value in C# in the following way:

public static byte[] GetHardwareIdBytes()
{
using(RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA",
false))
{
foreach(string subkey in rk.GetSubKeyNames())
{
if(subkey.IndexOf("SigningHash") == 0)
{
using(RegistryKey rk1 = rk.OpenSubKey(subkey))
{
return (byte[])rk1.GetValue("SigningHashData");
}
}
}
}
// It should never happen:
throw new Exception("There is no hardware id on this computer!");
}

This solution has two disadvantages:
1. It works only on Windows XP (or later)
2. The SN changes, when the user reinstalls the operating system.
Kazi
"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:ue****************@TK2MSFTNGP10.phx.gbl...
In order to protect software from being copied without licence, I would

like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.

Could you help?
Klaus


Jul 21 '05 #66
I tested this code snppet for my own use and some computers seem to be
missing the registry values (i used "regedit" to verify)

what could be the problem?

thanks
Zacho

"Kazi" wrote:
The number one problem of a copy protection algorithm is identifying
machines. Is there a number that uniquely identify a computer? Let’s call
this number as "Serial Number" (SN).

What are the requirements for a Serial Number? There are two:

1. A Serial Number must be different on different computers.
2. A Serial Number must be the same on the same computer.

Today’s PCs do not contain such a hardware id which meet these requirements.
Because of this, we should loosen these hard requirements. I’ve modified the
second requirement this way:

2. The Serial Number must be the same on the same computer, but if somebody
successfully changes the serial number on a computer, it involves serious
consequences.

I think, there is such a "Number" in Windows XP, it’s the following value in
the registry:

HKEY_LOCAL_MACHINE\SYSTEM\WPA\SigningHash-*...*\SigningHashData

It’s a byte array and it contains the Windows Product activation signature.
It’s hard to overwrite (the kernel protects it), but it isn’t worth to
overwrite, because the attacker can’t reactivate his copy of Windows again.

You can read that value in C# in the following way:

public static byte[] GetHardwareIdBytes()
{
using(RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA",
false))
{
foreach(string subkey in rk.GetSubKeyNames())
{
if(subkey.IndexOf("SigningHash") == 0)
{
using(RegistryKey rk1 = rk.OpenSubKey(subkey))
{
return (byte[])rk1.GetValue("SigningHashData");
}
}
}
}
// It should never happen:
throw new Exception("There is no hardware id on this computer!");
}

This solution has two disadvantages:
1. It works only on Windows XP (or later)
2. The SN changes, when the user reinstalls the operating system.
Kazi
"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:ue****************@TK2MSFTNGP10.phx.gbl...
In order to protect software from being copied without licence, I would

like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.

Could you help?
Klaus


Sep 23 '05 #67
the app seems to be gone, how do I get it....please
could somebody show me a sample implementation ...showing how to access the
class in visual basic.net

thanks
Zacho

Sep 23 '05 #68
Here is some code to get the hard drive serial number.
You'll need these using statements

using System.Text; // StringBuilder
using System.Runtime.InteropServices; // DllImport


private void Form1_Load(object sender, System.EventArgs e)
{
Text = GetVolumeSerial("C");
}

/*
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName,
LPTSTR lpVolumeNameBuffer,
DWORD nVolumeNameSize,
LPDWORD lpVolumeSerialNumber,
LPDWORD lpMaximumComponentLength,
LPDWORD lpFileSystemFlags,
LPTSTR lpFileSystemNameBuffer,
DWORD nFileSystemNameSize
);
*/

[DllImport("kernel32.dll")]
private static extern long GetVolumeInformation(
string rootPathName,
StringBuilder volumeNameBuffer,
UInt32 volumeNameSize,
ref UInt32 volumeSerialNumber,
ref UInt32 maximumComponentLength,
ref UInt32 fileSystemFlags,
StringBuilder fileSystemNameBuffer,
UInt32 fileSystemNameSize);

private string GetVolumeSerial(string driveLetter)
{
uint serNum = 0;
uint maxCompLen = 0;
StringBuilder label = new StringBuilder(256);
UInt32 flags = new UInt32();
System.Text.StringBuilder fileSystem = new StringBuilder(256);
driveLetter+=@":\";
long Ret = GetVolumeInformation(driveLetter, label, (UInt32)label.Capacity, ref serNum, ref maxCompLen, ref flags, fileSystem, (UInt32)fileSystem.Capacity);

return Convert.ToString(serNum,16);
}
Zachovich wrote:
I tested this code snppet for my own use and some computers seem to be
missing the registry values (i used "regedit" to verify)

what could be the problem?

thanks
Zacho

"Kazi" wrote:

The number one problem of a copy protection algorithm is identifying
machines. Is there a number that uniquely identify a computer? Let’s call
this number as "Serial Number" (SN).

What are the requirements for a Serial Number? There are two:

1. A Serial Number must be different on different computers.
2. A Serial Number must be the same on the same computer.

Today’s PCs do not contain such a hardware id which meet these requirements.
Because of this, we should loosen these hard requirements. I’ve modified the
second requirement this way:

2. The Serial Number must be the same on the same computer, but if somebody
successfully changes the serial number on a computer, it involves serious
consequences.

I think, there is such a "Number" in Windows XP, it’s the following value in
the registry:

HKEY_LOCAL_MACHINE\SYSTEM\WPA\SigningHash-*...*\SigningHashData

It’s a byte array and it contains the Windows Product activation signature.
It’s hard to overwrite (the kernel protects it), but it isn’t worth to
overwrite, because the attacker can’t reactivate his copy of Windows again.

You can read that value in C# in the following way:

public static byte[] GetHardwareIdBytes()
{
using(RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA",
false))
{
foreach(string subkey in rk.GetSubKeyNames())
{
if(subkey.IndexOf("SigningHash") == 0)
{
using(RegistryKey rk1 = rk.OpenSubKey(subkey))
{
return (byte[])rk1.GetValue("SigningHashData");
}
}
}
}
// It should never happen:
throw new Exception("There is no hardware id on this computer!");
}

This solution has two disadvantages:
1. It works only on Windows XP (or later)
2. The SN changes, when the user reinstalls the operating system.
Kazi
"Klaus Bonadt" <Bo****@hotmail.com> wrote in message
news:ue****************@TK2MSFTNGP10.phx.gbl.. .
In order to protect software from being copied without licence, I would


like
to use something like a key, which fits only to the current system. The
serial number of the CPU or the current operating system would be
appropriate. However, I do not know how to retrieve the information.

Could you help?
Klaus


Sep 23 '05 #69
TC
That /does not/ return the hard disk serial number. It returns the
/volume/ serial number - a completely different thing.

Getvolumeinformation returning the hard disk serial number, is an
enduring usenet myth.

HTH,
TC

Sep 24 '05 #70
No such from Pentium III :( , you can use MAC of network card if computer
have such but you need to do it in kernel mode to retrieve permanent MAC
Arkady

"Zachovich" <Za*******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
the app seems to be gone, how do I get it....please
could somebody show me a sample implementation ...showing how to access
the
class in visual basic.net

thanks
Zacho

Sep 24 '05 #71

"TC" <aa**********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
That /does not/ return the hard disk serial number. It returns the
/volume/ serial number - a completely different thing.

Getvolumeinformation returning the hard disk serial number, is an
enduring usenet myth.

HTH,
TC

So is using the OS or CPU serial numbers and MAC addresses for copy
protection :-)

Willy.
Sep 24 '05 #72
TC
Couldn't you get the MAC by creating a GUID?

TC

Sep 25 '05 #73
TC
I agree. But getvolumeinformation <> hard disk serial number is a
favourite hobby horse of mine, so I jump on it instantly, whenever I
see it galloping past!

Cheers,
TC

Sep 25 '05 #74
> Couldn't you get the MAC by creating a GUID?
No. Since Windows 2000 MAC isn't part of GUID anymore
Sep 25 '05 #75

"Arkady Frenkel" <ar*****@hotmailxdotx.com> skrev i meddelandet
news:O%****************@TK2MSFTNGP12.phx.gbl...
No such from Pentium III :( , you can use MAC of network card if
computer have such but you need to do it in kernel mode to retrieve
permanent MAC
Arkady


That would make it a license violation to change the network card.

Is that a reasonable restriction? :-)

Bo Persson
Sep 25 '05 #76
Doesn't have to even be change the card, add a new one and you have a 50/50
odds that you are hosed.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Bo Persson" <bo*@gmb.dk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

"Arkady Frenkel" <ar*****@hotmailxdotx.com> skrev i meddelandet
news:O%****************@TK2MSFTNGP12.phx.gbl...
No such from Pentium III :( , you can use MAC of network card if computer
have such but you need to do it in kernel mode to retrieve permanent MAC
Arkady


That would make it a license violation to change the network card.

Is that a reasonable restriction? :-)

Bo Persson

Sep 25 '05 #77
And that MAC is not permanent BTW
Arkady

"Waleri Todorov" <wa****@refer.NoSpam.bg> wrote in message
news:MP************************@news.microsoft.com ...
Couldn't you get the MAC by creating a GUID?

No. Since Windows 2000 MAC isn't part of GUID anymore

Sep 25 '05 #78
Correct. This is not a hardware serial number but one that is assigned when formatted.

As said somewhere else in this thread using any of these methods for copy protection is a waste of time.

TC wrote:
That /does not/ return the hard disk serial number. It returns the
/volume/ serial number - a completely different thing.

Getvolumeinformation returning the hard disk serial number, is an
enduring usenet myth.

HTH,
TC

Sep 26 '05 #79
Even simpler, copy protection is a waste of time. At best, it's just
another challenge to the crackerz.

--

- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
"Darren" <un*****@unknown.com> wrote in message
news:#a*************@TK2MSFTNGP15.phx.gbl...
Correct. This is not a hardware serial number but one that is assigned when
formatted.

As said somewhere else in this thread using any of these methods for copy
protection is a waste of time.

TC wrote:
That /does not/ return the hard disk serial number. It returns the
/volume/ serial number - a completely different thing.

Getvolumeinformation returning the hard disk serial number, is an
enduring usenet myth.

HTH,
TC

Sep 26 '05 #80

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

79
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.