Tutorial  Updated

How to rebuild a Sarc with Padding

I haven't quite found an in depth tutorial on this so i figured i might as well.

Padding is often found in many files under the extensions of .szs, .sarc, .pack, and many more. If you save these file with a program like Wii U zip or some other program that repacks these without padding, your game will crash.

Instances of padding I noticed:
Wind Waker:
-permanent_3d.pack has a padding value of 0x1000
-Many map models are using a padding value of 0x2000

BOTW
-Font_EU.sbfarc has a padding value of 0x2000

SM3DW
-All Objectdata have a padding of 0x2000 I believe.

Super Mario Maker
-In model folder, most if not all have 0x2000 padding value

Splatoon 1
-In model folder, most if not all have 0x2000 padding value
-In pack folder, Player.pack uses 0x4000., System.pack 0x3000

Alright now lets figure out if a sarc needs padding, what value it needs, and where it is located in hex.


You will need:
HxD (or similar)
smb123w64gb's modified uwizard that has padding feature.
Yaz0dec

Now open your file in hex. If it shows "Yaz0" in hex then you should decompress it by dragging it into yaz0dec.exe. You can alternatively look at the padding value at 0x0A but i suggest doing this instead just in case.

Now open that output file in hex. it should say "SARC" in it on the right.

There are 4 bytes at 0x0E. This is the padding value highlighted in red and should be where your value is too.

v1VOe90.png


So this file uses a padding value of 0x2000. A file without padding generally will have either nothing but 0s or a bunch of hex numbers with no zeros. The best way to figure it out however is to resave the original sarc without padding applied and see if it works or not since there still isn't an exact way of knowing.

So we need to apply our padding value on repacking. Put all files you extracted into one folder.

wJWPXRN.png


Then we need to open Uwizard and type our padding value.

fjlDuIN.png


Click on PACK .pack (Adjustable Padding)

Then select your folder.

vAWhoGJ.png


Now save it as a .sarc.

Then reopen it in hex.

LHFyiMM.png


The value should remain the same as before. This means it worked!

If your file was previously Yaz0 compressed, re-compress it with this (made by smb123w64gb).

And lastly rename your files with extensions as they were originally.
In this case mine was Font_EU.sbfarc.
 
Last edited by KillzXGaming,
D

Deleted User

Guest
Great tutorial. I used to repack SARC incorrectly lol. I'mma try getting custom BFLYT layout position working on Super Mario 3D World.
 

shadster

Member
Newcomer
Joined
Oct 17, 2009
Messages
18
Trophies
0
XP
212
Country
United States
That value isn't padding, and it actually starts at 0x0C.
That declares the offset of where the beginning of the node/file data starts.
Essentially, what that padding tool does is changes all the position offsets and pads section down.

So it's related to padding, but actually just a fixed offset position where to start...
This makes things a little tedious for us programmers... but appears to be only for certain file types
Luckily the node start/end offsets go by whatever the datastart is, so easy fix.

Which makes me wonder, why Nintendo is actually wasting space by adding unnecessary padding in the first place.
Perhaps programmers ran into an issue where they needed to hardcode the data offset.
 
Last edited by shadster,

AboodXD

I hack NSMB games, and other shiz.
Member
Joined
Oct 11, 2014
Messages
2,880
Trophies
1
Location
Not under a rock.
XP
2,921
Country
United Arab Emirates
That value isn't padding, and it actually starts at 0x0C.
That declares the offset of where the beginning of the node/file data starts.
Essentially, what that padding tool does is changes all the position offsets and pads section down.

So it's related to padding, but actually just a fixed offset position where to start...
This makes things a little tedious for us programmers... but appears to be only for certain file types
Luckily the node start/end offsets go by whatever the datastart is, so easy fix.

Which makes me wonder, why Nintendo is actually wasting space by adding unnecessary padding in the first place.
Perhaps programmers ran into an issue where they needed to hardcode the data offset.
One word: alignment.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +2
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    Out of nowhere I got several scars on my forearm and part of my arm and it really itches.
  • AdRoz78 @ AdRoz78:
    Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit chip or was I scammed?
  • Veho @ Veho:
    @AdRoz78 start a thread and post a photo of the chip.
    +2
  • Xdqwerty @ Xdqwerty:
    Yawn
  • S @ salazarcosplay:
    and good morning everyone
    +1
  • K3Nv2 @ K3Nv2:
    @BakerMan, his partner is Luke
  • Sicklyboy @ Sicklyboy:
    Sup nerds
    +1
  • Flame @ Flame:
    oh hi, Sickly
  • K3Nv2 @ K3Nv2:
    Oh hi flame
  • S @ salazarcosplay:
    @K3Nv2 what was your ps4 situation
  • S @ salazarcosplay:
    did you always have a ps4 you never updated
  • S @ salazarcosplay:
    or were you able to get new ps4 tracking it \
    as soon as the hack was announced
  • S @ salazarcosplay:
    or did you have to find a used one with the lower firm ware that was not updated
  • K3Nv2 @ K3Nv2:
    I got this ps4 at launch and never updated since 9.0
  • K3Nv2 @ K3Nv2:
    You got a good chance of buying a used one and asking the seller how often they used or even ask for a Pic of fw and telling them not to update
  • RedColoredStars @ RedColoredStars:
    Speaking of PLaystation. I see Evilnat put out a beta for PS3 CFW 4.91.2 on the 22nd.
  • K3Nv2 @ K3Nv2:
    Don't really see the point in updating it tbh
    K3Nv2 @ K3Nv2: Don't really see the point in updating it tbh