Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] I need help about one subject of C++  (Read 1590 times)

0 Members and 1 Guest are viewing this topic.

Carlos Augusto Br Cpp

  • Newbie
  • *
  • Posts: 40
  • Programming is life
    • View Profile
    • Email
[SOLVED] I need help about one subject of C++
« on: May 27, 2016, 04:16:07 pm »
Hey guys...good afternoon for all..I'm are having a question that I already have ask and search on the internet but it's not very clear on my mind..what subject of C++ programming treats about data hiding or resource hiding??? to be more exact I'll be give an example...suppose that I'm programming an game...and my all resources are in a folder called "Resources" but I dont want to let the resources stay un-secury because one person can take that resource and use for himself....and what I want is to put theses files in an data archive for example: all .png files for graphics go on an file called Graphics_Data.dat or something like that...sorry If I not explain very well but I hope you guys helps me...thanks!
« Last Edit: May 27, 2016, 04:56:18 pm by Carlos Augusto Br Cpp »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: I need help about one subject of C++
« Reply #1 on: May 27, 2016, 04:36:28 pm »
First, there is no absolute security. Given the time and the interest every game's resources can and will be extracted somehow.
Second, your resources will automatically be protected (it's your work) and to be sure, put them under a license.

With that in mind it mostly just becomes a question of trade offs. How much time to do want to invest obfuscating your resources and how probable is it, that anyone is even interested in obtaining the resources?
For your small games, it's probably not worth adding the extra layer.

If you still want to do it, there are many ways.
One of the simplest would be to use physfs or similar, which is basically just an archive and lets you stream data from it. If it's just an archive, then many programs will be able to extract it.
Another option would be to create your own binary format that you know how to read from and write to. Without the source code, it can take quite a while to reverse engineer how the format works, but it's also a bit harder for you to maintain it.
With both versions you could try an obfuscate the data you're saving or reading, that way people not only would have to figure out the format or unpack the data, but they'd also have to reverse engineer the obfuscation.

In the end, without proper hiding mechanics in your application, good reverse engineers will just be able to run your application and grab the data once it's been decoded.

Personally, I don't think it's worth spending much or any time on. The main reason I'd use something like PhysicsFS would be to have all resources in one archive as oppose to everything being cluttered in multiple directories.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Carlos Augusto Br Cpp

  • Newbie
  • *
  • Posts: 40
  • Programming is life
    • View Profile
    • Email
Re: I need help about one subject of C++
« Reply #2 on: May 27, 2016, 04:52:23 pm »
Thanks Exploiter for your help...hey this is true because its even good to people pratice their ability with some material and he can take the resources and do prototypes...I'll try to be free of theses thinks...because I know high popular games that are played by million s of people that the resources are not protected like Geometrical Dash that is one of my favorite game...really thanks..