Page 1 of 1

Writing an archive viewer

Posted: Sat Jul 28, 2012 10:04 pm
by finale00
So I'm using C# to write a simple archive viewer GUI.
I have it working and it loads up my archive and displays all of the file paths in a nice tree view structure.

But I don't have any references to my list of file entries to actually get the offsets and sizes!

Image

Anyone have ideas on how I could reference my entries?

Re: Writing an archive viewer

Posted: Sun Jul 29, 2012 10:17 am
by Rick

Re: Writing an archive viewer

Posted: Mon Jul 30, 2012 9:07 pm
by snakemeat
I've done something similar in VGMToolbox, see the source for the ISO Extractor form here. Drop me a PM if you have any questions.

Re: Writing an archive viewer

Posted: Tue Jul 31, 2012 1:33 am
by finale00
I guess using that tag property is the easiest way to go. I'll go with that for now.

Re: Writing an archive viewer

Posted: Fri Aug 10, 2012 8:40 pm
by WRS
i'm not familiar with c# in any way, but you only need store all the file data in an array(or vector or similar) and have the tree items hold an index so the file data array.

Re: Writing an archive viewer

Posted: Thu Aug 16, 2012 10:26 pm
by ChocoladeBen
Finale00 great job.
Could you please give me a link to some toturials where to start from ? what you did is just what i wanted to do also in c#.
But i want to learn to do it.

If its not so hard to learn and understand could you give me some guide so i can get at least to the point you did ?

Re: Writing an archive viewer

Posted: Fri Aug 17, 2012 6:21 pm
by finale00
I already knew what I wanted to do so it was a matter of looking at how to write it in C#.

1: you start by figuring out the archive format
2: then you write an unpacker script (to verify the format is correct)
3: then you make the GUI and have it run the unpacker script (you might re-write the script in C# if you didn't already)
4: the unpacker script doesn't actually unpack anything in GUI mode; instead, it parses it and returns a list of file entries, which you can draw on the GUI
5: users then choose what to unpack: everything, selected items, selected folders, etc.

Everything I needed was on stackoverflow and microsoft's online docs.

Re: Writing an archive viewer

Posted: Sat Aug 25, 2012 6:12 am
by Dinoguy1000
finale00 wrote:I already knew what I wanted to do so it was a matter of looking at how to write it in C#.

1: you start by figuring out the archive format
2: then you write an unpacker script (to verify the format is correct)
3: then you make the GUI and have it run the unpacker script (you might re-write the script in C# if you didn't already)
4: the unpacker script doesn't actually unpack anything in GUI mode; instead, it parses it and returns a list of file entries, which you can draw on the GUI
5: users then choose what to unpack: everything, selected items, selected folders, etc.

Everything I needed was on stackoverflow and microsoft's online docs.
Or you could skip having to write a GUI and just write a MexScript. (:

Re: Writing an archive viewer

Posted: Sat Aug 25, 2012 8:03 pm
by finale00
Dinoguy1000 wrote: Or you could skip having to write a GUI and just write a MexScript. (:
Usually I would expect an unpacker eventually becomes a re-packer, and support specific functionality for the particular format.

Re: Writing an archive viewer

Posted: Sun Aug 26, 2012 2:47 am
by Dinoguy1000
finale00 wrote:
Dinoguy1000 wrote: Or you could skip having to write a GUI and just write a MexScript. (:
Usually I would expect an unpacker eventually becomes a re-packer, and support specific functionality for the particular format.
MultiEx Commander allows for repacking archives, though I don't understand very well how it decides whether it can or can't repack a given archive format (and I definitely have no comment on format-specific functionality).