Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started 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?
-
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.
-
probably by using zlib...
-
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
-
*shrugs*
-
that defeats the whole purpose of XRC, maybe you don't need XRC then.
-
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.
-
Thanks Thomas, seems like a nice switch, will take a look
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...
-
Why don't you ask in the wxwidgets forums? (I mean the ones in the official wxwidgets site)
-
Yep, I will *duh! for me*