[Tool] Bandai Namco's L7C Archive Tool

Discussion in 'PS Vita - Hacking & Homebrew' started by Nagato, Sep 20, 2016.

  1. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    I made these originally for the Taiko no Tatsujin V project, but I figured I might post them because it's used in more than just that game and until now, the format hasn't had a proper tool besides a hacky BMS script.

    This tool can extract and create archives and supports file compression. It also checks all the relevant hashes for all data, so I can guarantee that it's dumping everything correctly.

    Known games:
    - Taiko no Tatsujin V
    - Tales of Hearts R (including iOS version)

    Broken:
    - Tales of Hearts R (PS Vita) -> Seems to use different compression and/or encryption

    Source code: https://github.com/solaris573/taikotools
    Binaries: https://github.com/solaris573/taikotools/releases
     
    Last edited by Nagato, Sep 21, 2016
    tiduscrying, Tony_93, g.a.u and 4 others like this.
  2. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    405
    238
    Oct 15, 2014
    New Zealand
    New Zealand
    Thanks for the tools, glad to see can compress/decompress .bin files, can now port Taiko V/IM@S songs to the 3DS Taiko Titles, already ported 2 songs over while testing, potentially opens up porting 3DS to VITA, should be possible, not tried working out the VITA audio format yet, might look into when DLC is finally working in dumped version of Taiko V.
     
    Nagato likes this.
  3. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Nice to see someone else making use of it already! :D

    The old version of the tool that I gave tiduscrying wouldn't have been able to do that without the special CRC32 code they had going on specifically for filesystem name entries (Why? I used a dictionary to get around this until I could calculate it myself), so I'm glad you pointed me to that Tales of Hearts R game on iOS. I managed to find the hashing code last night during class (because who pays attention in class?) after a a while. Much easier than trying to get the binaries to load for PS Vita games.
     
  4. zzzzzzzzzzz

    zzzzzzzzzzz Member

    Newcomer
    40
    40
    Feb 8, 2015
    United States
    Can confirm it works on both versions of IM@S Must Songs. Thank you Nagato.
     
  5. carl1114

    carl1114 Member

    Newcomer
    15
    0
    Nov 19, 2014
  6. bopz44

    bopz44 Member

    Newcomer
    14
    1
    Sep 16, 2016
    France
    wow that's great work guyz! can't wait to see what you'll be able to do wih taiko 5
     
  7. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Tales of Hearts R on the PS Vita seems to fail when decompressing. As far as I can tell, this is another compression and/or maybe encrypted. It also has a different value than Tales of R on the iOS and Taiko no Tatsujin V, which may be some kind of good marker for detecting unsupported formats. I added some support for detecting it (and better fallback code) but it's not in the current build downloadable.
     
  8. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    405
    238
    Oct 15, 2014
    New Zealand
    New Zealand
    Hadn't actually tried this before but now that I have use for it I did.

    psvita-l7ctool doesn't seem to be compressing .bin files at all? I was trying to compress a file and didn't seem to do anything, I decided to take a .bin file straight from Taiko V and decompress that and recompress, not working correctly :(
     
  9. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    The decompression mode of psvita-l7ctool is only for the TXP files. They have a specific format that includes the filesize in the header.

    The tool should be automatically decompressing any data it dumps if you're using x mode, though. If you see a message at the beginning when you start it saying that it's an unsupported archive type, then it will dump raw data which seems to be in another compression format that I don't know and I most likely won't support.
     
  10. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    405
    238
    Oct 15, 2014
    New Zealand
    New Zealand
    Hmm psvita-l7ctool mentions the .bin files specifically though when looking at all its commands so thought it was made for those, it makes no mention of unsupported archive type, decompress the files found in" "_data\fumen" perfectly, they are essentially the songs note chart and work great ported back over to the 3DS version.

    I was trying to port a 3DS song over but since those .bin files aren't getting compressed looks like I'll be at a dead end, game won't take an uncompressed format.
     
  11. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    .bin is just a generic extension.

    All files should be getting compressed when you recreate the archive using the 'c' command. The tool will compress it automatically.
    If it's not working then it's for another reason and most likely not the tool I think.
     
  12. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    405
    238
    Oct 15, 2014
    New Zealand
    New Zealand
    Fair Enough, thought would just have said .txp if only works on those.

    Those .bin files come out of the L7C still compressed I have to run "psvita-l7ctool d input.bin output.bin" on them which works great, I just tried packing them back into a L7C but they don't get compressed.
     
    Last edited by DarkSynopsis, Sep 27, 2016
  13. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    Ah, I see what you mean. I didn't know they were compressed.

    I just ran the tool on the files and it's working for me, though. If it doesn't say "Filesize didn't match expected output filesize. Maybe bad decompression?" when you run the 'd' command on the .bin file then it *probably* decompressed fine.

    The tool *does* compress then when you use 'e', but it's a lazy compression. It's basically a fake compression which doesn't use any of the advanced features of the compression algorithm.

    So, if the data doesn't work when you use the 'e' command, then it probably still isn't the tool I would assume.
     
  14. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    405
    238
    Oct 15, 2014
    New Zealand
    New Zealand
    Oh Awesome, so it does work in-game, should have tested first but since the file size didn't change I assumed it didn't work, well back to work I go :)
     
  15. Nagato
    OP

    Nagato GBAtemp Advanced Fan

    Member
    531
    514
    Jul 15, 2011
    United States
    If anything, the filesize should increase. My compression method copies the raw data but adds a compression code every x bytes saying to read the next x bytes raw. :P

    Have fun~
     
  16. DanPulp

    DanPulp Newbie

    Newcomer
    3
    0
    Sep 27, 2016
    Mexico
    Doesn't work for me, maybe I'm using it wrong?