Software Protection

MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Post by MOISES »

Thank you jeff. Now I understand, the array musy be completed with proper values provided when you buy the product.

Also, I suppose that you have to include a dll into the software folder. Do you have to include the .exe file in the usb?

And, by the way, are you happy with this software?.

Thank you!!!
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

You do need to include the DLL in the folder where your exe is.

You do not need to add anything to the usb drive, just use the make program to set it as a valid key and that's all you need to do the the usb drive.

Note: the usb drive can still be used as a regular drive, you can copy and delete files as normal.

>>Am I happy with the software<<
Antonio and I are still working out some Fivewin code setup.
What I have tested so far is very promising.

Once the final changes have been completed we will post the code here.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Post by MOISES »

Thank you very much to you and Antonio for your work!!!!
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post by hua »

Jeff, thanks for the tip. This looks interesting. I'm curious however whether softwares that are protected using this method can run on Win9x? Their webpage states among the system requirement is XP/2000/Vista etc. No mention of win 9x at all.
Mike Buckler
Posts: 67
Joined: Thu Jan 05, 2006 10:35 pm
Location: Canada
Contact:

Post by Mike Buckler »

I found this vb6 code on the net. I tested it here under xp home, xp pro and vista and it returned the usb memory drive info. Id does not work on win98.

If anyone can translate this vp6 app we could all use usb memory drives as software protection keys.

Private Sub Form_Load()
Dim colProcessList
Dim objprocess
Set colProcessList = GetObject("Winmgmts:").ExecQuery("Select * from Win32_DiskDrive ")
For Each objprocess In colProcessList
If Mid(objprocess.PnPDeviceID, 1, 7) = "USBSTOR" Then
List1.AddItem objprocess.PnPDeviceID
End If
Next
Set colProcessList = Nothing
Set objprocess = Nothing
End Sub


This would make one of the simplest and inexpensive software protection methods around. The thought is - save the usb drive info to an encrypted dbf file that is already in your software package, preferably a file that holds a lot of setting for your application. Then on startup check the key.
You will have to select usb ram drives carefully not all have serial numbers.

Any thoughts or comments appreciated.
Mike Buckler
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Code: Select all

FUNCTION MAIN()

    LOCAL oLoc := CREATEOBJECT( "wbemScripting.SwbemLocator" )
    LOCAL oSrv := oLoc:ConnectServer()
    LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_DiskDrive" )

    LOCAL oJob

    FOR EACH oJob IN oJbs
//        IF SUBSTR( oJob:PnPDeviceID, 1, 7 ) = "USBSTOR" Then
            ? oJob:PnPDeviceID
//        ENDIF
    NEXT

    INKEY( 0 )

    RETURN NIL
EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

I wonder how good is this protection system if the USB pendrive containts get cloned...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Mike Buckler
Posts: 67
Joined: Thu Jan 05, 2006 10:35 pm
Location: Canada
Contact:

Post by Mike Buckler »

That is why I proposed to embedded id of the usb drive.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Mike,

But the usb drive id is defined by software or hardware ?

When you do a dir of it, you get its id. Will it will remain the same if we reformat it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Mike Buckler
Posts: 67
Joined: Thu Jan 05, 2006 10:35 pm
Location: Canada
Contact:

Post by Mike Buckler »

To Test I checked the serial before and after format of the use drive and it returned the same.
I also tried formatting it on an ex pro station and a vista home station and it returned the same.

So I believe that it is returning the hardware id.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

> So I believe that it is returning the hardware id.

In that case then its a valid tool for software protection, though no extra software should be required. Just check the usb drive ID, encrypt it and store it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jeff, Mike,

If we are able to locate the UDB pendrive ID then we can protect the application using standard FWH code :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

This code detects the USB pendrives. Next step, get their IDs :-)

Code: Select all

#include "FiveWin.ch"

#define DRIVE_REMOVABLE   2

function Main()

   local nBitDrives := GetLogicalDrives(), n, cDrive
   
   for n = 1 to 32
      if lAnd( nBitDrives, 2 ^ ( n - 1 ) )
         cDrive = Chr( Asc( "A" ) - 1 + n ) + ":\"
         if n != 1 .and. GetDriveType( cDrive ) == DRIVE_REMOVABLE        
            MsgInfo( "USB pendrive: " + CRLF + cDrive )
         endif   
      endif
   next

return nil

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( GETLOGICALDRIVES )
{
   hb_retnl( GetLogicalDrives() );
}

HB_FUNC( GETDRIVETYPE )
{
   hb_retnl( GetDriveType( hb_parc( 1 ) ) );
}   	

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

To get the USB pendrive is as easy as (in the above code):

MsgInfo( "USB pendrive: " + CRLF + cDrive, nSerialHD( cDrive ) )

Getting closer to have our own based USB pendrive copy protection system... :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Mike,

I have formated a pendrive several times here, and everytime it gets a new volume ID. A complete format, not a quick one.

Not good...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply