ROM Hack [HELP] Unpacking Badge Images from Nintendo Badge Arcade ROMFS

Sgt. Lulz

Beef up
Member
Joined
Oct 16, 2010
Messages
404
Trophies
0
XP
1,207
Country
United Kingdom
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.
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 (CRBS - 227 files) 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 (ICBS - 372 files) files are Crane Icons, haven't looked into them but presumably the bottom screen icon textures when flipping through Catchers / Collection entry.
.cib (CIBS - 370 files) 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 (FOBS - 240 files) files are Fixed Objects, basically permanent things that block you from getting the badges. Header+texture.
.cab (CABS - 32 files) 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 (ATBS - 27 files) 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.
 
Last edited by Sgt. Lulz,

redunka

Well-Known Member
Member
Joined
Nov 26, 2014
Messages
394
Trophies
1
Age
27
XP
1,585
Country
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.
 

MichMaster

#Pray4Hykem
Member
Joined
Dec 23, 2009
Messages
347
Trophies
0
Location
In the IOSU
XP
379
Country
Canada
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 >.<
 

Sgt. Lulz

Beef up
Member
Joined
Oct 16, 2010
Messages
404
Trophies
0
XP
1,207
Country
United Kingdom
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:
If someone actually bothers to implement BOSS decryption in Decrypt9 there's also https://npdl.cdn.nintendowifi.net/p01/nsa/OvbmGLZ9senvgV3K/data/allbadge_v130.dat?tm=2. Standard BOSS file, strip the header and you get the entire library of previous badges (for the US region, OvbmGLZ9senvgV3K is only the US npdl ID I believe) in a SARC. Same format that you described, most everything is Yaz0 compressed.
 
Last edited by Sgt. Lulz,
  • Like
Reactions: MichMaster

MichMaster

#Pray4Hykem
Member
Joined
Dec 23, 2009
Messages
347
Trophies
0
Location
In the IOSU
XP
379
Country
Canada
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,

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,970
Trophies
0
Age
23
Location
Las Vegas
XP
3,627
Country
United States

nanika

文鎮じゃダメ!まぁ、こんな文字小さしすぎてどうせ読めないっしょ。
Member
Joined
Apr 22, 2008
Messages
249
Trophies
0
XP
216
Country
United States
I'm trying to unpack the Badges straight from Badge Arcade's ROMFS, but I've run into a bit of a dead end trying to interpret the files.
Once unpacked, (what I presume) is the badge package is located in /region_[REGION]/common/sharc/pc.sarc.
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 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.

The actual pc.sarc file from the game seems to contain significantly more files than the savedata. Skimming over them, I can only hazard some guesses as to what some of these are:
PRBS - 1923 files - Badge files.
CRBS - 227 files - Stumped.
ICBS - 372 files - Something ID'd as 'CraneIcon_' files. No idea.
CIBS - 370 files - Not sure, seems like badge machine stuff.
FOBS - 240 files - Something to do with the badge machines themselves, apparently.
CABS - 32 files - No idea.
ATBS - 27 files - Stumped here as well.
RFIT - 1 file - Probably not important.

Totalling out to 3192 files.

If someone has any more leads, do leave a post, because most of us aren't exactly equipped to figure this stuff out.
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.

If someone actually bothers to implement BOSS decryption in Decrypt9 there's also https://npdl.cdn.nintendowifi.net/p01/nsa/OvbmGLZ9senvgV3K/data/allbadge_v130.dat?tm=2. Standard BOSS file, strip the header and you get the entire library of previous badges (for the US region, OvbmGLZ9senvgV3K is only the US npdl ID I believe) in a SARC. Same format that you described, most everything is Yaz0 compressed.
j0ITmVqVgfUxe0O8 will get you the full one.
The technical one: Having someone attempt to figure out the badge format and write a tool for it.
This would probably take a while and might be slightly more difficult than the following method, but it involves less third-party assistance.
Nah, not hard at all.
As an aside, I'm not entirely sure about just how out of date this ROMFS dump is, as the all-badge gallery at https://imgur.com/a/wcl7W marks an amount of 3552 badges, which 1923 is about 1629(!) badges shy of.
-this is definitely an outdated dump. pc.sarc updates appear to be non-cumulative, so a dump of the latest update should contain all the badge files to date.-
pc.sarc files only contain the current week's badges.
 
Last edited by nanika,

Binebina87

Well-Known Member
Member
Joined
May 27, 2013
Messages
247
Trophies
1
XP
1,073
Country
Germany
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,

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,510
Trophies
0
XP
7,310
Country
Tuvalu
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...)
don’t give up
 

Binebina87

Well-Known Member
Member
Joined
May 27, 2013
Messages
247
Trophies
1
XP
1,073
Country
Germany
don’t give up

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 :-)
 

redunka

Well-Known Member
Member
Joined
Nov 26, 2014
Messages
394
Trophies
1
Age
27
XP
1,585
Country
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

Well-Known Member
Member
Joined
May 27, 2013
Messages
247
Trophies
1
XP
1,073
Country
Germany
This sounds vaguely piracy related, so I think not.

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 :-)
 

redunka

Well-Known Member
Member
Joined
Nov 26, 2014
Messages
394
Trophies
1
Age
27
XP
1,585
Country
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.
 
  • Like
Reactions: Binebina87

Site & Scene News

General chit-chat
Help Users
  • No one is chatting at the moment.
  • kenenthk @ kenenthk:
    Nearly Christmas time so I can upset people by pulling out the divider in popcorn bins
  • kenenthk @ kenenthk:
    Cause no one likes cinnamon
  • kenenthk @ kenenthk:
    Or was it peppermint :unsure:
  • Freezer6 @ Freezer6:
    Peppermon i think
  • kenenthk @ kenenthk:
    Cheddar carmal and peppermint bins
  • Freezer6 @ Freezer6:
    Cheddar :toot::wub:
  • RichardTheKing @ RichardTheKing:
    I don't like popcorn at all; bland taste, and it got ruined for me because of high school - the school cafeteria reeked of microwave popcorn for several days...utterly revolting, couldn't even enter the place it stunk so bad.
  • RichardTheKing @ RichardTheKing:
    Nah, for movies I'd rather get a bag of lollies instead of popcorn.
  • Costello @ Costello:
    lollypops? a whole bag?
    +1
  • RichardTheKing @ RichardTheKing:
    Not lollipops; what Americans would call "candies" or just "candy" IDK. Before the pandemic, cinemas used to have buckets of different ones - sour cola, sour watermelon, and many others; I used to get a scoopful of two or three types into a paper bag to have throughout the movie.
  • kenenthk @ kenenthk:
    Pft who needs teeth
  • kenenthk @ kenenthk:
    I got liquid candy once they do so in your face dentist
  • kenenthk @ kenenthk:
    Rot*
  • s1cc @ s1cc:
    B:whip:
  • RedoLane tempBOT:
    RedoLane has left the room.
  • kenenthk tempBOT:
    kenenthk rolls 1d6 and gets 6 (6).
  • kenenthk @ kenenthk:
    Aye let's go got 6
  • The Real Jdbye @ The Real Jdbye:
    i agree popcorn is bland but caramel popcorn is really good
  • tabzer @ tabzer:
    butter soy (sauce) popcorn is the way to go
  • DinohScene @ DinohScene:
    yuck, popcorn
  • Veho @ Veho:
    Mmmm, popcorn.
  • Veho @ Veho:
    Bring on the caramel kettle corn pls.
  • HarvHouHacker @ HarvHouHacker:
    Okay, users of Vivaldi on Android: Don't toggle "Desktop Site" on GBAtemp.net. Stuff breaks.
  • ZeroT21 tempBOT:
    ZeroT21 has left the room.
  • ZeroT21 tempBOT:
    ZeroT21 has joined the room.
    ZeroT21 tempBOT: ZeroT21 has joined the room.