• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Protected cd-r

I want to burn a cd-r with my program, but I'd like to make a protection scheme in the program, to check if it is running from the original cd or not. Also, I like to put some mp3 files in that cd but don't want the user see them... maybe in a big cabinet file, is that possible? could I use winamp to play such files?
1 Solution
if you know that the original drives serial number is you can do sonmething like this :
 in this example the "A drive" serial number is '1A1A12F6'
so we check for it and if not present the program closes.

function SerialNum(Drive : Char) : String;
var VolumeName   : String;
    SerialNumber : Integer;
    a, b         : Integer;
    s : String;
  SetLength(VolumeName, MAX_PATH);
  SerialNumber := 0;
  s := Drive + ':\';
  GetVolumeInformation(PChar(s), PChar(VolumeName), MAX_PATH,
  @SerialNumber, a, b, nil, MAX_PATH);
  Result := Format('%2.2x', [SerialNumber]);

procedure TForm1.Button1Click(Sender: TObject);
if (serialnum('a') <> '1A1A12F6') then close else showmessage('program running from correct drive');

winamp can play the following types of files:

i suppose if your program reads the files from a file type of your own making then you can just read into a stringlist/listbox etc and play the selected file from there but have the files in 1 big file on the cdr ( ie cab).
not sure of the file format of cab files but probably find out at
for info on the cab file format.
maybe its easier to make your own alogarithim to bind the files into 1 large file then unbind again when needed to be played..
Regards Barry

what you using to burn the cd's ?

should also look at www.delphipages.com under mpg section for components to work with winamp.
anyone can bypass this if it copys the original diskette
with eg... HD-COPY

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

celsonardiAuthor Commented:
Thank you Barry, but I still have some doubts:  
- Does GEtVolumeInformation work with Cds?  
- regarding what I use to burn Cds, I use Nero, do you have some better suggestion?  
- would it be possible to create an algorithm to join the mp3 files and later to play them even so? (I don't want to uncompress then on my hd and then to play them, you know, I'd like to play them while in an only file)

- to k6: about to copy the disk, it's alright, I know a way to avoid that, but then someone could try to drag the files and then burn a new cd, that's whay I need to check if that is the original cd (serial number is a good way, I think)
change a,b : Cardinal if using d4 ..
The GetVolumeInformation function returns information about a file system and volume whose root directory is specified.

i used this on my cdr drive with finished cdr in it and it showed the serial number : 77DE0AE which is correct

procedure TForm1.Button1Click(Sender: TObject);

then i can use the following in the program if i know the serial numnber while im writing the program..

if (serialnum('a') <> '77DE0AE') then close else showmessage('program running from correct drive');

Nero's fine just curious ;-)

>>>would it be possible to create an algorithm to join the mp3 files and later to play them even so?
>>>(I don't want to uncompress then on my hd and then to play them, you know, I'd like to play them while in an only file

this is difficult bit ,shouldnt be a problem joining them but the playing is the problem.winamp & other programs wont recognize the end of the file or beginning of new file if they all joined together.
i'll have to think about that one ,will all endusers be usiing winamp to play the files?what did you think of the winamp components on delphipages?
will you be using any of them?
Regards Barry

celsonardiAuthor Commented:
thanks again, Barry, I think you're getting there!!! :)

well I'm thinking in using winamp just because its equalizer, it's pretty good; yes I already used the components to play mp3 files directly, without winamp, and the one to interface with winamp, but the reason I want to use winamp is that one of the equalizer... if I don't use winamp, have you some other suggestions?

btw, how the heck could I define the serial number to be written in cd using Nero?

Thanks a lot
mmm that a good question..
personally i use adaptecs software for making my cdrs
and have a thing called directcd where i can use the cdr as a hard-drive via dragdrop etc same as a normal hd(maybe nero does this too ?)anyway i have a delphi function for setting serial numbers on a A drive although never tried it on a cdr ,ill have a go later and see what happens and let you know,though this is all theory and may not work in practice..

winamp is all i'd suggest ,other softwares dont really come close in my opinion :-)

serial number function bombed big time ;-(
after rebooting id say be careful setting the number on a cdr..
celsonardiAuthor Commented:
I really don't know which burner could set the serial number, cdrwin has a catalog number option in the cuesheet, would it be that?
sorry this is another not much help comment from me ;-)
youll have try it and see.
first get the serial number
then change with cdrwins cat nimber
then test serial number agaoin]
to see if changed.

toldya it not much help ;-[
i dont no of a burner that can set a specific serial number
,the volume number yes but i wouldnt no how to do it in delphi..
i left a comment in your other question,does it helps with that part ?
celsonardiAuthor Commented:
>>cdrwin has a catalog number option in the cuesheet, would it be that

i dont have cdrwin so i dont know what the cat number is all about. what does it set when you change it?
does it change the serial number?

i still have no idea how to play the mp3 files all in 1 big file..i have seen stuff for making cab files(was not free) but need to extract the files from cab to play them anyway which isnt what you wanted...

Currently I'm running a page on how to protect your CDs.
(The url is: http:://come.to/cdprotection)
At this very moment I'm writing a utility that does protect your CDs in delphi.
I know a way to modify an image of your CD in a way that you will be able to burn the CD, but not to write an image of it. But it is still possible to check for tags at the part of the CD that can't be read when making an image.
This utility I'm writing will put a CD-check in the executable you need for running the CD. This is what I've already figured out. Also, I'm able to read the TAGs of the CD which I intend to check. Now what I still need to know is how to close a program, like when your using CTRL-ALT DELETE en push end task. Does anybody know how to do this (I just started writing in pascal, so please give me much info, preferibly an example).
I will be publishing a beta version of this utility (that is after I know how to bypass the problem above).



Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now