How do you extract files from a .dat file extracted from a 3DS game?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Tomato Hentai, Jan 31, 2015.

  1. Tomato Hentai
    OP

    Tomato Hentai snart

    Member
    3,681
    5,833
    Oct 30, 2014
    Canada
    actually north korea. please send help
    The title pretty much says all, I guess.
     


  2. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
    .dat could be any type of file... if you want help you should probably post a screenshot of the beginning of the file in a hex editor.
     
  3. Tomato Hentai
    OP

    Tomato Hentai snart

    Member
    3,681
    5,833
    Oct 30, 2014
    Canada
    actually north korea. please send help
    [​IMG]
     
  4. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    509
    Jul 15, 2011
    United States
    That looks like an LZ11 compressed file. You should probably be able to decompress it with DSDecmp (or use the DSDecmp GUI in 3DSExplorer, setting it to LZ11). It's up to you to figure out the format after you decompress the data, though.
     
  5. Traiver

    Traiver GBAtemp Maniac

    Member
    1,103
    1,157
    Aug 1, 2014
    Germany
    Pew! *Out of the bag*
    I had decompressed the pack.dat file with your method. There are 2 files now, pack.dat (129MB) and the pack_dec.dat (9KB). Can you tell me, what to do next?
     
  6. Nagato

    Nagato GBAtemp Advanced Fan

    Member
    531
    509
    Jul 15, 2011
    United States
    No one can really tell you what to do. We don't even know what game you're looking at. The format could literally be anything. You'll have to use a hex editor to figure out the format yourself. If it decompressed the 9kb, then my guess is that it only decompressed a single file. Which would mean that you need to find a file table somewhere that gives the offsets and possibly sizes and filenames for each file in the pack.dat.
     
  7. Nurio

    Nurio That Kirby fan

    Member
    842
    191
    Mar 31, 2009
    Netherlands
    The Netherlands
    ...Ace Attorney Trilogy?
     
  8. Tomato Hentai
    OP

    Tomato Hentai snart

    Member
    3,681
    5,833
    Oct 30, 2014
    Canada
    actually north korea. please send help
    Ay. That's what the file was from.
     
  9. Kaphotics

    Kaphotics badc0ded

    Member
    610
    460
    Sep 10, 2010
    United States
    probably just a bch model based off the compressed pic
     
  10. Nurio

    Nurio That Kirby fan

    Member
    842
    191
    Mar 31, 2009
    Netherlands
    The Netherlands
    I tried decompressing it as well with no luck so far. It's funny how I recognized that file, though.
     
  11. Tomato Hentai
    OP

    Tomato Hentai snart

    Member
    3,681
    5,833
    Oct 30, 2014
    Canada
    actually north korea. please send help
    It most likely is not, but rather a Capcom custom file using the BCH extension. The Ace Attorney Trilogy uses no 3D models.
    Well, except for on the home menu, I think? I, myself don't own AAT.
     
  12. andibad

    andibad Soon™

    Member
    701
    90
    Sep 14, 2009
    Indonesia
    hospital
    if i can read it correctly based of screenshot, that file :
    - compressed by lz 11
    - uncompressed (iirc) size is 8932 byte or around 8.72265625 KB (rounded to 9 KB)
    - but filesize of pack.dat is around 120~ mb?

    you should find file table for that file, as stated by nagato.
     
  13. Tomato Hentai
    OP

    Tomato Hentai snart

    Member
    3,681
    5,833
    Oct 30, 2014
    Canada
    actually north korea. please send help
    You are entirely correct. It honestly amazes me how people can identify a file's compression method, etc, just by looking at it.
    Anyways, how do you find the file table?
     
  14. Dan_Tsukasa

    Dan_Tsukasa GBAtemp Regular

    Member
    171
    41
    Oct 14, 2014
    Tokyo Japan
    bch is a container of sorts, often it contains a 3d model but it also contains the textures.

    So its not a stretch to assume capcom used bch as a container for various 2D textures.

    Its deffinitly a BCH file though, file extensions come and go and mean very little, but if its a BCH header (as we can see there) then its almost certain to be a BCH file, but its most likely been customized a little, as it always seems to be.
     
  15. Nurio

    Nurio That Kirby fan

    Member
    842
    191
    Mar 31, 2009
    Netherlands
    The Netherlands
    There's a pack.inc together with the pack.dat... Is it possible that's the file table?

    Yeah, my initial assumption has always been that this contained all the sprites and other graphics.
     
  16. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
    yeah, gimme a bit and I should have an unpacker.
     
    Nurio, cearp and Traiver like this.
  17. Traiver

    Traiver GBAtemp Maniac

    Member
    1,103
    1,157
    Aug 1, 2014
    Germany
    Pew! *Out of the bag*
    That would be aweseome!
     
  18. NCDyson

    NCDyson Hello Boys...

    Member
    271
    113
    Nov 9, 2009
    United States
    Here's a really crappy python script to extract all 12940 files from the pack.dat... It took like an hour to complete on my computer, maybe someone else could speed it up.

    Place this script, along with DSDecmp into the same folder as the pack.dat and pack.inc and it'll extract and decompress everything. There were no file names stored in the pack.inc, so they're all numbered. The BCH files look to have a really simple structure, so extracting the images out of them shouldn't be too hard.
     

    Attached Files:

  19. Traiver

    Traiver GBAtemp Maniac

    Member
    1,103
    1,157
    Aug 1, 2014
    Germany
    Pew! *Out of the bag*
    Like this? And whats now?

    Nvm, I got over 12.000 extracted and decompressed files now. How to open them, I would translate the game...
    [​IMG]
     
  20. Dan_Tsukasa

    Dan_Tsukasa GBAtemp Regular

    Member
    171
    41
    Oct 14, 2014
    Tokyo Japan
    Do you have Python installed?
    You'll require python to be installed in order to run a Python script.