ROM Hack sky3ds diskwriter python clone (for linux & osx)

lukas_2511

Well-Known Member
OP
Member
Joined
Jan 4, 2015
Messages
126
Trophies
0
Age
31
XP
409
Country
Gambia, The
Bytearray definitely doesnt work for me in python3, but passing the plist string directly to loads() does.


https://docs.python.org/3/library/plistlib.html#plistlib.loads "Loads a plist from a bytes object"

Code:
Python 3.4.2 (default, Jan 12 2015, 11:38:40) 
[GCC 4.9.2 20141224 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import plistlib
>>> plistlib.loads("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/plistlib.py", line 1004, in loads
    fp = BytesIO(value)
TypeError: 'str' does not support the buffer interface

Should really be a bytearray.

And python2 equivalent function takes a string:

https://docs.python.org/2/library/plistlib.html#plistlib.readPlistFromString "Read a plist from a string."
 

NoSmokingBandit

Well-Known Member
Member
Joined
Jan 17, 2009
Messages
451
Trophies
0
XP
648
Country
United States
In disk.py, line 94 (at least in the version I have)
Code:
diskutil_output = subprocess.check_output(["diskutil", "list", "-plist", self.disk_path])
print(type(diskutil_output))

prints <class 'bytes'>

So thats good to know.

In python 2.7 it prints <type 'str'> as expected.
 

benseab23

New Member
Newbie
Joined
Feb 14, 2015
Messages
4
Trophies
0
Age
40
XP
41
Country
Clie, try my latest update. It seems to be working for me.


Benseab, it pretty much is done. Lukas got all of the functional parts done a while ago, I've just been playing around making it pretty (and testing a few mac things for him). Its super simple to use, but if you've never heard of python I can understand that it would be confusing. I'll make a mini-guide some day soon.



OK great thank you I await patiently. Cheers
 

benseab23

New Member
Newbie
Joined
Feb 14, 2015
Messages
4
Trophies
0
Age
40
XP
41
Country
Hi guys,

I'm really, really close to figuring this out for myself. The problem for me now seems to be even after I manually unmount the SD card so python can get at it, my SD card isn't formatted in a way SKY3DS is happy with - I'm getting this message:

This is not a sky3ds disk. Aborting.

Anyone able to help me with this? Whether in terminal or with the GUI I get the same problem.
 

Cliemacfr

Active Member
Newcomer
Joined
Oct 3, 2006
Messages
25
Trophies
0
XP
202
Country
France
NoSmokingBandit : Works in python3 with the change in disk.py

I have to say that the writing process is way faster under python3...

EDIT : Thanks again, I think that your fantastic job, Lukas_2511 and NoSmokingBandit, is making our Sky3ds life a nice dream.... Thanks you both.
 

NoSmokingBandit

Well-Known Member
Member
Joined
Jan 17, 2009
Messages
451
Trophies
0
XP
648
Country
United States
Hi guys,

I'm really, really close to figuring this out for myself. The problem for me now seems to be even after I manually unmount the SD card so python can get at it, my SD card isn't formatted in a way SKY3DS is happy with - I'm getting this message:

This is not a sky3ds disk. Aborting.

Anyone able to help me with this? Whether in terminal or with the GUI I get the same problem.


You shouldn't need to do anything outside of the diskwriter program. It will unmount anything necessary, format everything correctly, and mostly take care of itself.

Once the disk is formatted the disk gets mounted, but no volumes on it are since everything is basically Raw at that point and no operating system will read it directly. The code Lukas made very specifically finds out what is on the card and where, which is what allows reading/writing.

Did you get it working after Clie's suggestion?


And Clie, did you ever get any save backups working? I read somewhere that you need to cycle through all of the games on your card before it reloads the saves from the sd card correctly.
 

lukas_2511

Well-Known Member
OP
Member
Joined
Jan 4, 2015
Messages
126
Trophies
0
Age
31
XP
409
Country
Gambia, The
I suggest adding a very small game as first game on the sdcard, and every time you want to change something about games or savegames on the card switch to that game before pulling the sdcard out of the sky3ds. I have lost so many savegames because I didn't switch the game first (it seems to write it to sdcard - at least for card1 games - only when switching the game)...
 

Cliemacfr

Active Member
Newcomer
Joined
Oct 3, 2006
Messages
25
Trophies
0
XP
202
Country
France
i had a save backup working, yes with yoshi's island for example but I was unable to do it with zelda MM.
I'm not trying now because I'm to deep into the game to lose it. But I will try Lukas_2511 trick next time. I didn't try the switch thing.
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,729
Trophies
2
XP
8,537
Country
Tuvalu
lukas_2511 - very cool, thanks for this :)
i'm on a mac and so this will be useful, i was thinking of doing something similar, so i appreciate it.
so this will work fine for a complete replacement? and apart from it doesn't check for a disk limit (no real problem for me)
i can give it new template files and things? and can i give it my header for it to inject in the template?
 

lukas_2511

Well-Known Member
OP
Member
Joined
Jan 4, 2015
Messages
126
Trophies
0
Age
31
XP
409
Country
Gambia, The
lukas_2511 - very cool, thanks for this :)
i'm on a mac and so this will be useful, i was thinking of doing something similar, so i appreciate it.
so this will work fine for a complete replacement? and apart from it doesn't check for a disk limit (no real problem for me)
i can give it new template files and things? and can i give it my header for it to inject in the template?


Hey,

no problem ;)
Yea this thing can work as a complete replacement for the normal DiskWriter utility.

You can place a new template file and it will convert it to its own format automatically (still needs to be directly from sky3ds because of the unknown 16 bytes - that i assume are a cryptographic hash of some kind...).

It should now actually also check for the disk limit, both in size and number of games.

The easiest way to inject headers or at least unique ids is to use 3dz files, if the script detects that you are using a 3dz file it will automatically use the data from that file. Other than that you can create a header.bin with a unique id, but that stuff is kinda untested, and i probably won't do anything more with it.

Next to the cli interface there is also a gui version by NoSmokingBandit that I still didn't get around to merge into the repository...

Development of this thing will from now on be a lot slower since I switched to Gateway for various reasons (those freezes and savegame fuckups on sky3ds... it was enough... lost hours of gameplay... also homebrew, fuck yea).
Still want to fix (at least some) bugs (if reported properly... DON'T SEND ME EMAILS PEOPLE, USE GITHUB ISSUES!!11 ;) ), but won't add new features from now on.
If anybody wants to maintain this project, and can prove that they know what they are doing (some pull requests or something), I may add them as contributors to the repository, or even transfer the whole thing over.
 
  • Like
Reactions: cearp

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,729
Trophies
2
XP
8,537
Country
Tuvalu
that sounds good, cool that it can use .3dz :)
i have a gw for my old3ds, the sky3ds is just for my n3ds until gw release their update :)
thanks for all the hard work!
 

Chaldron

GBATemp's Official Attorney
Member
Joined
Mar 29, 2013
Messages
434
Trophies
0
Location
`Murica
XP
439
Country
United States
Hey,

no problem ;)
Yea this thing can work as a complete replacement for the normal DiskWriter utility.

You can place a new template file and it will convert it to its own format automatically (still needs to be directly from sky3ds because of the unknown 16 bytes - that i assume are a cryptographic hash of some kind...).

It should now actually also check for the disk limit, both in size and number of games.

The easiest way to inject headers or at least unique ids is to use 3dz files, if the script detects that you are using a 3dz file it will automatically use the data from that file. Other than that you can create a header.bin with a unique id, but that stuff is kinda untested, and i probably won't do anything more with it.

Next to the cli interface there is also a gui version by NoSmokingBandit that I still didn't get around to merge into the repository...

Development of this thing will from now on be a lot slower since I switched to Gateway for various reasons (those freezes and savegame fuckups on sky3ds... it was enough... lost hours of gameplay... also homebrew, fuck yea).
Still want to fix (at least some) bugs (if reported properly... DON'T SEND ME EMAILS PEOPLE, USE GITHUB ISSUES!!11 ;) ), but won't add new features from now on.
If anybody wants to maintain this project, and can prove that they know what they are doing (some pull requests or something), I may add them as contributors to the repository, or even transfer the whole thing over.


Just one question: If I've already injected the headers into my template.txt using No Ban No Sky (Windows program), will your program function normally and use those headers in the file I gave it, and thus nullify the risk of being banned? Or does it work differently?

But also, thank you very much for writing this. I've got a desktop Mac and a Windows laptop and I hate copying over GBs worth of ROMs so I can use DiskWriter on the laptop. Thanks again!
 

NoSmokingBandit

Well-Known Member
Member
Joined
Jan 17, 2009
Messages
451
Trophies
0
XP
648
Country
United States
Wooo cool thanks. I had played around with a wx interface since it looks much more native on linux window managers, but I got everything working correctly in osx, rebooted to linux to try it out and nothing worked. Its like writing html for webkit then trying to figure out why IE8 renders it like hell.

Tk works. If anyone wants to improve, go for it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Veho @ Veho:
    Nah, a hit gives them mad meth powers, but makes them more difficult to control.
    +1
  • Veho @ Veho:
    Before a hit they're like zombies, persistent but slow.
    +1
  • Veho @ Veho:
    It's a tradeoff.
    +1
  • The Real Jdbye @ The Real Jdbye:
    no i mean, before a hit is after the previous hit
    +1
  • The Real Jdbye @ The Real Jdbye:
    if you keep them well enough fed, it's the same thing
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    By the power of Florida Man, I have the power!!! *Lifts up meth pipe* Meth Man!!! lol
  • BakerMan @ BakerMan:
    Guys, I just learned my little brother is in the hospital because he had a seizure last night.
  • cearp @ cearp:
    Sorry to hear that BakerMan
    +2
  • BakerMan @ BakerMan:
    Just found out he's doing alright, doing a lot of complaining too, rightfully so. Who wouldn't complain after having a seizure and being hospitalized?
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Glad he is OK and complaining is cool :)
    +1
  • K3Nv2 @ K3Nv2:
    Yeah been there had that no fun
    +1
  • K3Nv2 @ K3Nv2:
    They'll give him sleep studies eegs and possibly one week hospital stay
    +1
  • BakerMan @ BakerMan:
    I hope it's not a week.
  • K3Nv2 @ K3Nv2:
    It's standard so doctors can get a idea about what's going on
  • BakerMan @ BakerMan:
    understood
  • BakerMan @ BakerMan:
    well, i'm glad he seems to be doing fine, and ig i'm going to start spewing goofy shit again
  • BakerMan @ BakerMan:
    Update: Turns out he's epileptic
  • K3Nv2 @ K3Nv2:
    Get a 2nd opinion run mris etc they told me that also
  • Psionic Roshambo @ Psionic Roshambo:
    Also a food allergy study would be a good idea
  • K3Nv2 @ K3Nv2:
    Turns out you can't sprinkle methamphetamine on McDonald's French fries
    +1
  • ZeroT21 @ ZeroT21:
    they wouldn't be called french fries at that point
    +1
  • ZeroT21 @ ZeroT21:
    Probably just meth fries
    +1
  • K3Nv2 @ K3Nv2:
    White fries hold up
    +1
    K3Nv2 @ K3Nv2: White fries hold up +1