Hacking Hack SXOS

jhSW

Member
Newcomer
Joined
Feb 17, 2020
Messages
10
Trophies
0
Age
23
XP
64
Country
Australia
Strange.
I tried this hack on my friend's Switch.
If the SX Loader payload is the first thing I send (either with TegraSmash or a dongle) it works but if I chainload it through hekate or argon, it boots to the SX OS bootmenu just fine but gives me a black screen after the Nintendo logo when I actually launch the CFW.
I don't have this issue on my own Switch (I have a valid license though). There I can chainload it through hekate and even from within Atmosphère with hekateBrew.

Anyone else having this chainloading issue?

I'm having similar issues but they seems to be random. If I use reboot_to_payload.nro from Atmosphere to boot into Hekate(v5.5.4) and choose Payloads/SX_Loader.bin, 50% of the time I get a black screen. When that happens I need to force shutdown and inject SX_Loader.bin from TegraRCM.
 
  • Like
Reactions: lordelan

jhSW

Member
Newcomer
Joined
Feb 17, 2020
Messages
10
Trophies
0
Age
23
XP
64
Country
Australia
Finally be able to borrow a unpatched Switch to try this out.

My few questions:

1. Are the script and file from OP updated/ latest?

2. How do you make SXOS Emunand? I have never used SXOS before.

I think the script is up to date, if you click on the zip file it says : 4/04/2021

Setting up an EmuNAND is pretty easy. Copy the boot.dat and license.dat to the root of your MicroSD card and inject SX_Loader.bin, you will need to hold VOL+ (without holding the power button) while SX is booting to access the options menu. In options you will see EmuNAND, hit the button and follow the prompts, pretty simple.

Make sure you back up your NAND before setting it up, just in case something goes wrong.
 
Last edited by jhSW,
  • Like
Reactions: tivu100

RideOnTheStorm

Well-Known Member
Newcomer
Joined
Feb 1, 2019
Messages
51
Trophies
0
Age
36
XP
319
Country
France
Strange.
I tried this hack on my friend's Switch.
If the SX Loader payload is the first thing I send (either with TegraSmash or a dongle) it works but if I chainload it through hekate or argon, it boots to the SX OS bootmenu just fine but gives me a black screen after the Nintendo logo when I actually launch the CFW.
I don't have this issue on my own Switch (I have a valid license though). There I can chainload it through hekate and even from within Atmosphère with hekateBrew.

Anyone else having this chainloading issue?

Got some trouble in this way,working on boot i tried several things when i was changing boot logo
When you boot just one time sxos (just menu or full cfw) Sd card seems to be "locked" or in some unknow state(if i go back to hekate right after menu i can't no more mount Sd to pc via hekate (but payloads are still avalaible).Talking about that with @Reacher17 when we're searching boot.dat error on reboot.
 
  • Like
Reactions: lordelan

tivu100

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
2,260
Trophies
0
Age
34
XP
1,136
Country
United States
Just a small note: that 0B after the xxxx... should not be used as fixed 0B, that byte must be taken from the fingerprint ( 05 in the case of the one I gave you ).

@Voxel I installed python 3.9 and trying this I get Crypto import error. I did pip install crypto but that gives another error... any help ? thank you...

EDIT: Got it to work ;)
Ran into this same issue. What is the alternative library you use?

Edit: NVM. Found your other post.

"In cmd, type this:

pip install pycryptodome"
 
Last edited by tivu100,
  • Like
Reactions: Inaki

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,237
@mrdude
sxos v3.1.0
payload90
addr 0x18990:0X1B100 size 0x2770
key 11F2805CC05B339A6570E58C45A0283C
ctr 72228D477C636C62B54C7A93E5147D5A

addr 0xFEA10:0XFFAB0 size 0x10A0
key 11F2805CC05B339A6570E58C45A0283C
ctr 760293F93A38B5FA67A531A449DDD9AD
Thanks very much for that info, I'm going to be out all day so I'll have a look tonight. Cheers.

EDIT: @Reacher17

I tried using those offsets on boot.dat file, extracted the relevant sections and used the keys to try to decrypt - but the data was still encrypted (or encrypted twice). Do you mean get those code sections from boot.dat of from another file?
 
Last edited by mrdude,

Inaki

Well-Known Member
Member
Joined
Jan 23, 2014
Messages
278
Trophies
0
Age
42
XP
603
Country
Finally be able to borrow a unpatched Switch to try this out.

My few questions:

1. Are the script and file from OP updated/ latest?

2. How do you make SXOS Emunand? I have never used SXOS before.
It may be late, but I may write the steps of the quickest way to go from atmosphere microsd setup with emunand 11.0.0 / 11.0.1 and all that to sx os setup with emunand with 11.0.0 / 11.0.0-1 hybrid. Even if the microsd is full of content, there's a way to move from atmosphere to sxos without having to backup, you only backup the emunand, then move the fat32 partition with minitool partition wizard and then restore the emunand ( and edit the bcpkg2 files if you have a 11.0.1 and want to hybridize it ), then you do a small trick so that SXOS recognizes the emunand ( it won't detect it if you don't do this little trick ).
 
  • Like
Reactions: f0li0 and jhSW

tivu100

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
2,260
Trophies
0
Age
34
XP
1,136
Country
United States
Anyone tried this on 1.0.0 Switch yet?

I ran into issue on the 1.0.0 Switch I borrowed. Can't boot CFW at all, either in SysNAND, or EMUNAND. Light blue screen without AutoRCM. With AutoRCM, it just kicks me back into RCM mode.

--------------------- MERGED ---------------------------

It may be late, but I may write the steps of the quickest way to go from atmosphere microsd setup with emunand 11.0.0 / 11.0.1 and all that to sx os setup with emunand with 11.0.0 / 11.0.0-1 hybrid. Even if the microsd is full of content, there's a way to move from atmosphere to sxos without having to backup, you only backup the emunand, then move the fat32 partition with minitool partition wizard and then restore the emunand ( and edit the bcpkg2 files if you have a 11.0.1 and want to hybridize it ), then you do a small trick so that SXOS recognizes the emunand ( it won't detect it if you don't do this little trick ).
I definitely want that.

Right now I am stuck with this borrowed Switch at sysNAND 1.0.0 and Atmosphere Emunand 11.0.0.

Can't boot patched SXOS on SysNAND and EMUNAND 1.0.0. I am not sure if I run the script wrong, or this patched SXOS doesn't work in 1.0.0.
 

Inaki

Well-Known Member
Member
Joined
Jan 23, 2014
Messages
278
Trophies
0
Age
42
XP
603
Country
Anyone tried this on 1.0.0 Switch yet?

I ran into issue on the 1.0.0 Switch I borrowed. Can't boot CFW at all, either in SysNAND, or EMUNAND. Light blue screen without AutoRCM. With AutoRCM, it just kicks me back into RCM mode.

--------------------- MERGED ---------------------------


I definitely want that.

Right now I am stuck with this borrowed Switch at sysNAND 1.0.0 and Atmosphere Emunand 11.0.0.

Can't boot patched SXOS on SysNAND and EMUNAND 1.0.0. I am not sure if I run the script wrong, or this patched SXOS doesn't work in 1.0.0.
Does SXOS work on fw 1.0.0, even the unpatched SXOS ? That seems like very old to me...


Goodies:

- BCPKG2 package: < removed link, please go to sthetix's twitter account and use the link there >
- EmuTool: https://github.com/TheyKilledKenny/Emutool/releases
- NxNandManager: https://github.com/eliboa/NxNandManager/releases ( I used the x64 version )
- lockpick_RCM payload to obtain your prod.keys: https://github.com/shchmue/Lockpick_RCM/releases
- Minitool Partition Wizard ( free ): https://cdn2.minitool.com/?p=pw&e=pw-free

The steps I do to convert an atmosphere style microsd to an SXOS style microsd are:

optional 0) If your emunand is 11.0.1, you need to hybridize it with replacement bcpkg2 and for that you need your prod.keys file:
- use lockpick_RCM.bin and dump keys from emunand. These are stored in sdcard:/switch/prod.keys. You can grab this and save it elsewhere, but you can use it from that location directly too.

1) Use Emutool to save the atmosphere hidden partition to an atmosphere file.

2) Use Minitool Partition Wizard ( free ) to:
- delete the hidden emunand partition and apply changes.
- move the FAT32 ( if you use exFAT you are out of luck and you will need to do the long way, copy contents, format as FAT32 and copy back, or maybe use another tool that can convert or move esFAT ) partition to the very end of the physical space. Take care to leave 29.22 GB ( or a bit more, it won't hurt ) of free space on the beginning of the physical space. And apply changes. This took a bit more than half an hour for a 400GB sdcard that was almost full, way less than doing it the long way by copying contents and restoring them and all that.

3) Use Emutool to restore the atmosphere file to the microsd as SXOS hidden partition.

4) Move the Nintendo folder found in sdcard:/emuMMC/RAW1/ to sdcard:/, that is, you have sdcard:/emuMMC/RAW1/Nintendo and you must end up having sdcard:/Nintendo

5) Rename sdcard:/Nintendo to sdcard:/Emutendo

6) Use Emutool, select sxos hidden partition emu as source and click on Activate emu button that appears below. This is needed for SXOS to detect and use the hidden emunand partition. ( Thank you @TheyKilledKenny ! ).

optional 7) if your emunand is 11.0.1, you need to hybridize it with replacement bcpkg2 by replacing the 4 partitions on the sxos style emunand:
- start NxNandManager and go to Options>Configure keyset and click Import keys from file and select the prod.keys file obtained in step 0 ( from sdcard:/switch/ or from wherever you saved it ). Make sure the key slots are filled in and clicked Save
- go to File>Open drive and select the microsd drive.
- click on BCPKG2-1-Normal-Main in Partitions pane and click on backup file icon to back it up
- click on BCPKG2-2-Normal-Sub in Partitions pane and clicked on backup file icon to back it up
- click on BCPKG2-3-SafeMode-Main in Partitions pane and clicked on backup file icon to back it up
- click on BCPKG2-4-SafeMode-Sub in Partitions pane and clicked on backup file icon to back it up
- click again on BCPKG2-1-Normal-Main in Partitions pane and click on restore file icon and select the equally named file from the package sthetix linked on his twitter and confirm
- click again on BCPKG2-2-Normal-Sub in Partitions pane and click on restore file icon and select the equally named file from the package sthetix linked on his twitter and confirm
- click again on BCPKG2-3-SafeMode-Main in Partitions pane and click on restore file icon and select the equally named file from the package sthetix linked on his twitter and confirm
- click again on BCPKG2-4-SafeMode-Sub in Partitions pane and click on restore file icon and select the equally named file from the package sthetix linked on his twitter and confirm


EDIT: Needless to remind you that making this SXOS style microsd and emunand compatible with atmosphere is quite easy, look it up here on GBATemp or elsewhere. Also, I'd recommend ending up with such a combo, so you can then easily use both OSes almost without changing the microsd layout.

EDIT2: Link to tutorial with these steps: https://gbatemp.net/threads/quickes...emunand-to-sxos-style-microsd-emunand.586474/

Good luck :)
 
Last edited by Inaki,

Inaki

Well-Known Member
Member
Joined
Jan 23, 2014
Messages
278
Trophies
0
Age
42
XP
603
Country
Cheers Inaki!

deleted. (question answered, before posting it) hate that :D
Yeah, I edited the post to remove reference to hybridization steps in another comment, I thought it was better to fit the substeps ( optional 0 and 7 ) here and adapt them to this case and in proper order and so on.

NOTE: I created a new thread with these steps as a guide in Tutorials section, it may be useful to some.
 
Last edited by Inaki,
  • Like
Reactions: jhSW

TheyKilledKenny

Well-Known Member
Member
Joined
Dec 5, 2015
Messages
115
Trophies
0
XP
814
Country
Italy
Does SXOS work on fw 1.0.0, even the unpatched SXOS ? That seems like very old to me...

The trick is to set sector 1 ( not 0 where the MBR and partition table resides, but the next one ), 512bytes, to a given value. The sector should be copied from another sxos style emunand microsd, but I give you the 512 byte values here. If you select and copy this string from here to the clipboard and you use Active@ Disk Editor ( free ) you can just click on first byte of sector 1 ( offset 512 ) then Edit menu>Allow Edit Content and then Edit>Paste and finally click on save button. With that SXOS would detect the emunand.

54584E414E44000000000000000000005465616D2058656375746572209620526F636B696E67207468652053776974636820666F726576657220616E64206265796F6E640000000000000000000000000020A4030200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

These are hex digit pairs, 512 bytes, of the sector 1 for an SX OS style microsd card, SX OS needs this in order to detect and use the emunand.

@TheyKilledKenny ( and maybe @eliboa ), you may want to give support to save/restore/create this sector 1 optionally...
This is what Emutool does when you activate sxos emunand.
Put sd in PC, start Emutool, select sxos hidden partition emu as source and click on Activate emu button that appears below. As soon as you push that button it writes sector 1 as you described above.

Ciao.
 
Last edited by TheyKilledKenny,
  • Like
Reactions: jhSW

Inaki

Well-Known Member
Member
Joined
Jan 23, 2014
Messages
278
Trophies
0
Age
42
XP
603
Country
This is what Emutool does when you activate sxos emunand.
Put sd in PC, start Emutool, select sxos hidden partition emu as source and click on Activate emu button that appears below. As soon as you push that button it writes sector 1 as you described above.

Ciao.

--------------------- MERGED ---------------------------
Oh, I didn't know that, sorry !!! Thank you. I'll update the guide :)
 
  • Like
Reactions: jhSW

Reacher17

Well-Known Member
OP
Member
Joined
Sep 18, 2019
Messages
128
Trophies
0
XP
755
Country
France
@mrdude

key = "11F2805CC05B339A6570E58C45A0283C"


#addr 0xA980:0XAA40 size 0xC0
xA980_ctr = "5D85EB382AC9C5B078F031CF5CD98C85"
#addr 0xAD90:0XC120 size 0x1390
xAD90_ctr = "A4CB0F31E24F35F52E94B9EC1EAB8593"
#addr 0x100A0:0X11400 size 0x1360
x100A0_ctr = "8A364EB237F2B0B56BAB6AAE27F952A7"
#addr 0x18990:0X1B100 size 0x2770
x18990_ctr = "72228D477C636C62B54C7A93E5147D5A"
#addr 0x215A0:0X21DE0 size 0x840
x215A0_ctr = "591519C42E9CA3FBB995E00778613E2B"
#addr 0x380F0:0X39270 size 0x1180
x380F0_ctr = "48B70527C214EF9307AE06D6E2D5532F"
#addr 0x405D0:0XFFAB0 size 0xBE1E0
x405D0_ctr = "C957567D36D146A463F1DE99887DDA03"
#addr 0xFEA10:0XFFAB0 size 0x10A0
xFEA10_ctr = "760293F93A38B5FA67A531A449DDD9AD"
 
  • Like
Reactions: chronoss

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,237
@mrdude

key = "11F2805CC05B339A6570E58C45A0283C"


#addr 0xA980:0XAA40 size 0xC0
xA980_ctr = "5D85EB382AC9C5B078F031CF5CD98C85"
#addr 0xAD90:0XC120 size 0x1390
xAD90_ctr = "A4CB0F31E24F35F52E94B9EC1EAB8593"
#addr 0x100A0:0X11400 size 0x1360
x100A0_ctr = "8A364EB237F2B0B56BAB6AAE27F952A7"
#addr 0x18990:0X1B100 size 0x2770
x18990_ctr = "72228D477C636C62B54C7A93E5147D5A"
#addr 0x215A0:0X21DE0 size 0x840
x215A0_ctr = "591519C42E9CA3FBB995E00778613E2B"
#addr 0x380F0:0X39270 size 0x1180
x380F0_ctr = "48B70527C214EF9307AE06D6E2D5532F"
#addr 0x405D0:0XFFAB0 size 0xBE1E0
x405D0_ctr = "C957567D36D146A463F1DE99887DDA03"
#addr 0xFEA10:0XFFAB0 size 0x10A0
xFEA10_ctr = "760293F93A38B5FA67A531A449DDD9AD"

@Reacher17, I appreciated the keys but what file are they for? I tried extracting the data from boot.dat at the offsets, and then decrypting using those keys but the extracted/decrypted files still look encrypted. It be helpful if you could explain what file these are to be used on. Thanks.
 

Reacher17

Well-Known Member
OP
Member
Joined
Sep 18, 2019
Messages
128
Trophies
0
XP
755
Country
France
@Reacher17, I appreciated the keys but what file are they for? I tried extracting the data from boot.dat at the offsets, and then decrypting using those keys but the extracted/decrypted files still look encrypted. It be helpful if you could explain what file these are to be used on. Thanks.
Payload90000000.bin

--------------------- MERGED ---------------------------

@mrdude
the decrypted parts must remain in pay90 and mounted in ida at the address 0x90300000
 
  • Like
Reactions: mrdude

tivu100

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
2,260
Trophies
0
Age
34
XP
1,136
Country
United States
ba2ae86e-eeb8-481c-b3c2-d585639a4e5a-jpeg.162812
I ran into an issue. When I restart the console from this SXOS, I got no boot.dat error screen. MicroSD is in FAT32 format.

Edit: NVM. Just saw @deejay87 tutorial video. This is a known bug. My bad.

How do I reboot into RCM mode for NAND, EMUNAND from SXOS, without reinjecting the payload?
 
Last edited by tivu100,

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,237
Payload90000000.bin

--------------------- MERGED ---------------------------

@mrdude
the decrypted parts must remain in pay90 and mounted in ida at the address 0x90300000
Thanks, I'll take a look tomorrow. Also I saw on that discord channel some of you were trying to get sdl rotation working. There's some errors in your c file, I've attached a fixed file so you can display the font properly.
 

Attachments

  • sdl-rotation.zip
    21.4 KB · Views: 148
  • Like
Reactions: lordelan

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @Sonic Angel Knight, Meth cake lol