Author Topic: XRC files...  (Read 10205 times)

darklordsatan

  • Guest
XRC files...
« on: July 13, 2005, 05:09:00 pm »
From what Ive seen, c::b uses xrc resource format for the GUI (most, if not all..), and loads them on the fly.
My question is: Is there any way to somehow encode the xrc (not just saving them in .zip) so that a user wont be able to open the .xrc and change the dialogs? is there any way to convert .xrc to binaries or something like that?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
XRC files...
« Reply #1 on: July 13, 2005, 05:54:01 pm »
Not that I know of. But you could define your own filesystem (that's how zip files are read in wxwidgets) that encrypts or decrypts using a specific key. Hope I helped.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
XRC files...
« Reply #2 on: July 13, 2005, 06:43:10 pm »
probably by using zlib...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

darklordsatan

  • Guest
XRC files...
« Reply #3 on: July 13, 2005, 07:34:07 pm »
Oh yeah, I could use my own file format to store the files... but it would be better if xrc could be encrypted by default though

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
XRC files...
« Reply #4 on: July 13, 2005, 07:45:38 pm »
*shrugs*

Anonymous

  • Guest
XRC files...
« Reply #5 on: July 13, 2005, 08:09:02 pm »
that defeats the whole purpose of XRC, maybe you don't need XRC then.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
XRC files...
« Reply #6 on: July 13, 2005, 09:11:34 pm »
You could use wxrc with the /c switch, this ouputs a c/c++ file which you can put in your project. This does not encrypt anything, but it hard-codes the resources into your program so that at least the average user will have problems editing them.
The resources are, of course, still plaintext in your executable, so someone able to use a hex editor won't have problems reading, but the dialogs appear "plaintext" on the screen, too, so there is no big secret, anyway.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

darklordsatan

  • Guest
XRC files...
« Reply #7 on: July 13, 2005, 10:24:35 pm »
Thanks Thomas, seems like a nice switch, will take a look

Quote from: Guest

that defeats the whole purpose of XRC, maybe you don't need XRC then.


Sort of. But likely the purpose of xrc is to give the possibility to change a dialog by an easy means (a dialog editor, or manually) and then not having to recompile anything (unless you add new controls...). But the fact its plain text, thats another matter...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
XRC files...
« Reply #8 on: July 13, 2005, 10:41:39 pm »
Why don't you ask in the wxwidgets forums? (I mean the ones in the official wxwidgets site)

darklordsatan

  • Guest
XRC files...
« Reply #9 on: July 14, 2005, 07:40:05 am »
Yep, I will *duh! for me*