Hi, I'm here again
Anybody knows if there's a method to decrypt files while loading them? For example: I encrypt files with XOR and then, I want that irrlicht loads the file and before "process" the file, decrypts it with the XOR code that I wanted.
In what .cpp file can I add the "function" to decrypt the files?
Thanks in advance.
How to decrypt files realtime
No, Irrlicht creates a file handle that is suitable for reading data from a file. You have to put that data into a block of memory that you can access.turconi wrote:Yes...Irrlicht loads the file and then put it in memory.
You'd put it into a source file, hopefully alongside your encryption function. You shouldn't need to modify any of the existing Irrlicht library code to do this.turconi wrote:In what file could I add a function to decrypt it?
If you are using a recent version of Irrlicht, you should consider creating your own derived IArchiveLoader class that knows how to recognize, open and read an encrypted file archive. All you need to do is create an instance of your archive loader and pass it to the file system. Then whenever you try to get a file, you just request it from the file system, and it will be decrypted automagically.
Travis