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
20
Location
Does it matter ?
XP
1,166
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
691
Trophies
0
XP
2,265
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
20
Location
Does it matter ?
XP
1,166
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
691
Trophies
0
XP
2,265
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
35,320
Trophies
2
Website
trastindustries.com
XP
25,079
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
20
Location
Does it matter ?
XP
1,166
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
691
Trophies
0
XP
2,265
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
20
Location
Does it matter ?
XP
1,166
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
20
Location
Does it matter ?
XP
1,166
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.
    KenniesNewName @ KenniesNewName: +2