🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.deployment
11 messages
11 total messages Started by zhan wei ming Sun, 26 Sep 2004 03:37
software protection
#254
Author: zhan wei ming
Date: Sun, 26 Sep 2004 03:37
15 lines
1370 bytes
Hi,

I spent a lot of time to develop a program and now I want make a trial
version for my customer.  Currently the protect mechanism is: when the user
first run the program, it read the disk id and display to the user. then the
user send the id to me and I work out a code based on the id and send back
to the user. after entering the code, the program then can be launched.

Question is that I am afraid the program can be cracked. for example I heard
that there is a tool to make the ID of two disks the same. then the protect
machanism will be no use.

Anyone knows a better way?

thanks
Re: software protection
#255
Author: Vladimir Stefanovic
Date: Sun, 26 Sep 2004 05:58
52 lines
2663 bytes
zhan wei ming wrote in message
> [...] Currently the protect mechanism is: when the user
> first run the program, it read the disk id [...]

Do you read the Volume disk id ( GetVolumeInformation() ) or
you are reading hardware hd serial number?

If you are using GetVolumeInformation() then there are many tools
to change the ID like 'volumeid.exe'. So this is no reliable at all.
Also when the user re-formats the disk your mechanism of licensing
is down.

If you want to learn how to read the hardware hd serial then look at
www.winsim.com/diskid32/diskid32.html

This is much more reliable but when the user changes the HD which is
common nowadays your mechanism of licensing is down again.

> Question is that I am afraid the program can be cracked. for example
> heard hat there is a tool to make the ID of two disks the same. then
> the protect machanism will be no use.

Yes, read above. Be sure that crackers will generally not dig of
what you are checking. It's much easier for them to find code
constructions like this...

if ( IsSerialNumberValidForThisMachine() == false )
   Terminate();

... and to reverse the logic ( false -> true ).


> Anyone knows a better way?

You can also check for Network card IDs. There are couple of articles
on Borland developers network of how to read this. Network cards
generaly never removes or replaces from machine so it's also a
solution.
The bad information is that I heared (but not checked) that there are
some
NIC cards (Chinesse made) whose NIC ID can be changed from code ;(

Hardlocks are the best solution among those two I mentioned.

There are also some other solutions which some companies can do for
you,
but that's another story.



Best regards,
Vladimir Stefanovic
Try SoftwareKey.COM
#256
Author: Tim Peer
Date: Mon, 27 Sep 2004 06:57
26 lines
1707 bytes
Try Software Key. http://www.softwarekey.com/Default.asp

Tim
"zhan wei ming" <zhanweiming@hotmail.com> wrote in message
news:4156396e@newsgroups.borland.com...
> Hi,
>
> I spent a lot of time to develop a program and now I want make a trial
> version for my customer.  Currently the protect mechanism is: when the
user
> first run the program, it read the disk id and display to the user. then
the
> user send the id to me and I work out a code based on the id and send back
> to the user. after entering the code, the program then can be launched.
>
> Question is that I am afraid the program can be cracked. for example I
heard
> that there is a tool to make the ID of two disks the same. then the
protect
> machanism will be no use.
>
> Anyone knows a better way?
>
> thanks
>
>
Re: software protection
#258
Author: zhan wei ming
Date: Mon, 27 Sep 2004 12:26
62 lines
2990 bytes
unfortunatelly, I am from China and my customer I guess uses chinese-made
network card.

thank you anyway for your help.

"Vladimir Stefanovic" <spam@not.needed> wrote in message
news:41565a41@newsgroups.borland.com...
> zhan wei ming wrote in message
> > [...] Currently the protect mechanism is: when the user
> > first run the program, it read the disk id [...]
>
> Do you read the Volume disk id ( GetVolumeInformation() ) or
> you are reading hardware hd serial number?
>
> If you are using GetVolumeInformation() then there are many tools
> to change the ID like 'volumeid.exe'. So this is no reliable at all.
> Also when the user re-formats the disk your mechanism of licensing
> is down.
>
> If you want to learn how to read the hardware hd serial then look at
> www.winsim.com/diskid32/diskid32.html
>
> This is much more reliable but when the user changes the HD which is
> common nowadays your mechanism of licensing is down again.
>
> > Question is that I am afraid the program can be cracked. for example
> > heard hat there is a tool to make the ID of two disks the same. then
> > the protect machanism will be no use.
>
> Yes, read above. Be sure that crackers will generally not dig of
> what you are checking. It's much easier for them to find code
> constructions like this...
>
> if ( IsSerialNumberValidForThisMachine() == false )
>    Terminate();
>
> ... and to reverse the logic ( false -> true ).
>
>
> > Anyone knows a better way?
>
> You can also check for Network card IDs. There are couple of articles
> on Borland developers network of how to read this. Network cards
> generaly never removes or replaces from machine so it's also a
> solution.
> The bad information is that I heared (but not checked) that there are
> some
> NIC cards (Chinesse made) whose NIC ID can be changed from code ;(
>
> Hardlocks are the best solution among those two I mentioned.
>
> There are also some other solutions which some companies can do for
> you,
> but that's another story.
>
>
>
> Best regards,
> Vladimir Stefanovic
>
>
>
Re: software protection
#259
Author: zhan wei ming
Date: Tue, 28 Sep 2004 15:58
59 lines
2891 bytes
does the diskid32 support windows xp?

"Vladimir Stefanovic" <spam@not.needed> wrote in message
news:41565a41@newsgroups.borland.com...
> zhan wei ming wrote in message
> > [...] Currently the protect mechanism is: when the user
> > first run the program, it read the disk id [...]
>
> Do you read the Volume disk id ( GetVolumeInformation() ) or
> you are reading hardware hd serial number?
>
> If you are using GetVolumeInformation() then there are many tools
> to change the ID like 'volumeid.exe'. So this is no reliable at all.
> Also when the user re-formats the disk your mechanism of licensing
> is down.
>
> If you want to learn how to read the hardware hd serial then look at
> www.winsim.com/diskid32/diskid32.html
>
> This is much more reliable but when the user changes the HD which is
> common nowadays your mechanism of licensing is down again.
>
> > Question is that I am afraid the program can be cracked. for example
> > heard hat there is a tool to make the ID of two disks the same. then
> > the protect machanism will be no use.
>
> Yes, read above. Be sure that crackers will generally not dig of
> what you are checking. It's much easier for them to find code
> constructions like this...
>
> if ( IsSerialNumberValidForThisMachine() == false )
>    Terminate();
>
> ... and to reverse the logic ( false -> true ).
>
>
> > Anyone knows a better way?
>
> You can also check for Network card IDs. There are couple of articles
> on Borland developers network of how to read this. Network cards
> generaly never removes or replaces from machine so it's also a
> solution.
> The bad information is that I heared (but not checked) that there are
> some
> NIC cards (Chinesse made) whose NIC ID can be changed from code ;(
>
> Hardlocks are the best solution among those two I mentioned.
>
> There are also some other solutions which some companies can do for
> you,
> but that's another story.
>
>
>
> Best regards,
> Vladimir Stefanovic
>
>
>
Re: software protection
#261
Author: Vladimir Stefanovic
Date: Wed, 29 Sep 2004 18:11
6 lines
1039 bytes
> does the diskid32 support windows xp?

Of course...

Best regards,
Vladimir Stefanovic
Re: software protection
#260
Author: Vladimir Stefanovic
Date: Wed, 29 Sep 2004 18:15
16 lines
1419 bytes
> unfortunatelly, I am from China and my customer I guess
> uses chinese-made network card.

Yes I know, I realized that because of your name. But be sure
that not all Chinese NIC cards are with rewritable NIC number,
some are still valid for licensing purposes :)

You (Chinese) are the main culprits that I had to re-code my
licensing system ;)





Best regards,
Vladimir Stefanovic
Re: software protection
#263
Author: zhan wei ming
Date: Thu, 30 Sep 2004 16:38
152 lines
5968 bytes
But I cannot get diskid using the downloaded code. it always get error
although I can get the disk info using the diskid32.exe.

the function is attached below,

long GetDiskID()
{
//  Windows NT, Windows 2000, Windows XP - admin rights not required

   int done = FALSE;
   int drive = 0;

   //for (drive = 0; drive < MAX_IDE_DRIVES; drive++)
   {
      HANDLE hPhysicalDriveIOCTL = 0;

         //  Try to get a handle to PhysicalDrive IOCTL, report failure
         //  and exit if can't.
      char driveName [256];

      sprintf (driveName, "\\\\.\\PhysicalDrive%d", drive);

         //  Windows NT, Windows 2000, Windows XP - admin rights not
required
      hPhysicalDriveIOCTL = CreateFile (driveName, 0,
                               FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
                               OPEN_EXISTING, 0, NULL);
      // if (hPhysicalDriveIOCTL == INVALID_HANDLE_VALUE)
      //    printf ("Unable to open physical drive %d, error code: 0x%lX\n",
      //            drive, GetLastError ());

      if (hPhysicalDriveIOCTL != INVALID_HANDLE_VALUE)
      {
         STORAGE_PROPERTY_QUERY query;
         DWORD cbBytesReturned = 0;
         char buffer [10000];

         memset ((void *) & query, 0, sizeof (query));
         query.PropertyId = StorageDeviceProperty;
         query.QueryType = PropertyStandardQuery;

         memset (buffer, 0, sizeof (buffer));

         if ( DeviceIoControl (hPhysicalDriveIOCTL,
IOCTL_STORAGE_QUERY_PROPERTY,
                   & query,
                   sizeof (query),
               & buffer,
               sizeof (buffer),
                   & cbBytesReturned, NULL) )
         {
                 STORAGE_DEVICE_DESCRIPTOR * descrip =
(STORAGE_DEVICE_DESCRIPTOR *) & buffer;
                 char serialNumber [1000];

                 strcpy (serialNumber,
                  flipAndCodeBytes ( & buffer [descrip ->
SerialNumberOffset]));
                if (0 == HardDriveSerialNumber [0] &&
      //  serial number must be alphanumeric
               //  (but there can be leading spaces on IBM drives)
                 (isalnum (serialNumber [0]) || isalnum (serialNumber
[19])))
                  strcpy (HardDriveSerialNumber, serialNumber);
          }
          else
         {
                //my problem��always enter here!!!
                DWORD err = GetLastError ();
          }

          memset (buffer, 0, sizeof (buffer));


         CloseHandle (hPhysicalDriveIOCTL);
      }
   }

   long id = 0;

   if (HardDriveSerialNumber [0] > 0)
   {
      char *p = HardDriveSerialNumber;

      //WriteConstantString ("HardDriveSerialNumber",
HardDriveSerialNumber);

         //  ignore first 5 characters from western digital hard drives if
         //  the first four characters are WD-W
      if ( ! strncmp (HardDriveSerialNumber, "WD-W", 4)) p += 5;
      for ( ; p && *p; p++)
      {
         if ('-' == *p) continue;
         id *= 10;
         switch (*p)
         {
            case '0': id += 0; break;
            case '1': id += 1; break;
            case '2': id += 2; break;
            case '3': id += 3; break;
            case '4': id += 4; break;
            case '5': id += 5; break;
            case '6': id += 6; break;
            case '7': id += 7; break;
            case '8': id += 8; break;
            case '9': id += 9; break;
            case 'a': case 'A': id += 10; break;
            case 'b': case 'B': id += 11; break;
            case 'c': case 'C': id += 12; break;
            case 'd': case 'D': id += 13; break;
            case 'e': case 'E': id += 14; break;
            case 'f': case 'F': id += 15; break;
            case 'g': case 'G': id += 16; break;
            case 'h': case 'H': id += 17; break;
            case 'i': case 'I': id += 18; break;
            case 'j': case 'J': id += 19; break;
            case 'k': case 'K': id += 20; break;
            case 'l': case 'L': id += 21; break;
            case 'm': case 'M': id += 22; break;
            case 'n': case 'N': id += 23; break;
            case 'o': case 'O': id += 24; break;
            case 'p': case 'P': id += 25; break;
            case 'q': case 'Q': id += 26; break;
            case 'r': case 'R': id += 27; break;
            case 's': case 'S': id += 28; break;
            case 't': case 'T': id += 29; break;
            case 'u': case 'U': id += 30; break;
            case 'v': case 'V': id += 31; break;
            case 'w': case 'W': id += 32; break;
            case 'x': case 'X': id += 33; break;
            case 'y': case 'Y': id += 34; break;
            case 'z': case 'Z': id += 35; break;
         }
      }
   }

   return id;

}


"Vladimir Stefanovic" <spam@not.needed> wrote in message
news:415afa73@newsgroups.borland.com...
> > does the diskid32 support windows xp?
>
> Of course...
>
> Best regards,
> Vladimir Stefanovic
>
>
>
Re: software protection
#264
Author: Vladimir Stefanovic
Date: Fri, 01 Oct 2004 11:34
19 lines
1357 bytes
>           else
>          {
>                 // my problem always enter here!!!
>                 DWORD err = GetLastError ();
>           }
>


You can completely delete this section ...

          else
         {
                // my problem always enter here!!!
                // DWORD err = GetLastError ();
          }


 Best regards,
 Vladimir Stefanovic
Re: software protection
#265
Author: zhan wei ming
Date: Fri, 01 Oct 2004 16:03
49 lines
2230 bytes
sorry, I didn't express my question clearly. I will try to make things more
clear.
parts of the codes are as below,

         if ( DeviceIoControl (hPhysicalDriveIOCTL,
IOCTL_STORAGE_QUERY_PROPERTY,
                   & query,
                   sizeof (query),& buffer,sizeof (buffer),
                   & cbBytesReturned, NULL) )
         {
            //get HD serial number here
         }
         else
        {
            DWORD err = GetLastError ();
        }

my problem is: when the program executes function DeviceIoControl(...), it
always return false, so the codes that get HD serial number are jumped.

any hints?

best regards,
zhan wei ming

"Vladimir Stefanovic" <spam@not.needed> wrote in message
news:415d4091@newsgroups.borland.com...
> >           else
> >          {
> >                 // my problem always enter here!!!
> >                 DWORD err = GetLastError ();
> >           }
> >
>
>
> You can completely delete this section ...
>
>           else
>          {
>                 // my problem always enter here!!!
>                 // DWORD err = GetLastError ();
>           }
>
>
>  Best regards,
>  Vladimir Stefanovic
>
>
>
Re: Try SoftwareKey.COM
#267
Author: Mark Jacobs
Date: Tue, 05 Oct 2004 12:49
9 lines
1194 bytes
Or Aladdin Hasp at http://www.ealaddin.com/hasp/HaspHL.asp
-- 
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk

"Tim Peer" <peert@envysys.com> wrote in message
news:4157bc9e$1@newsgroups.borland.com...
| Try Software Key. http://www.softwarekey.com/Default.asp
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads