Loaded Archive File Lists

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
noretsar
Posts: 11
Joined: Fri May 11, 2018 2:04 am

Loaded Archive File Lists

Post by noretsar »

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?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loaded Archive File Lists

Post by CuteAlien »

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
noretsar
Posts: 11
Joined: Fri May 11, 2018 2:04 am

Re: Loaded Archive File Lists

Post by noretsar »

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.
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
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loaded Archive File Lists

Post by CuteAlien »

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
noretsar
Posts: 11
Joined: Fri May 11, 2018 2:04 am

Re: Loaded Archive File Lists

Post by noretsar »

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
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?

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.
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Loaded Archive File Lists

Post by MartinVee »

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?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Loaded Archive File Lists

Post by CuteAlien »

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
Post Reply