Simple Audio Encryption

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
yes... though that will also be true for even simply using the save function which will not work unless admin rights is used... IMHO, installing RM in PF is not really a good idea...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you set it to a folder in My Documents or something like that, it wouldn't ask, even if the game WERE installed into Program Files. It's not a good idea to rely on the user knowing where to install it and where not to - Microsoft (and developers) have been drilling into people for such a long time that everything should go into Program Files.


(Sorry Hime, we're getting more into the theoretical here)
 

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
Making a new file in the game's folder, and extracting the audio to there (in fact, even extracting the audio to where the script currently does) could cause problems if the player has installed the game into something like Program Files. Every time it went to play a new piece, they'd get a popup asking if they want Windows to allow it. Wouldn't they?
And this is why installing programs in program files is such a horrible idea. Although most people who have been nagged by that before probably have their UAC turned off and system security knocked down to nothing just to stop all the 'nag' screens. Way to go Microsoft! :golf clap:

I don't think so though... A simple test would tell for sure, but a game has to be able to play files in it's own "space" anyway, and I KNOW that a lot of commercial software uses techniques like these to protect their assets. Let's say I decided to license some Lynryd Skynyrd or "Wayward Son"  from Harry Fox for my game (that'd take the greenlight voters attention off the RTP). I'd have to protect the audio somehow. Every major game title has these issues.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
If you set it to a folder in My Documents or something like that, it wouldn't ask, even if the game WERE installed into Program Files. It's not a good idea to rely on the user knowing where to install it and where not to - Microsoft (and developers) have been drilling into people for such a long time that everything should go into Program Files.


(Sorry Hime, we're getting more into the theoretical here)
Those are valid concerns since the way the script currently works, it requires write-access to the disk.


It also means if someone, for example, tried to play the game off a CD (because they used a script to change where the save files are stored), it will also fail.


If there was some library that I could use to just decode and stream an audio file from memory, that would solve this problem, and would also make it more secure because now there's no way to just copy-paste a file on your disk; you'd have to either hack the archive or scour the process memory.


So far I have not found one.


I guess I could change the name of the folder, and maybe obfuscate the filenames, but I don't know if those really make a difference.
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
Can't we access the Temp folder?

Like using Dir.mktmpdir and access the files from there?
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Here's a simple launcher application written in Java.

I spent 30 seconds to write it as a simple proof of concept. The time is not for bragging, but to show that it is really simple.

It does not delete anything. It simply renames your Audio folder to a different filename (we can just as easily delete it)

Tool: https://www.dropbox.com/sh/sz6mpw5n2d6zxi2/wPVbh0jSOn/Library/RMLauncher.zip

Usage: unpack the launcher in the same folder as game.exe and then run the launcher.

Source:

import java.io.File;public class RMLauncher { public static void renameDir(String src, String dest) { new File(src).renameTo(new File(dest)); } public static void main(String[] args) { try { Runtime.getRuntime().exec("Game.exe").waitFor(); renameDir("Audio", "AudioDELETED"); } catch (Exception e) { } }}
When you close your project, the launcher will go ahead and clean up things for you.

Now, obviously, anyone can simply bypass the launcher and go straight to game.exe. Even if you hide `game.exe`, I show all hidden files anyways so it's easy to access it.

For some people, it might be weird to have a jar file. You could easily write this in C or something and simply fork a process that will execute game.exe and then have the parent wait until the child returns. This is probably something someone would learn if they were in a introductory lesson to forking.

Can't we access the Temp folder?

Like using Dir.mktmpdir and access the files from there?
That method does not seem to be available in RM.
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
That method does not seem to be available in RM.
Yeah, I tested that just now. We still can use the environment variables though. ENV['TEMP'] will return the full path to the Temp folder. Might want to use that.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
RGSS3's ENV only returns a few values though... it doesn't seem to know things like ENV['CD']
 

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
RGSS3's ENV only returns a few values though... it doesn't seem to know things like ENV['CD']
That is because by default, there is no Environment Variable for 'CD'. If you defined it yourself (in WIndows' System Properties), it should be there. Check with msgbox_p ENV.

Also, if you add the environment variable manually, a computer restart might be needed.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I found it on some thread on the internet about ENV variables so I thought it should work right away...


PS: checked the environment variables on the system properties. somehow things like 'ProgramFiles' seem to work even if the list doesn't show them
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
The environment variables that deals with directory paths (that I've seen since the windows 98 era) is only "windir", "path", and "tmp/temp", actually. Usually, installing an environment (like Ruby) appends the path to the executable to the "path" environment variable.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
maybe the languages that the list I saw was for actually makes the variables or something...


PS: I tried using ProgramFiles for my Game Custom Data script's ENV call and it actually worked...
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
ProgramFiles, CommonProgramFiles, and AppData are not editable ENV, it is not appearing in the System Properties, but it is added after it.

The problem is that the default RPG::Audio play function only searches the Audio folder and RTP.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
That not really a problem, since all you have to do is specify the absolute path to where the file is located.


I can put it in the temp folder, but since there is no proper clean-up when the program exits, you end up with leftover junk.
 
Last edited by a moderator:

Sakif X9

Level 99 Persona User
Veteran
Joined
Jan 4, 2015
Messages
87
Reaction score
12
First Language
English
Primarily Uses
"you may notice some delay depending on your hardware" 

What do you mean by this? Delay in Archiving or Delay in music while playing?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
"you may notice some delay depending on your hardware" 


What do you mean by this? Delay in Archiving or Delay in music while playing?
Slight delay the first time you play the music.
 

Alex2486

Warper
Member
Joined
Mar 5, 2016
Messages
1
Reaction score
0
First Language
Spanish
Primarily Uses
I don't know if I am the only one having this issue but, when my first battle comes up, it says it cant find the audio file. But the audio file just played before in a previous scene with no problem.


Now, I am using another script from you (Troop Battle BGM) and I am not sure if it is not compatible or something with this script.


Note: When I play it in my own computer it works fine, it asks for the file if I play the game in another computer.


Please help, I've been having headaches trying to figure this out. Thanks in advance.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top