Sign in to follow this  
Followers 0
BrettF

Disc Protection Prog

9 posts in this topic

Has anyone created a disc protection program- as in it would create a protection on the disc, say for a game, and after the game had been installed, if the game was run, it would check the disk and then run the game if it wasnt a copy? I need some, inspration, on how to set it out... i hope it makes sense... :P

Share this post


Link to post
Share on other sites



I don't know of anyone who has created a disc protection program here, but it sounds like you know what you want to do and could easily do it.

Use DriveGetDrive ( "CDROM" ) to get the CD and DVD drives on a computer. Then once you do that, have it For loop through the list, each time checking a different drive. It will search for certain files on the disc. If they aren't there, then it knows that it isn't the right disc. You could also use hashes to make it more advanced. I would make hashes off of each files' creation and modification date. If the generated hash code matched the one that was pre-determined to be correct, then it would know that it is the correct disc.

This type of CDCheck system would be basic but it would work for most users.


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I don't know of anyone who has created a disc protection program here, but it sounds like you know what you want to do and could easily do it.

Use DriveGetDrive ( "CDROM" ) to get the CD and DVD drives on a computer. Then once you do that, have it For loop through the list, each time checking a different drive. It will search for certain files on the disc. If they aren't there, then it knows that it isn't the right disc. You could also use hashes to make it more advanced. I would make hashes off of each files' creation and modification date. If the generated hash code matched the one that was pre-determined to be correct, then it would know that it is the correct disc.

This type of CDCheck system would be basic but it would work for most users.

Could you please explain hashes a bit more? or point me to the help file :P

EDIT: Oh and how could i encypt it?

Edited by bert

Share this post


Link to post
Share on other sites

I was thinking of using something simple, like the serial number of the disc as the 'password' to start the game

Yes, that would also work. You would use the DriveGetSerial() function to get the serial number. I would do something like this:

#include <array.au3>
$as_Drives = DriveGEtDrive("CDROM")
_ArrayDisplay($as_Drives,"Drives")
;~ ClipPut(DriveGetSerial ( "f:" ))
;~ Msgbox(0,"Serial:",DriveGetSerial ( "F:\" ))
For $intcount = 1 To $as_Drives[0]
    If DriveGetSerial($as_Drives[$intcount]) = 56155464 Then ;you have to set the number equal to whatever the disc serial number is
        Msgbox(0,"Correct Disc","The disc in drive " & $as_Drives[$intcount] & " is the disc that matches the perdetermined serial number and therefore must be the correct disc.")
        ;now you would start the program here
        Exit
    EndIf
Next

;Here you would put a messagebox telling the person to insert the correct disc

Hope that helps.

-The Kandie Man


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Slight problem- I'm used to the past version.

I want the user to press next, then for it to go to the next screen.

Instead of waiting for the user, it automatically, goes to the next screen.

Heres a snipit of the code,

#include <GUIConstants.au3>
$sidesplash = @ScriptDir & "\Side_Splash.bmp"
mainscrn ()
Func mainscrn ()
$Form1_4 = GUICreate("PDB- Protected Disc Burner- Introduction", 404, 259, 193, 115)
$Pic1 = GUICtrlCreatePic($sidesplash, 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
GUICtrlSetState ($Button2, @SW_DISABLE)
$Label1 = GUICtrlCreateLabel("This is a program that is designed to create protection onto a disc in a very simple form.  When the disc is later when the program is installed, the protection system will run, check if the program is installed, then run the program if the serial number matches up with the disk it was, ( a ) installed with, and ( b ) is currently in the drive.                                                                                                                                               Please note:  The protection system enclosed from herein is very basic but effective to an extent.                                                                                                                                     This is version: 1.1", 112, 8, 287, 217)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $nMsg = $Button1
            GUISetState (@SW_HIDE, $Form1_4)
            selectFolder ()
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
EndFunc

Func SelectFolder ()
$Form1_1_1 = GUICreate("PDB- Protected Disc Burner- <TITLE> ", 404, 259, 193, 115)
$Pic1 = GUICtrlCreatePic("", 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
$Label1 = GUICtrlCreateLabel("Please select a folder containg all the files to be written to the disk.", 112, 8, 283, 33)
$Input1 = GUICtrlCreateInput("AInput1", 112, 40, 225, 21)
$Button3 = GUICtrlCreateButton("Browse", 344, 40, 49, 25, 0)
$Label2 = GUICtrlCreateLabel("Please select the .exe to be run once the protection system has approved the disc.", 112, 80, 283, 25)
$Input2 = GUICtrlCreateInput("AInput1", 112, 112, 225, 21)
$Button4 = GUICtrlCreateButton("Browse", 344, 112, 49, 25, 0)
$Label3 = GUICtrlCreateLabel("Please select a name for the disc:", 112, 136, 283, 17)
$Button5 = GUICtrlCreateButton("Browse", 344, 160, 49, 25, 0)
$Input3 = GUICtrlCreateInput("AInput1", 112, 160, 225, 21)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
EndFunc

Share this post


Link to post
Share on other sites

You are using the Switch as if it were a Select Case.

#include <GUIConstants.au3>
$sidesplash = @ScriptDir & "\Side_Splash.bmp"
mainscrn ()
Func mainscrn ()
$Form1_4 = GUICreate("PDB- Protected Disc Burner- Introduction", 404, 259, 193, 115)
$Pic1 = GUICtrlCreatePic($sidesplash, 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
GUICtrlSetState ($Button2, @SW_DISABLE)
$Label1 = GUICtrlCreateLabel("This is a program that is designed to create protection onto a disc in a very simple form.  When the disc is later when the program is installed, the protection system will run, check if the program is installed, then run the program if the serial number matches up with the disk it was, ( a ) installed with, and ( b ) is currently in the drive.                                                                                                                                               Please note:  The protection system enclosed from herein is very basic but effective to an extent.                                                                                                                                     This is version: 1.1", 112, 8, 287, 217)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button1; you had this line as $nMsg = $Button1 which is incorrect.  Anything you put here is automatically compared to the value placed after the initial switch statement.
            GUISetState (@SW_HIDE, $Form1_4)
            selectFolder ()
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
EndFunc

Func SelectFolder ()
$Form1_1_1 = GUICreate("PDB- Protected Disc Burner- <TITLE> ", 404, 259, 193, 115)
$Pic1 = GUICtrlCreatePic("", 0, 0, 105, 257, BitOR($SS_NOTIFY,$WS_GROUP))
$Button1 = GUICtrlCreateButton("Next", 344, 232, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Back", 280, 232, 57, 25, 0)
$Label1 = GUICtrlCreateLabel("Please select a folder containg all the files to be written to the disk.", 112, 8, 283, 33)
$Input1 = GUICtrlCreateInput("AInput1", 112, 40, 225, 21)
$Button3 = GUICtrlCreateButton("Browse", 344, 40, 49, 25, 0)
$Label2 = GUICtrlCreateLabel("Please select the .exe to be run once the protection system has approved the disc.", 112, 80, 283, 25)
$Input2 = GUICtrlCreateInput("AInput1", 112, 112, 225, 21)
$Button4 = GUICtrlCreateButton("Browse", 344, 112, 49, 25, 0)
$Label3 = GUICtrlCreateLabel("Please select a name for the disc:", 112, 136, 283, 17)
$Button5 = GUICtrlCreateButton("Browse", 344, 160, 49, 25, 0)
$Input3 = GUICtrlCreateInput("AInput1", 112, 160, 225, 21)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
EndFunc

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0