Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: darklordsatan on July 13, 2005, 05:09:00 pm

Title: XRC files...
Post by: darklordsatan 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?
Title: XRC files...
Post by: rickg22 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.
Title: XRC files...
Post by: David Perfors on July 13, 2005, 06:43:10 pm
probably by using zlib...
Title: XRC files...
Post by: darklordsatan 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
Title: XRC files...
Post by: rickg22 on July 13, 2005, 07:45:38 pm
*shrugs*
Title: XRC files...
Post by: Anonymous on July 13, 2005, 08:09:02 pm
that defeats the whole purpose of XRC, maybe you don't need XRC then.
Title: XRC files...
Post by: thomas 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.
Title: XRC files...
Post by: darklordsatan 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...
Title: XRC files...
Post by: rickg22 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)
Title: XRC files...
Post by: darklordsatan on July 14, 2005, 07:40:05 am
Yep, I will *duh! for me*