Loaded Archive File Lists
Loaded Archive File Lists
Hi, I'm trying to customize my loaded archive, but I can only read the first file when I added some padding to my archive file. Is there a way to check what is loaded, debug or know what is happening when I load a zip archive?
Re: Loaded Archive File Lists
What is customizing a loaded archive? Do you mean stuff like adding files? I don't think that's possible. If you need that my way to do that would probably be to copy-paste the code of the archive-loader and then check how to modify that directly.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Loaded Archive File Lists
Hi! Yes, I was trying to use a custom zip/archive format by moving the signature offset and adding a few more bytes at the beginning. I modified a few sources which affects the archive reading and it works, but I can only read the first file, no idea where to get the current file pointer or how to track or fetch the rest of the files as I thought this was loaded to memory or something.CuteAlien wrote:What is customizing a loaded archive? Do you mean stuff like adding files? I don't think that's possible. If you need that my way to do that would probably be to copy-paste the code of the archive-loader and then check how to modify that directly.
Re: Loaded Archive File Lists
So you don't want to modify files but archive itself? I suppose you have to check source for that. For zip it's CZipReader.cpp
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Loaded Archive File Lists
Hey Cute Alien, I was trying to read a modified archive, it seems to be finding those file pointers reference is a bit confusing on the source. So my question is, how does Irrlicht read zip archives? Does it load an archive in memory? where do I keep track of the file pointer of a loaded archive? Is it really loaded?CuteAlien wrote:So you don't want to modify files but archive itself? I suppose you have to check source for that. For zip it's CZipReader.cpp
As I have mentioned, I have attempted to modify that particular file as well as others that seems to be referencing those features, but so far I can only read the first file when I moved the archive signature a few more bytes.
Re: Loaded Archive File Lists
Just to be sure I understand correctly. You modify (so essentially, you corrupt) an archive file, and then ask why the code can't read it?
Re: Loaded Archive File Lists
I didn't write that code, but from a quick read (very short, just browsing over it for a minute) it looks to me like it reads the zip-header into memory. And when requesting certain files inside the archive it depends if the archive is compressed or not. For uncompressed files it keeps them as files and just reads from the positions mentioned in the zip-header (using limit-read-file which allows a file to act as if it consists of several files by telling from where-to-where inside the real file any of those limit-read-files goes). For compressed files it decompressed the part of the zip file into memory and gives you a memory-read-file (which allows you to access memory like a file).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm