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.

Loaded Archive File Lists

Postby noretsar » Mon May 14, 2018 1:43 pm

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

Re: Loaded Archive File Lists

Postby CuteAlien » Mon May 14, 2018 7:47 pm

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.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8533
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Loaded Archive File Lists

Postby noretsar » Thu May 17, 2018 1:45 am

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

Re: Loaded Archive File Lists

Postby CuteAlien » Thu May 17, 2018 10:07 am

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.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8533
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Loaded Archive File Lists

Postby noretsar » Tue May 22, 2018 7:19 pm

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

Re: Loaded Archive File Lists

Postby MartinVee » Tue May 22, 2018 8:49 pm

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

Re: Loaded Archive File Lists

Postby CuteAlien » Tue May 22, 2018 11:44 pm

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.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8533
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 0 guests