Hi there,
I'm programming an archiving class and the archive is currently able
to read files, concatenate them in one and compress the archive (or
specific files that can be compressed) with the zlib.
I think I will be concatenating this archive to a binary executable that
will read itself to find its data (btw, it's an OpenGL program with
textures).
So we have:
1. OpenGL program
2. Archive
1. TextureA
2. TextureB
3. TextureC
OpenGL program (1.0) reads the archive (2.0), finds the textures and
loads TextureA (2.1), TextureB (2.2), TextureC (2.3).
Currently my program can succesfully read all textures and run the
OpenGL animation.
What I'm thinking is if it is possible to execute an archived
(uncompressed, raw binary) program in such an archive.
1. Program
2. Archive
1. DataA
2. Program I want to exec
3. DataB
Program (1.0) reads the archive (2.0), reads DataA (2.1), start the
execution of the second program in the archive (2.2), etc...
How I read the data:
Normally i open an ifstream, read the header of my archive, finds the
byte position of the start of the file I wish to read, then jump the
cursor position to that place and pass the ifstream to whatever wish to
read that file (ie, loadJPEG()).
Now I'd like to move the cursor to the start of an archived program and
start executing it as a new program or as a child of the current
program. (Doesn't matter...)
Is this possible?
My OpenGL program is running fine under linux and windows. Is this
possible for linux and windows (is the code I need compatible?)
Thanks a lot!
Xilo