News: 11 March 2016 - Forum Rules

Author Topic: Pulling things out of a file  (Read 5016 times)

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Pulling things out of a file
« 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?

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
Re: Pulling things out of a file
« Reply #1 on: March 10, 2013, 12:08:55 pm »
Read the Art of Romhacking. It has stuff on Lz77.

RetroHelix

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Pulling things out of a file
« Reply #2 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.

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Pulling things out of a file
« Reply #3 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?

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Pulling things out of a file
« Reply #4 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.

RetroHelix

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Pulling things out of a file
« Reply #5 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.

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Pulling things out of a file
« Reply #6 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?

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Pulling things out of a file
« Reply #7 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.

RetroHelix

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Pulling things out of a file
« Reply #8 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.

joesteve1914

  • Full Member
  • ***
  • Posts: 122
    • View Profile
    • Ripening Tingle's Balloon Trip of Love translation project
Re: Pulling things out of a file
« Reply #9 on: March 15, 2013, 11:36:38 pm »
,

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Pulling things out of a file
« Reply #10 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?

Auryn

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Pulling things out of a file
« Reply #11 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.

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Pulling things out of a file
« Reply #12 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.

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
Re: Pulling things out of a file
« Reply #13 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.

mikey3

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: Pulling things out of a file
« Reply #14 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.