Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Packing media for distribution

Author
Message
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 14th Apr 2015 05:56 Edited at: 14th Apr 2015 06:27
So I'm nearing the end of my first app, have been pouring over the forums trying to find an easy way to pack/protect the images in my game. I'm not looking for anything huge, just a simple deterrent to prevent someone from copying them out of the install.

Using some memblock examples I think I'm at a good point, but the memblocks are huge when written, which makes sense, it is uncompressed data. I'm a bit lost on what route to take now, any suggestions?

edit: Also should probably do something with the subimage.txt file.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 14th Apr 2015 10:14
You could simply encrypt the images and decrypt, load, then delete at run-time.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 14th Apr 2015 10:26
TGC have a packer that, I think, does what you are looking for : http://www.thegamecreators.com/?m=view_product&id=2256

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
mrniceguy
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 14th Apr 2015 10:52 Edited at: 14th Apr 2015 10:56
Just take a look at http://forum.thegamecreators.com/?m=forum_view&t=214000&b=8.

Smart Packer Pro - Distribute games and applications
V-Packer for Games - Compress your game files into one executable
Flash Packer - Pack your Flash movies
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 14th Apr 2015 21:14
Perhaps I need to clarify that this will be for iOS/Android.

Quote: "You could simply encrypt the images and decrypt, load, then delete at run-time."


If I knew how to simply do that I would My file IO experience is exceptionally limited though, and I'm not seeing a straightforward way to go about this. Best I'm at now is a rather large file written from a memblock.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Apr 2015 00:15
There has been much discussion of this on the forum. A very powerful method is XOR encryption. I, or others, can show you how to do this if it will be helpful.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 15th Apr 2015 05:51
I think that may have been one of the examples I came across, I'm able to visually "corrupt" the image and restore it, I'm stuck at the next step. If you just take that memblock and write it, you get a rather large file. Technically you could just write it back as an image, it is barely usable but it is still quite clear what it is. It seems like there should be another step to obfuscate the file.

I'm going to keep digging on this but if you have any further suggestions please do let me know.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Apr 2015 11:34
You don't need to expand the compressed image data to do this.

You need to have two programs - one the encrypt, and your app itself.

The encrypt program loads any file into a memblock using CreateMemblockFromFile(). It applies encryption - which may not need to be all the data - and saves the file with a unique filename - like "wombat.dat".

The main program loads this file and decrypts it, saving it as (say) "wombat.png". It then loads this either straight into an image or memblock and then deletes "wombat.png" This way your plain file only exists for a few milliseconds.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Apr 2015 13:00
^
This!

I wrote a DBPro tutorial many years ago to show how to encrypt using XOR. It isn't my best tutorial, but hopefully it may help get you over the next obstacle.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Apr 2015 14:06
I've made a tool to encrypt. I'll update it over the next day or so.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 15th Apr 2015 18:41
Hmm, it seems I may be doing extra work then, I believe I actually loaded the image first, then converted it to a memblock instead of going straight from the file. That would explain why my 1.5mb png became a 65mb .dat file.

Thank you guys, I'll check out that example when I get back home.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln

Login to post a reply

Server time is: 2024-11-25 20:48:20
Your offset time is: 2024-11-25 20:48:20