Hacking Any program to extract a lot of SARC at once ?

Mat37

Well-Known Member
OP
Member
Joined
Dec 3, 2016
Messages
790
Trophies
0
Age
21
Location
Does it matter ?
XP
1,279
Country
France
As the title says. To be more specific, i want to extract BotW SARC, i tried Wiimm SZS Tool, but it doesn't works with these files i guess.
I know There are python tools, but doing a command line including "*.sarc" doesn't work with these tools. And i don't want to drag and drop files one by one.
 

dojafoja

life elevated
Member
Joined
Jan 2, 2014
Messages
696
Trophies
0
XP
2,480
Country
As the title says. To be more specific, i want to extract BotW SARC, i tried Wiimm SZS Tool, but it doesn't works with these files i guess.
I know There are python tools, but doing a command line including "*.sarc" doesn't work with these tools. And i don't want to drag and drop files one by one.
I was bored and came across your post here. I reworked SARCExtract, which is a Python tool originally done by @NWPlayer123. For my base I actually used a version of this script that was updated by @AboodXD . I added support for passing in multiple file names/paths as well as support for using wildcards like *.szs. You can also drag and drop any number of files onto the script at once. From the command line you can do things like:
Code:
SARCExtract.py archive1.szs d:\downloads\game\*.szs c:\game2\*.szs archive2.szs
Anytime a filename is given without a path prefix, the program will look in the folder from which it was run.
Here is the thing, I haven't actually tested it on anything other than 'dummy' files but it should work without problems since I didn't modify any code relating to the actual extraction. I only modified how they arrive to that point. Could you please test this in a real world situation and verify everything is working? I would very much appreciate that. I have also only 'tested' this on Windows 10 and Linux Mint and have no way of testing how it behaves on a Mac.

Download it from my Github here and check out the README for it's full usage: https://github.com/dojafoja/SARCExtract
 
  • Like
Reactions: Mat37

Mat37

Well-Known Member
OP
Member
Joined
Dec 3, 2016
Messages
790
Trophies
0
Age
21
Location
Does it matter ?
XP
1,279
Country
France
A big thank you !!
I was doing a bat file for with every filename .. but there are 7200. I was nearly finished and you released this ^^
The 1st time i used your tool idk why the wildcards wasn't working but now it does. So just .. thanks :P
 

dojafoja

life elevated
Member
Joined
Jan 2, 2014
Messages
696
Trophies
0
XP
2,480
Country
A big thank you !!
I was doing a bat file for with every filename .. but there are 7200. I was nearly finished and you released this ^^
The 1st time i used your tool idk why the wildcards wasn't working but now it does. So just .. thanks :P
Do you remember the error when it didn't work with wildcards? That happened to me once and hasn't happened since ago I can't pinpoint it. There was also an error when creating folders while using wildcards but I fixed that in a recent commit.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,348
Trophies
3
XP
27,316
Country
United Kingdom
"bat file with every file name"?

If on windows and as ever its wildcard options being suspect then
Go to the directory in question
dir /s >>a.txt
It will make a file called a.txt with a list of names (plus a.txt).
You can use this with a spreadsheet (as the rest of the command is going to be similar you can just do one and use the fill command for the rest).
Paste back into text file and save as .bat
 
  • Like
Reactions: dojafoja

Mat37

Well-Known Member
OP
Member
Joined
Dec 3, 2016
Messages
790
Trophies
0
Age
21
Location
Does it matter ?
XP
1,279
Country
France
Do you remember the error when it didn't work with wildcards? That happened to me once and hasn't happened since ago I can't pinpoint it. There was also an error when creating folders while using wildcards but I fixed that in a recent commit.
Sorry i don't remember, i wanted to screenshot it, so i ran the command again but this time it worked.
"bat file with every file name"?

If on windows and as ever its wildcard options being suspect then
Go to the directory in question
dir /s >>a.txt
It will make a file called a.txt with a list of names (plus a.txt).
You can use this with a spreadsheet (as the rest of the command is going to be similar you can just do one and use the fill command for the rest).
Paste back into text file and save as .bat
Didn't know about that ^^ i will remember it for later, thank :P
Some filenames were faster to write since i just had to copy paste the name like 20 times and change a number but it's still long
 

dojafoja

life elevated
Member
Joined
Jan 2, 2014
Messages
696
Trophies
0
XP
2,480
Country
Sorry i don't remember, i wanted to screenshot it, so i ran the command again but this time it worked.

Was it the very first tine the program was run? When it happened to me it happened on the very first run and now it works 100% of the time. I don't know why it would only happen the first time but that seems to be the case. I will check more into it on multiple PC's to see if that's the common problem. It's hard to debug when I can't get it to reproduce lol. Do you by chance remember if there was a strange looking path in the error that had an incorrect slash? Kind of like this:
Code:
C:\game\/*.*
That's what I remember seeing but I'm using Pythons built in os.path.join() which is suppose to combine paths in an "OS intelligent" way.
 

Mat37

Well-Known Member
OP
Member
Joined
Dec 3, 2016
Messages
790
Trophies
0
Age
21
Location
Does it matter ?
XP
1,279
Country
France
Was it the very first tine the program was run? When it happened to me it happened on the very first run and now it works 100% of the time. I don't know why it would only happen the first time but that seems to be the case. I will check more into it on multiple PC's to see if that's the common problem. It's hard to debug when I can't get it to reproduce lol. Do you by chance remember if there was a strange looking path in the error that had an incorrect slash? Kind of like this:
Code:
C:\game\/*.*
That's what I remember seeing but I'm using Pythons built in os.path.join() which is suppose to combine paths in an "OS intelligent" way.
Yes it was the very first time running the program. And i remember in the error a path like this "C:\game\\*.sarc" with the error "No such file or directory"
 

NWPlayer123

Well-Known Member
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States

Mat37

Well-Known Member
OP
Member
Joined
Dec 3, 2016
Messages
790
Trophies
0
Age
21
Location
Does it matter ?
XP
1,279
Country
France
oh lmao I rewrote it to be slightly less terrible here @dojafoja https://gist.github.com/NWPlayer123/97906c810d38b25b5d07358cb7e01d6c
here's one that goes through all of them in a directory @Mat37 https://gist.github.com/NWPlayer123/503934b4d029af7d0449e6b8dc646d63
should work with both big endian and little endian so Switch, 3DS, and Wii U should work
Thank you ! I'll give it a try. As you've linked to what's actually in the file, all i have to do is copy it, paste in notepad++ and save it as .py, right ?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Will you give me mouth to mouth oxygen if my throat closes?
  • K3N1 @ K3N1:
    Nah the air can do that
  • K3N1 @ K3N1:
    Ask @x65943 he's trained for that stuff
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
    A @ abraarukuk: hi guys