Romhacking.net

Romhacking => Newcomer's Board => Topic started by: mikey3 on March 10, 2013, 11:56:56 am

Title: Pulling things out of a file
Post by: mikey3 on March 10, 2013, 11:56:56 am
If I had a file and knew that there were things in it like graphics, how would I extract them from the file? I read somewhere that you can use LZ77 compression search for compressed things, but after finding the headers how would I get the files out?
Title: Re: Pulling things out of a file
Post by: Pikachumanson on March 10, 2013, 12:08:55 pm
Read the Art of Romhacking. It has stuff on Lz77.
Title: Re: Pulling things out of a file
Post by: RetroHelix on March 10, 2013, 01:02:01 pm
If you just want to rip something 'Jaeder Naub' could be of help. I don't know were to download the newest version though.

In general you would try to find out how the archive stores the files and write an extractor or extract the files by hand (cut out). If you are just looking for graphics you could search the archive for the header of the files you expect to be in the archive.
Title: Re: Pulling things out of a file
Post by: mikey3 on March 10, 2013, 01:04:13 pm
If you are just looking for graphics you could search the archive for the header of the files you expect to be in the archive.

Yes, that's what I did and have found the header. Now what do I do to extract it?
Title: Re: Pulling things out of a file
Post by: henke37 on March 10, 2013, 02:57:19 pm
You need to identify what areas of the file the subfiles are located in. This boils down to start position and file length. You will also need to identify if the subfiles are compressed or not. The problem here is figuring out how this data is stored. There is a lot of ways to store this metadata.
Title: Re: Pulling things out of a file
Post by: RetroHelix on March 10, 2013, 03:15:02 pm
Yes, that's what I did and have found the header. Now what do I do to extract it?
There must be some information about the size of the file you want to extract either somewhere in the archive itself or in the file you want to extract or in both. It is also possible there is another file with information about the size and location of the files inside the archive.
Title: Re: Pulling things out of a file
Post by: mikey3 on March 10, 2013, 05:46:14 pm
There are two files that go with it, a .viw and .inf. It appears that the viw lists the files in the archive, so I'm guessing the inf says the size? How would I figure out the size?
Title: Re: Pulling things out of a file
Post by: henke37 on March 10, 2013, 08:21:16 pm
It is usually rather obvious what the size field is. Many games have files with similar content, sometimes similar enough to have the exact same file size.

Just look at the numbers that you have and see if something looks like a file size.
Title: Re: Pulling things out of a file
Post by: RetroHelix on March 11, 2013, 08:17:15 am
If the files inside the archive have a header too you could just determine the size of one file from the different offsets in the archive. Then you search for this filesize in your viw/inf file.
Title: Re: Pulling things out of a file
Post by: joesteve1914 on March 15, 2013, 11:36:38 pm
,
Title: Re: Pulling things out of a file
Post by: mikey3 on March 15, 2013, 11:38:49 pm
Ok, I've extracted a file and decompressed it. The only problem are that the graphics aren't right. The colors are messed up and the tiles are all mixed up. How do I fix this? There is no map files or palette files in the archive as far as I know.
,

What does that mean?
Title: Re: Pulling things out of a file
Post by: Auryn on March 16, 2013, 12:34:30 am
There should be a palette and a map somewhere. Maybe they are not "marked" as palettes or maps but they are. Or you have to change the amount of tiles for each line.
It's difficult to help you if we don't know what game, system you are working on. Some screenshots or files to download would be helpful as well.
Title: Re: Pulling things out of a file
Post by: mikey3 on March 16, 2013, 10:31:59 am
It's for DS.

Also, I switched games after finding out someone else was translating the one before, and this one has no .viw or .inf files to look in.
Title: Re: Pulling things out of a file
Post by: Pikachumanson on March 16, 2013, 10:55:15 am
Why so coy? No one here wants to steal your ideas or translation. We are here to help each other. Maybe else has worked on the game you are doing and might be able to share ideas with you.
Title: Re: Pulling things out of a file
Post by: mikey3 on March 16, 2013, 11:12:08 am
I think I just found a map file. How do you apply maps in CrystalTile2? I never could figure that out.