Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Protected cd-r

Posted on 1999-07-17
13
Medium Priority
?
198 Views
Last Modified: 2010-04-06
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?
0
Comment
Question by:celsonardi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 1389300
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;
begin
  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]);
end;


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



winamp can play the following types of files:
voc
wav
mp3
mp2
mpg
cda
it
xm
s3m
stm
mod
dsm
med
far
ult
m3u
pls
asx

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
 http://www.wotsit.org/cgi-bin/search.cgi?cab
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

btw.
what you using to burn the cd's ?

0
 
LVL 17

Expert Comment

by:inthe
ID: 1389301
should also look at www.delphipages.com under mpg section for components to work with winamp.
0
 
LVL 2

Expert Comment

by:k6__
ID: 1389302
anyone can bypass this if it copys the original diskette
with eg... HD-COPY

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:celsonardi
ID: 1389303
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)
0
 
LVL 17

Expert Comment

by:inthe
ID: 1389304
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);
begin
 showmessage(serialnum('g'));
end;

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

0
 

Author Comment

by:celsonardi
ID: 1389305
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
0
 
LVL 17

Expert Comment

by:inthe
ID: 1389306
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 :-)

0
 
LVL 17

Expert Comment

by:inthe
ID: 1389307
serial number function bombed big time ;-(
after rebooting id say be careful setting the number on a cdr..
0
 

Author Comment

by:celsonardi
ID: 1389308
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?
0
 
LVL 17

Expert Comment

by:inthe
ID: 1389309
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 ?
0
 

Author Comment

by:celsonardi
ID: 1389310
???
0
 
LVL 17

Expert Comment

by:inthe
ID: 1389311
>>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...

0
 

Expert Comment

by:vargo2
ID: 1389312
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).
Regards,

Vargo2

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question