Direct CTPK Editor?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by dj505, Jun 1, 2017.

  1. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    So, I've been doing a lot of sprite editing for Project Mirai DX, and its texture files are packed into .ctpk archives. Here's the catch, though.

    Each file has a .bin extension, and when you open it in a hex editor, instead of just being a plain ctpk file it starts off with a bunch of text like this:
    Warning: Spoilers inside!
    and when you scroll down past it all, you finally hit the .ctpk file itself. And if you scroll down to the end of that ctpk file, you find a second one, then a third one, or more depending on the file.

    Is there are way I could edit these directly instead of having to individually extract them, edit them, and patch them back in through hex editing?
     
  2. Thelostrune

    Thelostrune GBAtemp Advanced Fan

    Member
    544
    128
    Aug 13, 2015
    Norway
    Sounds like an obvious archive. Show us the full header, maybe?
     
  3. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    The screenshot I included starts at the very top of the file. It's not a container of any type afaik.
     
  4. pikatsu

    pikatsu GBAtemp Advanced Fan

    Member
    722
    125
    Apr 16, 2014
    Argentina
    Use kuriimu
     
  5. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Can't open it.
     
  6. pikatsu

    pikatsu GBAtemp Advanced Fan

    Member
    722
    125
    Apr 16, 2014
    Argentina
    use Kukkui.exe
     
  7. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
    seems ctpk are packed into an archive with offset jump?
    needs actual bytes to confirm
     
  8. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Doesn't work either
    Which bytes? (Sorry, am a n00b)
     
  9. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
    those bytes instead of ascii characters

    — Posts automatically merged - Please don't double post! —

    file sample would be great.
     
  10. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Ah ok. Here you go, starting from the top of the file. It goes on for a bit. Not sure I can share a smple file cuz copyright, or I'd do so.
    Warning: Spoilers inside!
     
  11. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
    what's the offset when cptk first occur in the bin file?
     
  12. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    376C is the offset of the C in the first CTPK header.
     
  13. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
    what about 3768?
     
  14. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    That's 4 bytes before the C, which are 80 00 08 00
     
  15. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
    what's the next ctpk offset?
     
  16. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    103874
     
  17. Ericjwg

    Ericjwg Good

    Member
    2,847
    687
    Jul 2, 2015
    Canada
  18. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    520
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Ok, thanks for your help tho! This game isn't exactly the most popular game to hack, only a few people (including myself) have done it. I've already learned a ton from it too.