[HELP] Unpacking Badge Images from Nintendo Badge Arcade ROMFS

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Sgt. Lulz, Dec 7, 2015.

  1. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    Once unpacked, the current badge pack is located in /region_[REGION]/common/sharc/pc.sarc.
    This package changes with every update, and badges that were once there may be missing an update later.
    Alternatively, the game's save data has an archive called allbadge.sarc containing mostly badge files and what might be theme files.

    Februarysn0w's allbadge.sarc file can be found in the 00001346 folder here: https://onedrive.live.com/redir?resid=B6305612E3C95FBD!694&authkey=!ANwz34EVEYjGARc&ithint=folder%2crar

    The magic bytes for the badges are 50 52 42 53 (PRBS) and the badge ID seems to be stored at 44 onwards. Below that, the collection ID (Badge ID in the japanese version) is written at 74 and multiple translations of the nice collection name are written starting from E0.


    The format below that seems to be mostly similar to how badges are stored in Badge ExtData, although I'm not too sure.

    According to user @nanika , the pc.sarc file from each update contains the badges for the week stored in binary .prb files.
     
    Last edited by Sgt. Lulz, Dec 24, 2015


  2. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    -snip, a single .sarc dump can't be relied on-
     
    Last edited by Sgt. Lulz, Dec 24, 2015
  3. redunka

    redunka GBAtemp Regular

    Member
    286
    134
    Nov 26, 2014
    Russia
    Japanese Badge Arcade has an update, which is way bigger than app itself.
    And pc.sarc file of that update is about 40 MB, so probably that's where all other badges are stored.
    I can share it if you want.
     
  4. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    That'd be much appreciated.
     
  5. redunka

    redunka GBAtemp Regular

    Member
    286
    134
    Nov 26, 2014
    Russia
    PM'd you, that's probably illegal to share it here.
     
  6. MichMaster

    MichMaster #Pray4Hykem

    Member
    345
    175
    Dec 23, 2009
    Canada
    In the IOSU
    Do you think there is a way to extract all of the badges? It would be so awesome to get the original ones rather than mess up installing custom ones >.<
     
  7. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    There's two routes to be taken here:

    The technical one:
    Already being worked on.

    The cheap and long one:
    http://gbatemp.net/threads/nintendo-badge-arcade-badges-collection.405667/
    Ditto.

    A BOSS file containing the entire badge library can be found on Nintendo's CDN, as pointed out by @shinyquagsire23:
     
    Last edited by Sgt. Lulz, Dec 24, 2015
    MichMaster likes this.
  8. MichMaster

    MichMaster #Pray4Hykem

    Member
    345
    175
    Dec 23, 2009
    Canada
    In the IOSU
    The cheap and long one would also be a bit hard since i don't think many people around here are willing to spend a lot to get all badges in a legit way, I hope someone proves me wrong though :P
     
    Last edited by MichMaster, Dec 9, 2015
  9. shinyquagsire23

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,961
    3,231
    Nov 18, 2012
    United States
    Las Vegas
  10. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    -snip, updated posts above-
     
    Last edited by Sgt. Lulz, Dec 24, 2015
  11. nanika

    nanika 文鎮じゃダメ!まぁ、こんな文字小さしすぎてどうせ読めないっしょ。

    Member
    249
    27
    Apr 22, 2008
    United States
    The game switched from xml to binary blobs to save space so these were very easier to figure out beforehand. The "b" in all these extensions stands for binary since the xml versions aren't used anymore.
    .crb files are the backgrounds used for each Crane. Pull the header off and they're just normal textures. They were combined with frames at some point and ended up with cr meaning Crane.
    .icb files are Crane Icons, haven't looked into them but presumably the bottom screen icon textures when flipping through Catchers / Collection entry.
    .cib files are Crane Instances - they contain the placement, heaviness, stickiness etc of each badge of a Catcher / Collection entry. Also lists which Crane Icon/BgPanel to use.
    .fob files are Fixed Objects, basically permanent things that block you from getting the badges. Header+texture.
    .cab files are Categories, the categories each badge is collected into. These are where the game pulls the "x/x" data from the Collection from.
    .atb files are Attachments, basically moveable things that block you from getting the badges. Header+texture.

    Also note that the 'collection name' is actually the badge's name, over in Japan most badges have a name i.e., "Goomba (Stepped On)" instead of "Super Mario Bros. badge" but they were made completely useless for international release.

    j0ITmVqVgfUxe0O8 will get you the full one.
    Nah, not hard at all.
    pc.sarc files only contain the current week's badges.
     
    Last edited by nanika, Dec 24, 2015
  12. Sgt. Lulz
    OP

    Sgt. Lulz GBAtemp Regular

    Member
    288
    217
    Oct 16, 2010
    Well, hell.
    I'll get to updating my posts now.
    Thanks for the great job.
    I'm assuming Mega badges are being downscaled to fit by the program at the moment.
     
    Last edited by Sgt. Lulz, Dec 24, 2015
  13. Binebina87

    Binebina87 GBAtemp Regular

    Member
    243
    68
    May 27, 2013
    Gambia, The
    I was looking for something like this :-) Sorry to bump this.

    So I downloaded the allbadge_v130.dat from cdn and now what do I have to do to extract the png files?

    (I tried using the "j0ITmVqVgfUxe0O8" link but it didnt work...)
     
    Last edited by Binebina87, Jul 5, 2016
    noctis90210 and cearp like this.
  14. Ev1l0rd

    Ev1l0rd ◥▷◁◤ Knight of Void

    Member
    962
    647
    Oct 26, 2015
    Netherlands
    Land of Darkness and Bounty
    Interesting. Despite the necro, BOSS decrypting is currently in Decrypt9 (apparently), so might be worth a shot putting the aforementioned file through Decrypt9.
     
  15. cearp

    cearp the ticket master

    Member
    7,405
    4,657
    May 26, 2008
    Tuvalu
    don’t give up
     
  16. Binebina87

    Binebina87 GBAtemp Regular

    Member
    243
    68
    May 27, 2013
    Gambia, The
    I'm trying, but I actually have no idea what I'm doing lol

    I decrypted the allbadge.dat with decrypt9. When opening it in HxD the most interesting thing I see is stuff like this :
    pc/rt/Pr/Pr_Emblem_Circle_CharA44.prb.szs...
    pc/rt/CI/CraneIcon_PokeExt_004.icb.szs..
    pc/rt/CI/CraneIcon_Pokemon_003.icb.szs..
    pc/rt/Pr/Pr_AnimalItem2_Item_421.prb.szs.

    But I dont know what to do next :-)
     
    noctis90210 and cearp like this.
  17. redunka

    redunka GBAtemp Regular

    Member
    286
    134
    Nov 26, 2014
    Russia
    Proper link for Japanese allbadge_v130.dat is "j0ITmVqVgfUxe0O9".
    BOSS decryption and Yaz0 compression are easy parts,
    bur we have to find a way to somehow extract/convert images from those PRBS files.
    As stated in OP, format seems to be similar to how badges are stored in Badge ExtData,
    so maybe creator of GYTB can do something about it?
     
    Binebina87 and cearp like this.
  18. MrCheeze

    MrCheeze GBAtemp Regular

    Member
    200
    208
    May 13, 2014
    Canada
    This sounds vaguely piracy related, so I think not.
     
  19. Binebina87

    Binebina87 GBAtemp Regular

    Member
    243
    68
    May 27, 2013
    Gambia, The
    Sad to hear that.

    However I tried my luck with the .rarc files using rarcdump.exe but it just gives me an empty folder (I think its because of the PBRS encryption)
    So if anyone more skilled likes to try shoot me a PM and I can send you some of the rarc files :-)
     
  20. redunka

    redunka GBAtemp Regular

    Member
    286
    134
    Nov 26, 2014
    Russia
    PRBS is not an encryption, it is a name of file format. Those files should have .prb extension.

    And that format is actually pretty simple, here is how badge data is stored in it.

    For regular size badges:

    Badge data starts at offset 0x1100 and has a size of 0x2800 (0x2000 for badge itself and 0x800 for its shape - exactly like in BadgeData.dat).

    For mega size badges:

    Again, each piece of mega badge has a size of 0x2800 and they start at offsets: 0x4300, 0x7500, [0xA700, 0xD900] - last two are only for mega badges that have 4 pieces.

    Below every badge piece or regular-sized badge there is a data with size of 0xA00.
    It's a badge preview - small icon that is displayed in Badge Case.
    Same previews are stored starting at 0xCDCF80 in BadgeData.dat.

    Of couse, it is possible to just copy/paste data from PRBS files to BadgeData.dat with hex editor, but it is extremely slow and inconvenient.
     
    Binebina87 likes this.