protection EXE file

areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

protection EXE file

Post by areang »

Hi All !

The EXE file produced by Borland or MSVC is stand alone EXE without any dll.

The application installed by installer is good way for the first time.
But when the application installed move again to another computer, this is ilegal copy.

How to make EXE file can't be copy to another ?

Best Regard
Areang
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

Areang,

You can try my KeyGen.obj

Basically you give them a software "key". Then you can verify the "key" to make sure they do not install the software on other computers.

(Instructions Below)

You can download it at:

http://hyperupload.com/download/020e7f0 ... 2.obj.html


Hope This helps,

Jeff


Code: Select all

Useage: MakeKey( nKey, nLicense )

        nKey is your "secret key"
        nLicense is the number of licenses the end user has purchased
                 this is a number that can be extracted by GetLicense()

        Example: We will use 581 as our "secret key"
                 We will give the end user 5 licenses

                 cKey := MakeKey( 581, 5 )

                 If the Hard Drive Serial Number is: 123456789

                 cKey will be: 986-3266501-3064-26145
 
                 cKey is the number you give the end user to "unlock"
                 your software.


Useage: MakeKey()

        If you use MakeKey() without any parameters you will be prompted
        to enter nKey, Hard Drive Serial Number and nLicense.
        The the cKey will be displayed via MsgInfo()

        The "Hard Drive Serial Number", "Generated Key" and "Number of Licenses" will also
        be copied into the Clipboard.
  


Useage: GetLicense( nKey, cKey )

        nKey is the "Secret Key" you used in MakeKey()
        cKey is the string returned by MakeKey()

        Example: We will use 581 as our "secret key"
                 cKey will be: 986-3266501-3064-26145 (see example above)                      

                 nLicense := GetLicense(581, "986-3266501-3064-26145" )

                 This will determine the Hard Drive Serial Number and using
                 the parameters provided, will return the number of licenses
                 that were encoded when you used MakeKey()

                 So, if the Hard Drive Serial Number is 123456789
                 nKey is 581 and
                 cKey is  986-3266501-3064-26145

                 nLicense = 5



Useage: VerifyKey( nKey, cKey)

        nKey is the "Secret Key" you used in MakeKey()
        cKey is the string returned by MakeKey()

        Example: We will use 581 as our "secret key"
                 cKey will be: 986-3266501-3064-26145 (see example above)                      

                 IF VerifyKey( 581, "986-3266501-3064-26145" )
                    MsgInfo("Valid Key...")
                 ELSE
                    MsgInfo("Invalid Key...")
                 ENDIF



Useage: GetSecretKey( nSerial, cKey )
             
         WARNING: Run this function without other programs running.  It uses as much of the
                          CPU as it can and depending on your "Secret Key" may take a LONG TIME to
                          complete its calculations before you are given your "Secret Key"
                          (it is slow, but atleast you now can get your "Secret Key" if you forget it)

         nSerial is the serial number used to make cKey
         cKey is the string returned by MakeKey() 

         Example: 
                    nSerial = 123456789
                    cKey = 986-3266501-3064-26145 (see example above)                      

                    cSecret := GetSecretKey( 123456789, "986-3266501-3064-26145" )

                    cSecret wil be 581


NOTES: 1. The value returned by MakeKey() should be stored on the end users
                 system and a check [ VerifyKey() ] should be done to determine if
                 the user has a valid installation.

             2. If you need to change the amount of licenses, you will need to
                 generate a new Key. [ MakeKey() ]

             3. This library only gives you "a number" for licenses, it will not
                 limit the end user ... This is left up to you, the programmer.
                 So the value returned from GetLicense() should be used to limit
                 connections to the program. (This is mainly for networked systems)
                 If you are not worried about licenses then you can use this as a
                 secondary "Secret Key", however you MUST supply a value.

              4. The only function that can be used without any parameters is
                  MakeKey(), you MUST supply the parameters for the other functions.

              5. The "Secret Key" must not be zero, this may cause problems.
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post by areang »

Jeff,

Thanks for reply.

Do you mind to send me a small application with source code ?


Best Regard
Areang
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hi Jeff

A good solution.
If the Hard Drive Serial Number is: 123456789
Is it Hard Drive Serial No. ?
or
Volume Serial Number like the following one

Volume in drive C is 80GB_C
Volume Serial Number is 0C2E-1CE6
Directory of C:\

If it is Hard Drive Serial No., How do we get it (is there any function
that returns Hard Drive Serial No. automatically) ?

When I supplied 0C2E-1CE6 as 2nd parameter to makekey() ,
It is returning '0' as serial no.

Regards

Ramesh Babu P
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

It uses hard drive serial number.

nSerialHD()


Hope this helps,

Jeff
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hi Jeff

Thank you very much for quick reply.

Now your solution to the problem in subject is complete.

Regards

- Ramesh Babu P
User avatar
ssbbs
Posts: 54
Joined: Mon Oct 17, 2005 3:03 am

Post by ssbbs »

RAMESHBABU wrote:Hi Jeff

Thank you very much for quick reply.

Now your solution to the problem in subject is complete.

Regards

- Ramesh Babu P
reference the web link:
http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26

You can get HDD Lower level serial-number!!
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hi ssbbs

Posting in Fivewin, Taiwan forum are very Interesting!.

Regards,

- Ramesh Babu P
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hi Mr.Antonio

I need few clarifications in respect of nSerialHd()

This is the code I used for testing nSerialHd().

#include "fivewin.ch"

FUNCTION Main()

LOCAL cSerialNos := "", cDrive, n, nSerial, aDrives

cSerialNos += "Default Drive Serial No."+STR(nSerialHD())+CRLF+CRLF

aDrives := aDrives()

FOR n = 1 TO LEN(aDrives)
cDrive := aDrives[n]
nSerial := LTRIM(STR(nSerialHD( cDrive )))
IF cDrive == "A:"
IF IsDiskette()
cSerialNos += "Drive "+cDrive+" Serial No."+LTRIM(STR(nSerialA()) )+CRLF
ELSE
cSerialNos += "Drive "+cDrive+" Serial No."+LTRIM(STR(nSerialA()) )+" ( No Floppy Present in Drive )"+CRLF
ENDIF
ELSE
IF !IsCdRom(cDrive)
cSerialNos += "Drive "+cDrive+" Serial No."+nSerial + CRLF
ELSE
cSerialNos += "Drive "+cDrive+" is a CD Rom Drive"+CRLF
ENDIF
ENDIF
NEXT

MsgInfo(cSerialNos)

RETURN nil
And following is the output generated by above program.

Image

The return value of nSerialHd() is exactly what?
a) Wether is the actual serial number printed on the Hard Disk Drive,
b) Or it is a number generated by the OS ?
c) Will it change when the Hard Disk Drive is formatted ?
d) What are these numbers when called nSerialHd() without any parameter and
when called with nSerialHd("C:"), nSerialHd("D:") and so on...

I have checked another library called "smart.lib" ( the link is provided in this topic itself )
I am getting the following output.

Image

When I compared Serial No., Model No. and Firmware shown in the above output, they are exactly the same printed on
the Hard Disk Drive.

Kindly clarify the points from a to d.

Regards to you

- Ramesh Babu P
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

RAMESHBABU wrote:The return value of nSerialHd() is exactly what?
It is the volume serial number generated by the OS (check console VOL command that is in hex).
RAMESHBABU wrote:c) Will it change when the Hard Disk Drive is formatted ?
Yes.

EMG
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hi ssbbs

Thank you very much for your "SMART.LIB".

I need some guidance from you.
nRet := SmartFindATADisk(255)
is returning the correct number of ATA Disks fixed in the Computer System.
aData := SmartIdentify(0)
is holding the information about Model No, Serial No. and Firmware

As you said the '0' parameter used in SmartIdentify indicates `C Drive`.
Is it `C` Drive or 1st or Default Hard Disk?

And I want to know How to get the information abount the 2nd and other Hard disks fixed in the System.

When I tested like

aData1 := SmartIdentify(1)

aData1 is holding the same information of "aData := SmartIdentify(0)"

Please guide me how to get the information of 2nd and ... hard disks.

Regards to you,

- Ramesh Babu P
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Hello Mr.Enrico

Thank you very much for your quick reply.

Your guidence is always very useful to me in particular and all of us in general. Keep it up

Regards to you

- Ramesh Babu P
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post by areang »

Hi Rameshbabu,

if you knew a serial number of hardisk, so you can write on your application like this :
e.g

if nSerialHd() == "316371276"
MsgAlert("yes, go to application")
else
MsgAlert("No, you don't to continue..")
endif
by the ghost application from Simanthec, can duplicate your hardisk serial number.
If you want to protect your EXE file, good way by motherboard serial number or information from BIOS of CMOS .

Best Regard
Areang
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Mr.Areang

Thanks for your suggestion.

The method we were discussing above is one among many ways to
protect the piracy to some extent (not fully!).

By the way do you any functions which can return the information about
"motherboard serial number or information from BIOS of CMOS ."

Regards to you

- Ramesh Babu P
areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post by areang »

I will send you by your private email

Areang
Post Reply