Re: Read HD serial Number

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: MikeD (nobody_at_nowhere.edu)
Date: 06/21/04


Date: Mon, 21 Jun 2004 19:00:59 -0400


"BJ" <BigNoSpamJim@hotmail.com> wrote in message
news:40d73421.1352405@powernews.inwind.it...
> So the problem was not on building up
> a hard-disk based protection,
> but was on building up
> a SOLELY hard-disk based protection...

That's what I originally said. Let me quote it for you: "If used alone,
that makes for a pretty bad copy protection scheme." Note the first 3 words
of that: "If used alone". I even reitterated that in a second post and am
now reitterating it in a third post (and your reitteration of it makes it 4
times). <g>

>
> What ways does VISUAL BASIC
> (by APIs or not by APIs)
> provide the developer with,
> to retrieve Hardware information
> (other than the 'Volume serial number'
> that we all know yet) ?
>
> About the Video Card you mentioned,
> or about the MainBoard,
> or Bios,
> or about the real Hard Disk number,
> or about the Sound Card...

Not many really. VB doesn't provide that kind of low-level hardware access.
Windows, by its nature, doesn't make it easy even in other high-level
programming languages (that is, to get the information directly from the
hardware). It's all in the Registry, but trying to get the "right"
information for any given PC is not a simple task either. This is partly
because, unless you install Windows clean, the Registry may contain
information about hardware that's not even present anymore. For example, I
remember upgrading my video card and even after replacing the card, the
Registry still contained information about my old video card (and some
applications reported this card although it wasn't even installed and its
drivers HAD been removed).

If you want, run regedit.exe and LOOK (if you change anything, or anything
happens, and Windows won't boot anymore or anything is "wrong", it's not my
fault; you're running regedit.exe at your own risk) at the information found
under "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001". There's lots of hardware
information there. It's just that you won't necessarily know exactly what
keys to find it under for any given PC. Some things are easier than others.
For example, under "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\IDE", there
should be a subkey for each IDE device attached to the PC. On my system,
there are 4 subkeys under this because I have 2 physical hard drives and 2
CD-ROM drives (well, one's a writer). Another place to look in the Registry
for hardware information is "HKEY_LOCAL_MACHINE\HARDWARE". On my system, I
found the BIOS date and version and the video card's BIOS date from
"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System" and information about the
processor from
"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0".

I'm not real familiar with DirectX, but you might look into that. For
example, Direct3D or DirectDraw may provide properties for getting
information about the video card, DirectSound for the sound card, etc. You
might also want to look into WMI (which I'm not real familiar with either,
but it might be of help in getting hardware information such as you're
wanting).

Some things are pretty easy to get from API functions. For example, you can
get the amount of RAM or the size of a logical hard drive partition (or all
partitions) fairly easily. You can also get the processor family fairly
easily. I don't think you can get the exact processor, for example Pentium
3 or Pentium 4, but only that it's a Pentium, which is probably pretty much
worthless information. And, under NT-based versions of Windows, you can get
the processor's speed from the Registry, although it may not be exact (but
should be close enough). As far as things like the mainboard's serial
number or the BIOS version, there's no easy way to get this that I know of
using VB unless it happens to be in the Registry (as described above).

>From all of these various ways of getting certain information about the
hardware that's installed, you should be able to create a pretty decent
protection scheme. How far you want to go with all of this is up to you.
But....you have to (and I mean HAVE TO) allow a certain tolerance for
hardware changes! Your program shouldn't stop working (refuse to run, go
back to demo mode, or whatever) just because a user installs a new video
card. You can't even assume that a different processor equates to a
"different computer". A mainboard might support many different processors
and a user could just upgrade the processor and nothing else. Even that
should not prevent your software from "working" due to it "thinking" it's
being run under a different PC.

Mike



Relevant Pages

  • Re: Intermittent Registry corruption during shutdown :(
    ... | I seem to have an annoying problem where every once in a while, where the registry seems to get | corrupted. ... | Now because I see no sign of a problem while Windows is running, I suspect | that it gets corrupted during shutdown. ... and I've never found a problem (anyone have recommendations regarding | hardware testing tools?). ... | Graphics card: PNY Verto NVidia Geforce 4 Ti4400 | Network card: 3Com 3c905B-TX ...
    (microsoft.public.win2000.registry)
  • Re: Cloning Window XP Embedded
    ... If you do implement some copy protection, obfuscate when it is run and how ... > hacked version of your XPe image to run their application in their product ... > some unique attribute of your hardware in the registry. ...
    (microsoft.public.windowsxp.embedded)
  • Intermittent Registry corruption during shutdown :(
    ... Then the next time I start up, I get some sort of registry related error, ... how late during shutdown does the registry get written? ... Anyway, I have ran all sorts of hardware checks I can think of, Memory, HDD, ... Graphics card: PNY Verto NVidia Geforce 4 Ti4400 ...
    (microsoft.public.win2000.registry)
  • Re: System slow afer XP-SP2 Update on some applications
    ... Updated your video/sound card hardware drivers from the manufacturers' web ... Many problems just became more noticable with SP2, ...
    (microsoft.public.windowsupdate)
  • Re: On-line Review of "Art of Assembly"
    ... > work with another PC OS, including the hardware drivers? ... Windows, you can use "CygWin" where the Linux kernel has been written ... Plus, on this score, stop to think about _why_ Microsoft insist on ... "protection" was totally flawed from beginning to end and only hurt ...
    (alt.lang.asm)