   securing BMP files
  hi friendsI'm using C# (VS 2008) and managed DX, I've made some simple 2d games which I'm going to distribute widely in the net, but because of using BMP images almost anyone can alter the content, and checking the file sizes will not save me (as changing a BMP content will not change its ondisk size), what are my options? CRC? date? or packing resources? any sample or tips would be highly appreciated   
  Packing, compression, encryption, etc., are the typical approaches.However, whats to prevent someone from snagging the BMP data from your process' address space once it's been un-compressed and un-encrypted, or from just pressing "Print Screen" when they see it?  At the end of the day any data stored on a user's machine is never 100% secure.   ;  Also, why do you care if people alter the content?-me   ;  As was mentioned before, simply compressing the data will keep most basic users and script kiddies from touching the content. Unfortunately, as was also mentioned, if the data is on a client's machine, you might as well consider it open for grabs if the user wants it bad enough.   ;  If the game has a multi-player mode then it may be worth it to implement some protection where beneficial to preventing cheating.If it does not have a multi-player mode then I think you should not worry about it.   ;  thanks for your repliesI know securing the client-based content is not possible to high degrees but I just want to rescue my game and my home made arts from being changed by every kind of user, how can I find some source codes?   ;Quote:Original post by vcGamerthanks for your repliesI know securing the client-based content is not possible to high degrees but I just want to rescue my game and my home made arts from being changed by every kind of user, how can I find some source codes?I think it is a bit funny how you want to prevent others from tweaking your stuff, but in the same phrase request working code.   ;  oh please excuse me, I wanted to write something else, but I forgot it, I wanted to say how can I prevent amateur users from changing the stuff, as it is always possible to change a whole game (I cannot do anything about pros, anyway)can I check the CRC? or can I check some specific pixels of my images? how about packing them in my EXE, is there any source code presenting this technique?;Quote:Original post by vcGamercan I check the CRC? or can I check some specific pixels of my images? how about packing them in my EXE, is there any source code presenting this technique?What if someone hacks your CRC checking code? Really, anyone can do that. Go grab OllyDbg, find the branch point where the program takes action against a modified file. Overwrite with NOP in the right place. Done. Kids can do that. As for checking pixels, what if you check the wrong ones? Sure, you can pack them in your EXE. Check out the APIs used for accessing resource files on MSDN. But unless you have a very, very good reason to keep your assets from being modified, don't bother.   ;  Windryder, I think the people you're describing go more into the 'pros' category from the quote below.Quote:how can I prevent amateur users from changing the stuff, as it is always possible to change a whole game (I cannot do anything about pros, anyway)His question is valid.IMO it's better to 'hide' stuff rather than to 'check' if it's been tampered with. That way people won't modify things first, then run the game later and find out that it caught their changes. That'll make them more likely to try to break those checks.So something like a slightly modified .zip or .pak format would do. Yes, you can also embed your assets within the .exe (I'm sure Google has some pointers).On the other hand, maybe it's better not to waste your time on this and spend it on making your game better. ;)   