Protecting music files ?

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Protecting music files ?

Postby Simon » Sun Jul 22, 2012 9:20 pm

Hi, for my game project, I work with musician friends who will make an original soundtrack. I heard one of the tracks already and I think it will be good, if not very good.
Now, I was wondering if there is a way to somehow "protect" the music, so the files don''t appear fully visible in the game's folders.

Let me explain : currently, when you make your game, you copy the audio files in the "areas" folder. The trouble is that anyone can find and listen to the files by searching there.
I'm aware that there's an option to change files extensions when you make an exe. It would probably be a sufficient protection in our case, but then I have compatibility problems : some of the files are not recognized anymore by windows (because of their exotic extensions) and it asks for confirmation when you run the game. I'm sure many of you have encountered this case already.

So, my question is simple : does anyone have an idea to ... encrypt / hide / protect / (other) ... the music files ?
Thanks !
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby ShadowHunter » Mon Jul 23, 2012 8:27 am

Sure,

Without looking into existing AM implementations this pops to my mind:

Write a simple plugin that encodes and decodes files, distribute the encrypte music in your game and call to decode at runtime to a temporary file, play it and delete the file at closing the game or leaving the frame... or any variant on this system.

This might help you started: http://www.freevbcode.com/ShowCode.asp?ID=2038

You could also create a music container (kind of DB) and fetch the info at runtime.

Pehaps someone is willing to code this custom plugin for you.

Good luck.

With best regards,

ShadowHunter
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Simon » Mon Jul 23, 2012 2:19 pm

Maybe a little to difficult for me, but you're fantastic 8) Thanks a lot !
Gives ma a good starting point for some research !

Well, I was thinking of a close solution : using a self-extracting archive (7zip sfx), containing the music files and protected by password. It would extract the audio files in the right folder each time needed, and delete it when closing the game. Problem is I don't know how to automatically enter the password when needed... I'm not really good at coding things :(
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby ShadowHunter » Mon Jul 23, 2012 7:06 pm

Hi Simon,

Yes, the idea is the same, but using 7z or other might pose problems:

- 32 and 64 bit require a different version
- command line support with WinZip is not default installled
- delay during unzipping would not be beneficial for your project

Using command line with both 7z, WinZip, WinRAR is pretty straightforward but how will you delete the files afterwards? Maybe my CommonDialog plugin can take care of that now I think of it (the deleting part) :roll:

Hmhm, wouldn't it also be possible to add some digital content protection in the music itself? You could walk that path as well...

Good luck,

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Simon » Tue Jul 24, 2012 10:49 am

Thanks. If I find an easy and reliable solution, I'll post it here.
First, I have a lot of work with graphisms...
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby reneuend » Tue Jul 24, 2012 12:57 pm

---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Simon » Fri Jul 27, 2012 9:18 am

Hey thanks ! Seems interesting.
In fact, I was looking for a free solution, but why not.
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby Simon » Sat Jul 28, 2012 6:39 pm

Hey ShadowHunter, I took several hours today to learn more about Base64 and make a few tests : it seems to be the best solution I can find, so thanks a lot for the idea. The big trouble is that I don't understand anything :S Ha ha ! ........................
You must know that I've chosen to make my game with AM because it's the most simple soft for making adventure games, of course... VBS doesn't seem so difficult, and I mostly use the native AM functions.

ShadowHunter wrote: distribute the encrypte music in your game and call to decode at runtime to a temporary file


Ok then... Encrypting files could probably be something I can do with an external software... I made a few tests and it seemed to work.
But !
Is AM really able to decrypt a file to a temporary folder ? I mean, I don't have any ideas on how to do that, but if the file is encrypted, how can I make AM decrypt it ?
Calling a decryption tool ? It's possible in AM ?
I know it can call for exe files, but I don't see how it can decrypt silently...

ShadowHunter wrote: play it and delete the file at closing the game or leaving the frame... or any variant on this system.


Deleting the temp file at closing the game... Do you think it's also possible within AM, or do I have to use an external solution, like the plugin you made and you're talking about ?


ShadowHunter wrote:You could also create a music container (kind of DB) and fetch the info at runtime.


Here, I think DB means database, right ? (i'm not familiar with these terms, trying to learn :oops: )
This second solution seems even more difficult than the first one, but I searched also for some details. Do you think a soft like sqlite could be a good idea ?

Few... I feel I'm not gonna make it... :cry:
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby ShadowHunter » Sat Jul 28, 2012 11:43 pm

Hi,

Question 1 and 2: piece of cake... it recommand a plugin to do the task. Can AM decrypt, sure, the VB code has the key and AM also decrypts the VB procedures itself, so the key is safe :D

Question 3: Yes, DB means database. SQLite would take it a bit to far for such a simple task, no, what I mean is rather a "container", for example you could add all the music to a RES file in a VB6 project and use it in an OCX which can be adressed by AM... it would be compliled and thus byitself for 99% of the earths population protected.

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby Simon » Sun Jul 29, 2012 11:18 am

Hi ! Thanks a lot for your help. The ressource file finally seems to be the best solution given my low level in development.
I've been looking for tutorials and it seems that making res files containing the musics is quite easy, and I like the idea because I can do the same with videos and everything else.

What I don't really understand is "when" to create the res files ? I feel I have to make them at the very end of the project, when my game is finished and I know all the ressources I need, right ?

If yes, then I don't understand how to allow AM to use the music in the Areas path. Let me try to explain :
currently, I use the music files in the audio parameters of each frame of the game. So, for each frame, there's a music file linked to it. These mp3 files are located in the usual Areas folder and it all works well...
Now, imagine I finished the game development and I make the res file : I need to delete the mp3 files so they're not visible to anyone... But when launching the game, AM will search the mp3 in the path indicated in each frame properties. Do you follow me ? :?
So... does it mean the res file needs to temporarily extract the mp3 files in the Areas folder ? I'm all lost... Or will I need to change the path of each mp3 in each frame so it points to a res file ???

You see, I already made 350 frames, each one pointing to a music file, and I've not done half of the game yet... I don't feel like changing pathes so they point to a res file... :(
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby reneuend » Sun Jul 29, 2012 1:12 pm

Of course there is the built-in encryption provided by AM, but it is very weak. It only changes the file extensions.

As for moving files to the resource folder and pointing AM to this instead of the Areas folder, you would use the advanced tab on each frame and call a custom PlaySound("mysoundfile.mp3") function. You would conceivably only need one line of code per frame after creating the PlaySound() function. If your solution would be to have the files encrypted, the PlaySound function would contain the code or call to another function that would encrypt and decrypt the file.

File Protection Software: I don't know how file protection software works, but this might still be the easiest and best solution. Your files would be protected at all times both inside and outside of AM.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Simon » Sun Jul 29, 2012 6:00 pm

I just don't get any result... It's all too hard for me, I give up :cry:

I tried the different solutions you suggested (base64, db, res file, etc...), and I understand the main ideas, but when you start from zero, you need to learn everything in coding and develoment to catch how it works exactly...

I think I'll use the basic AM encryption which only changes the extensions................................... I wanted something stronger, but...
At least, I hope it won't cause compatibility problems for people who run my game.

Thanks again to both of you. Even if your ideas won't help me, I'm sure it will be usefull someday to someone else.
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby reneuend » Sun Jul 29, 2012 9:33 pm

Before you give up, I'll do some research on the file protection software. If it has a trial, maybe I can come up with a solid solution that won't require you to do anything accept run the file protection software before including the audio/video files in your project. If you don't hear from me, please PM me. I'm starting a new contract tomorrow and my mind is not very focused.

Update: I just did some reading on the software tools I had suggested. If you don't mind offering your games via CD/DVD, then I think it will work, but it doesn't appear to work via downloads. Anyway, I'm still looking at them.


http://www.webtoolmaster.com/
http://www.newsoftwares.net/copy-protect/howto/copy-protect-audios


I think I'll try one out and see how it works. Stay-tuned.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Simon » Mon Jul 30, 2012 11:22 am

It's very nice of you reneuend.
For info, my game shouldn't be finished before october (I think) which still leaves some time to find a solution. For my part, I prefer to concentrate on the quality of the game, instead of spending my time on protecting the music files... It's not laziness, it's just that I have soooo much to do already, and a really bad understanding of "advanced coding"...

I confirm that the game shouldn't be on a CD/DVD but available on a download platform (which is still to be decided).
Anyways, every solution you can find could be helpful one day, and if not for me, for anyone else reading the forums.

BTW, for those interested in RES files (mentionned by ShadowHunter), I had found this good tutorial, explaining how to create the ressource file and include everything you want inside (video, audio, cursors, etc...) :
http://www.thevbzone.com/l_res.htm
In my case, I just don't know how to use these res files in AM, so I'm stuck... I know it's possible, but it seems to require advanced knowledge.

Would be great to add this kind of functionality in a next release of AM, instead of the basic encryption which renames the extensions :)
User avatar
Simon
Expert Member
 
Posts: 418
Joined: Sun Jun 10, 2012 1:47 pm
Location: France

Postby reneuend » Wed Aug 01, 2012 1:12 am

Hmmm...Yeah, I wasn't able to find something that worked for downloaded files. This would be a good idea for a plugin (if not something built into AM)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests