Copy Protection for general files
-
Saturday, April 14, 2012 9:53 PM
I've done a lot of research into the matter, so I know that it's not possible to make a 100% solution for what I am attempting to do, but I was wondering what suggestions the community had in this regard.
I'm making a program to protect custom game files from being copied as best I can, however there are a couple things I need to account for. Some of them I have, others, I have not been able to find information on.
When the files are not in use, I have them fully encrypted and hidden from the lay user through a bunch of other tricks (+s attribute, for example). However, I would also like to prevent copying these files while they are being used by the game - obviously I cannot have them encrypted while the game is attempting to read from them.
This opens up a hole, which I have also tried to deal with, but I know my attempts in this regard are less than thorough:
- Stop several known well-known copy programs from operating during operation, that being Windows Explorer, Teracopy, and cmd
Now, the other solution I was thinking of was a filesystemwatcher object scanning the better part of the computer for any copies of these files located outside of the "OK" directory, but I'm a bit skeptical as to whether or not this would be very efficient.
Anyhow, I was just wondering if anybody knew any ways to make copying these files difficult without rendering them unusable to the program. Any suggestions or ideas are welcome, thanks!
All Replies
-
Saturday, April 14, 2012 10:31 PM
obviously I cannot have them encrypted while the game is attempting to read from them.
Why not? The game should be able to read the encrypted files as it needs the information and decrypt the data for its internal usage. Of course, this has nothing to do with stopping them from being copied, but simply makes it harder to actually read the content of the files.
You could stop the file from being copied while the game is running by writing a code into the file that indicated 'Active' at game startup, and clearing the code at game shutdown. Then the game needs to check on startup whether it is using a file already marked as 'Active', and exit if it is. Of course, this might have implications if the game crashes and the code doesn't get rewritten, but I assume you have already dealt with that issue as part of the process that allows the user to backup their game files or move them to a different machine or recover them in the event of a disk failure, etc.
-
Saturday, April 14, 2012 10:50 PMI guess I should have included that the game is third party. I don't have access it its code.
-
Sunday, April 15, 2012 1:57 AMThumbdrive.
Mark the best replies as answers. "Fooling computers since 1971."
-
Sunday, April 15, 2012 2:02 AMSomething programmatic that can be distributed to multiple people. The idea is if they get banned from our community, we don't want them stealing the custom content they downloaded for their own.
-
Sunday, April 15, 2012 2:12 AM
"Community"? What is that? Why do they need to download anything at all?
Don't let them download anything until they log into your community. The exact nature of your issue is now even more unclear.
Rudy =8^D
Mark the best replies as answers. "Fooling computers since 1971."
-
Sunday, April 15, 2012 2:37 AM
How do you know when the game "needs" the files ? Do you also know when they aren't needed ?
There is a way to lock files but it would have to be timed with the games needs.
-
Sunday, April 15, 2012 3:24 AM
"Community"? What is that? Why do they need to download anything at all?
Don't let them download anything until they log into your community. The exact nature of your issue is now even more unclear.
Rudy =8^D
Mark the best replies as answers. "Fooling computers since 1971."
Ignore that... basically, here's everything a person needs to know:
It's a commercial game developed by a third party that actively supports modders. We make custom content for this game to use it in our own levels (the game utilizes this client-side, so they have to download it). The problem is - we inevitably get people who we need banned from the server I (sorry.... I say "we" out of habit) operate... you know, rule-breakers, hackers, etc. etc., but we don't want them stealing this content then going off and hosting it themselves. Think of it as a form of DRM I'm trying to figure out.
The problem is, obviously, that for this game to make use of this custom content, it needs to be unencrypted. That opens up a problem, which is what I'm trying to address.
Ideally, in a perfect world, I could make it so only this one game can access the content for anything, but an inherent problem in copy protection is if it can be read, it can be copied. I am trying to make it as difficult as possible to copy for the user. In what solutions I know exist that I don't have to pay for, I have thus far done this:
1. When the files are unencrypted, most major copy utilities are disabled.
And...... that's pretty much where I'm stuck. I was wondering if there's something a little more foolproof I could try, like a file hook to automatically delete any files that are outside the directory where they are installed. It would mean a lot of reading to figure out, so I was hoping if people can tell me any solutions they can think of that might work - or if file hooks are an option for what I'm trying to do.
I'm sorry if this isn't too clear. I'm mostly am amateur programmer who tinkers until they get something...
- Edited by TheLastCanadian Sunday, April 15, 2012 3:30 AM
- Edited by TheLastCanadian Sunday, April 15, 2012 3:33 AM
-
Sunday, April 15, 2012 3:24 AM
How do you know when the game "needs" the files ? Do you also know when they aren't needed ?
There is a way to lock files but it would have to be timed with the games needs.
That's my problem exactly... I don't know enough about how the game functions (and it's closed-source, so good luck there xD) to do that, which would be the ideal method. That said, I just want to make copying as difficult as possible.
From experience, it throws errors when there's missing content it can't call on - but people are using that content all the time in our level, so I'm just operating on the assumption it needs it 100% of the time it's open.
- Edited by TheLastCanadian Sunday, April 15, 2012 3:32 AM
-
Tuesday, April 17, 2012 4:52 AMModerator
Hi TheLastCanadian,
Thanks for your post.
I’m afraid that your goals are hardly to reach unless you have the knowledge of architecture of the game or supported by the game developer. I have no idea about what game it is. But if I got the exception” some files is missing” when I play the game, the most game will stop and exit. You may need to restart the game and let user to log on. It will not search the file again and again and continue the game. What’s worse, this issue will be caused very frequently and it can lead to the missing of data.
Instead of thinking more about how to encryption the files in the game, I will suggest you to think more about the user permissions in your server or any other things.
Hope this helps.
Mark Liu-lxf [MSFT]
MSDN Community Support | Feedback to us
- Edited by Mark Liu-lxfModerator Tuesday, April 17, 2012 5:02 AM make clearer
-
Tuesday, April 17, 2012 5:45 PM
I've surmised that it can't be encrypted while the game is using it - I use that to stop copying while the files are not being used (used meaning the game is not being played). Unfortunately, my server permissions cannot do anything as this content has to be located client side as well. People can simply steal it and host their own with it if there's no protection.
What I'm mostly looking for is methods to prevent copying while the program is open; as that's when the files can potentially be copied in a useful form and stolen. I was thinking of using a filesystemwatcher to monitor for those specific filetypes and if they are detected outside of the directory they're supposed to be, automatically delete them, however, I haven't quite looked into how they work.
My hope is they would cover subdirs as well, but it still means that the computer would have to monitor 100% of its drives and folders to prevent it....
- Edited by TheLastCanadian Tuesday, April 17, 2012 5:49 PM
-
Tuesday, April 17, 2012 6:49 PM
You could use wcf service to download file with encrpytion and place encrypted file onto hard drive and most pc games have people on forums that would help you with modding but some games are against it. Please check with them but if you want I beta test a lot of games for EA using their combattesting partner (some I think would be considered AAA type games) but mostly xbox but some computer games too. So if you can tell me more over email please do and I could sign NDA's about said information as I mod my starwars EAW game and/or sometimes need to test mods for games so I know how the process works to a certain degree with modding but its better to share more information over email or secure communication then over forums about your project.
Normally games have configuration files to store information about classes, content, health and/or other attributes. For instance, I can edit an xml file to add new planets to campaign battle in EAW and and the offical starwars mod site it hosts a mod that does this and many other third parties.
I would if you have total control of mod files just encrypt after bringing out of installer and/or use a launch program put into program files by installer to modify files and/or put them into the games directories and then copy the original to a backup folder somewhere near launch program and when done exit program. Mods are modications to a game so unless the publisher made a modding site or approves of custom maps/mods then you might not even be able to make mods for the game. So make sure you check although most pc games that are more then a year old and not online based like age of empires online might. In addition, if your mostly copying data files like xml, text, or binary files then try creating the file at runtime by transferring data from server encrypted so you just created encrpyted and/or you can if the copying program is detected delete the encrpyted file even or force them to shut it down before continuing downloading.
Also, place a hidden attribute on the file so they wont find it so easily in a copy program.
Okay just offering my two-cents on ideas.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Tuesday, April 17, 2012 6:52 PM
- Marked As Answer by TheLastCanadian Wednesday, April 18, 2012 2:33 AM
-
Tuesday, April 17, 2012 8:16 PM
For the record, I'm sorry about the lack of information about the actual game - I'm trying to avoid making it so a google search will turn all this up xD.
Anyhow, these files are basically archive type files, so they contain all the textures, models, and stuff in them. That's why I can't leave them encrypted as much as I would like to. As for the game dev, I have read the EULA carefully and they also release a ton of software to help make custom content (it's technically not a mod - it changes nothing with the game code), which they claim no copyright on (Surprising, eh?).
I've considered the Server transfer idea - save one small problem, it's 2.98GB of information that is randomly accessed. Regardless, it still opens the copying loophole. As far as I understand the game architecture (the game is near impossible to mod itself - players use a hacked audio dll to get into game functionality; unfortunately it doesn't address what I need), this stuff has to be client side and fully accessible by the .exe.
What I don't want happening is a person copying the files while the game is running - as they will be completely usable then. This is a major problem with any copy protection that I'm trying to surmount as best I can: If it can be read, it can be copied.
My best idea thus far is automatically deleting the files if they are copied out of the directory they're supposed to be in, but I don't know of any efficient means to do this as it means monitoring the computer filesystem in some way. I'll test the filesystem watcher sometime, perhaps that will yield the answer.
Much to my consternation - I'm no professional programmer. I offered to help these folks out (I'm regretting it, but I did give my word I would) so I also need to keep any solutions manageable.
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:19 PM
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:20 PM
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:21 PM
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:24 PM
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:27 PM
- Edited by TheLastCanadian Tuesday, April 17, 2012 8:28 PM
-
Tuesday, April 17, 2012 8:58 PMFor the server part it wouldn't present much of a loop hole if you use good encryption and today most people use internet option for games and some buy at store on cd. But deploying you project by internet sounds like the best idea. Remember to think about your consumers and kiss(kept it simple stupid or instead of stupid it might have be silly)and kiss is more of a old school design method i read about and i also use modular approach by dividing my programming task into sections and this is so i can reuse code on future projects.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Tuesday, April 17, 2012 8:59 PM
-
Tuesday, April 17, 2012 9:06 PMOn end users machine before copying files to game dir while still in the mod programs folder make sure the content files have read only attribute until copied to game folder temporarily and then receive read/write privileges. I've seen this asked many times in the scripting forums about one user needs to read file but not edit and other can edit.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Tuesday, April 17, 2012 9:07 PM
-
Tuesday, April 17, 2012 9:14 PM
"You could stop the file from being copied while the game is running by writing a code into the file that indicated 'Active' at game startup, and clearing the code at game shutdown. Then the game needs to check on startup whether it is using a file already marked as 'Active', and exit if it is."
This is taken care of by HOW a file is opened. If a file is opened with sharable-reads then yes what Acar says is true. If a file is opened private all the rest is take care of by the file system.
Renee
"MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
-
Tuesday, April 17, 2012 9:37 PM
Alas, I can't share it with just that game, can I?
That would be a perfect solution, but unfortunately it's not possible in my knowledge.
-
Tuesday, April 17, 2012 9:51 PMUse calcs I think it's spelled but I think in vb.net their is a security library somewhere to set read only and other file attributes. edit: file security attributes.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Tuesday, April 17, 2012 9:51 PM
-
Tuesday, April 17, 2012 9:53 PMRead-only doesn't fix the problem, I don't think. It can still be copied and written elsewhere. Nonetheless, I'll look at that library, it may have something.
-
Tuesday, April 17, 2012 10:12 PM
Cacls is a file attribute/security command line program but you can set file to read only(for static textures and non-dynamic movies) during runtime but i believe if they have execute property set instead of read only while in your mod programs dir that would be best because heres the scenario:
execute file attribute only means it executes an program but removing read and write access from user gets them an access denied error if they try and copy the file.
Im talking about ntfs file permissions which cacls command line app allows you to take them away. But I think in some instances you inherit the permissions from folder so look up the different permissions.
I would look up information about file permissions and security attributes before you embark on your mission. Sorry I said read only just ignore that post I needed some caffeine
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Tuesday, April 17, 2012 10:21 PM
- Edited by The Thinker Tuesday, April 17, 2012 10:23 PM
- Proposed As Answer by The Thinker Tuesday, April 17, 2012 10:23 PM
- Marked As Answer by TheLastCanadian Wednesday, April 18, 2012 2:34 AM
-
Tuesday, April 17, 2012 10:45 PMThat may work. Thanks for the suggestions, folks! I'll be back if they don't work xD
-
Wednesday, April 18, 2012 1:43 AMIf anything i or other community members posted is helpful please mark it or as answered if we answered your question and yes you can mark 2-3 answers if you wish.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
-
Wednesday, April 18, 2012 7:57 PMP.S. remember cacls sorry if google corrects me on its spelling is only one way to do ntfs file permissions but in visual studio 2010 and dotnet framework 4 and above their maybe a security class somewhere to ease this a bit but using cacls wouldnt be too hard if you've read up on your permissions.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Wednesday, April 18, 2012 7:57 PM
-
Thursday, April 19, 2012 5:54 PMThat sounds interesting.... do you have any more information in regards to how to do this?
-
Thursday, April 19, 2012 6:08 PM
use system.diagonostics namespace which contains process.start which is explained here:
http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx
Shells easier and one line:
Shell("filename")
but doesnt give much other then one or two basic return codes but system.diagonstic class can show you information about a file also and/or return it but it might be 5-10 lines but its worth it for your project because of level of security.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
-
Thursday, April 19, 2012 7:29 PM
I erred. Please ignore what I said
Renee
"MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
- Edited by Renee Culver Thursday, April 19, 2012 7:41 PM
-
Thursday, April 19, 2012 11:03 PM
That's neat, but that said, I looked at the class and its members and the like, and while it looks potentially useful, I really am not sure how to start. How would I use it to monitor if the files are being copied or not?use system.diagonostics namespace which contains process.start which is explained here:
http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx
Shells easier and one line:
Shell("filename")
but doesnt give much other then one or two basic return codes but system.diagonstic class can show you information about a file also and/or return it but it might be 5-10 lines but its worth it for your project because of level of security.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
-
Thursday, April 19, 2012 11:53 PM
You could target a specific program by the pid of when it was launched so you can target specific process numbers and close only certain processes of an app like internet explorer has 5 processes and you want process 2 so you close it. Ohter then that use a watcher class or object in code to watch files.
Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/
- Edited by The Thinker Thursday, April 19, 2012 11:53 PM
-
Thursday, April 19, 2012 11:55 PMProblem is I need a generic solution - something that will work to close copy programs. I've disabled Windows Explorer's copy via other means, but things like TeraCopy would still work. There are too many open source or public copiers to name them all and just close them if detected.

