Decrypting/Hiding image files in android game with C++

Guys, is there any easy way to decrypt (assuming that image files will be encrypted and shipped with game) image files in android game? (game is question/answer style, so i don’t want anyone to reach my resources :slight_smile: )

Or alternatively, is there an easy way to hide my image files (most probably .png but can change if needed) from users?

Compile them as literal byte arrays in the executable, and use sdl rwops?Op 12 jul. 2015 2:14 PM schreef “agakisiyev” :

Guys, is there any easy way to decrypt (assuming that image files will
be encrypted and shipped with game) image files in android game? (game is
question/answer style, so i don’t want anyone to reach my resources [image:
Smile] )

Or alternatively, is there an easy way to hide my image files (most
probably .png but can change if needed) from users?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Bob Rubbens wrote:

Compile them as literal byte arrays in the executable, and use sdl rwops? Op 12 jul. 2015 2:14 PM schreef “agakisiyev” <@agakisiyev (@agakisiyev)>:

  Guys, is there any easy way to decrypt (assuming that image files will be encrypted and shipped with game) image files in android game? (game is question/answer style, so i don't want anyone to reach my resources [Image: http://forums.libsdl.org/images/smiles/icon_smile.gif ] ) 

Or alternatively, is there an easy way to hide my image files (most probably .png but can change if needed) from users?


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

I kinda get the idea, but I would be sure if there was an example, can you give an example (as a code snippet or sth) please? :slight_smile:

I never actually did this myself so I can’t produce a code snippet in a few
minutes. I can give you a few pointers however. First I would save the
picture as a C source (you can do this in gimp) to get the image in a c
file. Take a look at the data, but it’s basically a struct with some info
in it’s members and one member containing a huge array. Then I would use
RWopsFromMem (see the second post here:
http://www.gamedev.net/topic/454985-loading-sdl-surfaces-from-memory/) to
convert the array data member to something sdl can work with, and then use
sdl’s rwops to surface functions (sdl has one that takes bmp’s, so if you
use png or something you’ll have to use sdl_image) to get an actual surface.

If you have lots of images you might want to write something that converts
them all to c files automatically. You can also use sdl for this: sdl can
read the image, and then you write all the colors of all pixels to a file.

Hope you can use some of this. Good luck.On 12 July 2015 at 14:29, agakisiyev wrote:

Bob Rubbens wrote:

Compile them as literal byte arrays in the executable, and use sdl
rwops? Op 12 jul. 2015 2:14 PM schreef “agakisiyev” <>:

Quote:

Guys, is there any easy way to decrypt (assuming that image files will
be encrypted and shipped with game) image files in android game? (game is
question/answer style, so i don’t want anyone to reach my resources )

Or alternatively, is there an easy way to hide my image files (most
probably .png but can change if needed) from users?


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I kinda get the idea, but I would be sure if there was an example, can you
give an example (as a code snippet or sth) please? [image: Smile]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org