ROM Hack RELEASE EmuTool - Move partition Emu on another SD, Switch Emu type on SXOS and more

TheyKilledKenny

Well-Known Member
OP
Member
Joined
Dec 5, 2015
Messages
112
Trophies
0
XP
748
Country
Italy
EmuTool
Move, Copy, Convert, Backup and Restore your SXOS and Atmosphere Emunand/emuMMC.

upload_2019-11-18_20-25-34.png

(Art by @CrazyKing93)​

(Emunand or emuMMC are the same concept, below will be referred to simply as Emu)

Italian language guide here
For support in Italian or a little bit of English you can reach me on Telegram group http://t.me/gamesandconsoleschat

Warning!

Antivirus program can block and delete EmuTools.
EmuTool uses these functions of Windows Kernel32: CreateFile, CloseHandle, DeviceIoControl, SetFilePointer, ReadFile, GetFileSize, WriteFile, FlushFileBuffer, LockFile, UnlockFile
Check source code in second post if you need.


1. What is it for?

  • Move the Hidden partition Emu (Atmosphere\SXOS) on a new (bigger?) SD
  • For SXOS it allows to switch from Emu on partition mode to Emu on file and vice versa, so you can have two Emunand on the same SD card.
  • Change your Emu format from Atmosphere to SX OS and viceversa and from Hidden partition Emu to Emu on file
  • Backup and restore of every type of Emu.
  • Create a new Emu (for experiments?) starting from you current Hekate/SXOS backup or from your current Emu
  • Split an Hekate backup in multiple files ready for fat32 partitions
  • Create the relevant configuration files to boot the Emu (emummc.ini, raw_based, file_based and folder structure)

The following are simple steps posted by users in this thread

Thanks to @Kazrael :
Okay I finally got it to work so I'm going to post my process here in case anyone was confused about the steps for EmuTool that were initially posted or were running into partition issues with Hekate.


A brief explanation on why I did this in case someone is in the same predicament.

I was trying to upgrade my SD card to a larger size and during the process I accidently updated my switch to the new OFW 11.0.1, Since SXOS still hasn't come out with a new boot.dat file for Nintendo's newest firmware update I needed to transfer my old emunand and boot.dat on an old SD card (which I was using back on CFW 10.0.2) to my new SD card. Keep in mind I run SXOS so if you are not running SXOS most of these steps will not work for you.


Also, if you are doing this because you accidently upgraded to the latest firmware and you want to restore your emunand, this process will only allow you to boot into CFW, I never use OFW anyway so I personally don't mind but if you are looking for a way to boot into OFW through SXOS without performing a genuine boot you may need to wait until SXOS comes out with an updated boot.dat file.


To get this to work follow these steps


Generating the emunand Files with EmuTool

(If you want to use a NAND backup to generate the new emunand you can skip to step 1 of "Preparing the New SD card".)
  1. select SXOS Hidden Partition and select the SD card you want to pull the emunand from.
  2. "Enable Partition EMU" should be selected if you have a valid emunand on the sd card.
  3. Then select SXOS File as the Target and for the destination I just picked a random folder I generated on my desktop.
  4. Start the client and once it is finished make sure all the files are generated [Boot0,Boot1 and Full.00 - Full.07]
Prepare the New SD Card
  1. Download the Free Version of MiniTool Partition Wizard
  2. Right click the current partition on the SD card and delete it.
  3. Then Right click and hit "create". Leave the Partition label blank and select "File System" and choose unformatted.
  4. Make the partition size 30GB and hit okay. It is very important that this unformatted partition is First!!
  5. Right click the second partition and hit "create" leave partition label blank and selected exFat or Fat32 as the file System.
  6. click apply
  7. Once the Partition Wizard completes the process right click the first 30GB partition we created in step 4 and click "delete". This will change the partition Type to Logical and change the Partition type ID to 0x0 without having to upgrade to a paid version of MiniTool Partition Wizard and you will also see the Used space change from 30GB to 0GB. Click Apply
Transferring the emunand files to the new SD card
  1. Open EmuTool and Select "SXOS File" as the source and locate the file on the desktop containing the emunand files previously generated in step 4 of "Generating the emunand files" (or your NAND backup files if you have a NAND backup)
  2. Then as the target select the new SD card and start the client.
  3. Once the client is finished make sure to move over the old boot.dat, license.dat and Emutendo folder to the new SD card as well.
  4. Close the client and reopen it, select "SXOS Hidden Partition" as the source and select the New SD card that you just moved the hidden partition to and make sure to select "Enable Partition EMU" if it isn't already selected.
  5. Close EmuTool and remove the SD card from the computer and test it!

These are the Steps that worked for me, I hope this helps someone else!

Thanks to @xalassa :
After 2 entinre days messing with it I finally found the right way to migrate my emunand to another micro sd for atmosphere. Probably theres a better way but I didnt found any place in the internet that explained well for a newbie. Ill try to explain but my primary language is not english sorry for any confusion.

  • For atmosphere you need to have the hidden partition be the last one instead of the first like sxos.

  • I used the tegraexplorer payload to format the new micro sd the way you need fat32+ emu
  • Then I used emutool with the original micro sd selected atmosphere hidden and the partition 1, this way you make the backup of only the hidden partition.
  • In the right side select atmosphere file and as target any folder on windows.
  • After its done you need to make a backup of the folder inside the original microsd, the partition that is visiblem put in any folder on windows.
  • Then you switch the micro sd on your pc and put the new micro sd that you want to use.
  • In the emutool you select atmosphere file, select the folder you put the emunand backup beforem you need to select the eMMc folder, and as target you select the new micro sd and partition 1 that will have the average size of 29gb.
  • After the process is done you can move the backup you made from the visible part of the other micro sd to the visible part of the new micro sd, just copy and paste it. Boot on hekate go on emummc, change emummc and click on fix raw.

I did this and it worked finally, I hope it helps anyone having the same problem as me.

Original English language guide

1. What is it for?

  • Move the Hidden partition Emu (Atmosphere\SXOS) on a new (bigger?) SD
  • For SXOS it allows to switch from Emu on partition mode to Emu on file and vice versa, so you can have two Emunand on the same SD card.
  • Change your Emu format from Atmosphere to SX OS and viceversa and from Hidden partition Emu to Emu on file
  • Backup and restore of every type of Emu.
  • Create a new Emu (for experiments?) starting from you current Hekate/SXOS backup or from your current Emu
  • Split an Hekate backup in multiple files ready for fat32 partitions
  • Create the relevant configuration files to boot the Emu (emummc.ini, raw_based, file_based and folder structure)


2. Using the Tool
To access the SD partitions run EmuTool.exe with administrator rights, it should already request it, if not please do a right click and choos Run as Administrator...
To start, double click on the EmuTool.exe file and confirm the administrative rights if necessary
EmuTool requires that you select a source (Source), ie where to read the Emu, and a destination (Target), ie where to write the copy of the Emu.
Both Source and Target support Partition and Files.
When Source and Destination are set press the Start button to start copying.
(I apologize for the UI quality. This was a tool created just for me and I wanted to keep it lightweight, free of dependencies, no installation and easily usable, as I think a tool so limited and specific should be)​

fefd4f169c294b50ab045.png




3. How to Select SD card and File
After selecting the type of Emu you want as a Source or Target, click on the "white" box with the words "Click to select SD Card" in the frame relating to the Emu type selection.
A navigation window will appear depending on the Emu type selected
In case of Partition type, the following window will appear​
2f2820ee5df6c9f967084.png
Selecting the drive containing the SD shows a list of the partitions present on the SD card.
The Sector field located at the bottom right is important.
The first value is read by emummc.ini if it is correct, check the emummc.ini file in the emummc folder of the SD card if this value is incorrect. If you are using Kosmos simply select the Emu from the emuMMC menu.
If you select a partition from the list, then the initial sector of the partition, added to the 16Mbyte offset, will be shown in the Sector field.
No partition selection for SXOS as it is fixed to 0x2 on the first patition.
If something is wrong then you can correct the value, in hex (with notation 0x as in 0x02AC2300) or in decimal (for example the value read from Minitool Partition Wizard)

Confirmed with Ok the main screen displays the data related to the Emu to read
2ddc5984d870dcf2e91c2.png


If you choose The File Type Emu the following window will appear
8332cd2bcd1ae3168afb9.png


Select the destination folder and the path will be shown on the main screen in the white box

d50f510cc9fecee6194f1.png

When everything is set as desired press Start.​


4. Enabling / disabling Emunand SXOS on partition (allows to start emunand on file)
Select Source SXOS hidden partition and click the white box to select the SD card drive. When SD is selected two new buttons will appear in the main window

299a5edf2d615d4f3db76.png


WARNING!!!
No check is made on the actual existence of Emunand, so you can enable emu on partition even if this partition does not exist.

The state of the buttons indicates the current status of Emunand on partition.
Click on "Enable Partition Emu" to enable reading the Emunand from the hidden partition.
Click on "Disable Partition Emu" to disable it. In this case the File Emunand will be loaded if there is a valid SXOS File Emunand on SD in the sxos\Emunand folder.
You can now prepare a SXOS Emunand file.
Select the SXOS File type as Target, select the SD root as the path and press Start to create a copy of your Emunand partition in Emunand file, without the need to use hard disk and without having to reload the cfw files on the SD.
EmuTool Create the sxos/Emunand folder starting from the point you choose as the destination folder. Inside the Emunand foledr you will find the Emunand files.

5. Change SD for those who have Emu on partition
To bring the Emu to the new SD there are two possibilities:
1 - Copy the Emu to file and use it in File mode (see section 6)
2 - Create a special partition of at least 30GByte on the new SD and transfer the Emu on it, however, requires the passage at point 1 (first go to section 6 and then to section 7)
6. Convert partition Emu in Emu on File
Select as Source the type of partiton Emu, Atmosphere or SXOS, you want to read/copy and then select the SD card by clicking on the white box.
Select as Target the type of Emu on file you want to get and click on the white box to select a destination path.
The Emu-related folders will be created, ready to be copied to the SD root. In the case of the Atmosphere type, the emummc.ini and file_based files are also created.
For SXOS the sxos folder is created and within it the Emunand folder is created. For Atmosphere the emuMMC folder is created, the emummc.ini file compiled and the HPE0 folder which will contain the eMMC folder with the Emu files and the file_based file needed by Kosmos\Hekate\Nyx.

Press Start to begin.
7. Transfer of the Emu to partition
Select as Source the Emu File type and select the folder that contains the Emu files, not the root folder (ie choose sxos\Emunand or emummc\HE0\eMMC folders).
Select as Target the type of partition Emu that you want to restore, in case of Atmosphere type you will also have to indicate the initial sector of the partition you created to host the Emu. Please check the other tutorial on how to create a suitable partition for emuMMC (you can use the free minitool partition software).

Press the Start button to start copying.​

6. Conclusion
For any other operation you can think of, the way to select the SD reader and browse through the folders does not change, so I guess I shouldn't bother you with unnecessary chatter ;-)

I do not offer any guarantee for the use of this software. I am a very bad programmer, so if you use EmuTool it will be at your own risk.
If using this software the processor should start like a rocket and cut your head off (Hey They killed kenny! ... You Bastard!), I'm not responsible.

With this software you can do whatever you want (copy, distribute, decompile, write the user TheyKilledKenny is idiot, etc.), but NOT SELL in any ways. If you recover even a single penny with this software you must immediately donate to charity, otherwise you are a thief.


Thanks to the user @GraFfiX420 for pointing me in the right direction with his tutorial
https://gbatemp.net/threads/moving-from-sx-os-sd-emunand-to-sd-hidden_emunand.526587/




Ciao!



Changelog:
Version 0.2.9
Fixed restore from Hekate backup file, now rawnand.bin or rawnand.bin.xx are supported as single file backup or up to 51 files splitted backup (rawnand.bin.50)
Added partition selection for Atmosphere
Minor fixes in partition selection for Atmosphere

Version 0.2.8
Solved bad starting sector report when Atmosphere hidden partition was chosen as Source
Fixed some minor bugs found during more tests

Version 0.2.7
Added a minimum of error trapping, useful to debug errors
Added partition selection, 16MByte offset will be added to the real partition start sector because Kosmos\Hekate do it when I create a new emu on partition from starting menu. Text filed is always editable to correct if needed.
Some other minor error traping and correction around.
Not solved overflow error that someone reported, maybe the error trap can be useful.

Version 0.2.6
Added different file size for Amosphere eMMC and SXOS size, it should solve some slowness problem during eMMC boot.
Trapped an overflow error during SD read at the start if not executed as Admin
Sector field for Atmosphere partition is now always editable
Changed the icon of the main form that caused crashes on some Windows7 systems.

Version 0.2.5
Test Version

Version 0.2.4
First public release
 

Attachments

  • EmuTool_v0.2.9.zip
    63.8 KB · Views: 4,522
Last edited by TheyKilledKenny,

TheyKilledKenny

Well-Known Member
OP
Member
Joined
Dec 5, 2015
Messages
112
Trophies
0
XP
748
Country
Italy
Software developed in VB6, source code here attached
Only dependencies to kernel32 were used.

Many Antivirus software recognize EmuTool as a Virus.

Some note for developers:
This tool is very simply to write for those who have the right time: find drive, read bytes from, write bytes to...
EmuTool uses these functions of Windows Kernel32: CreateFile, CloseHandle, DeviceIoControl, SetFilePointer, ReadFile, GetFileSize, WriteFile, FlushFileBuffer, LockFile, UnlockFile and this may be something antivirus don't like very much
In VB6 the Currency datatype was used for sectors number dived by 10.000, thanks to it's fixed and not floating point, because VB6 Long is limted to 32bit, so sector 1 is equal to a value of 0,0001

This software does what can already be done with a normal DD command, no real transformation is done to the data.

Added a first tentative, not yet fully working, of conversion in VB.Net 2.0 project.
Added Github repository, you can find it here

Known bug:
- In some windows installation you can get overflow error. If it keep giving overflow error, try to delete Windows Font cache as @Unkouh suggested
- Antivirus software may detect EmuTool as a Virus. Please check the source here for your peace of mind.
- If you have a big Hdd (more then 1 TB) Emutool does not find your SD drive (thanks to @impeeza)
 

Attachments

  • EmuTool_v0.2.9_SRC.zip
    44.9 KB · Views: 473
  • Emutool29_Net2.0_Tentative_Conversion.zip
    62.4 KB · Views: 405
Last edited by TheyKilledKenny,
  • Like
Reactions: leerz and lisko

TheyKilledKenny

Well-Known Member
OP
Member
Joined
Dec 5, 2015
Messages
112
Trophies
0
XP
748
Country
Italy
So this tool will let me copy an SXOS emunand partition to a new sd card? Wasnt there something about the first1024 bytes that SXOS reads from the card? Does this tool take care of that?

https://gbatemp.net/threads/moving-from-sx-os-sd-emunand-to-sd-hidden_emunand.526587/page-2
Thanks for reminding me where I started with the idea, so I could add a reference to that post.

This is exactly what the enable and disable partition Emu buttons do.
Not the entire 1024 bytes, but only the first 84 bytes of the second sector (0x1) that is the relevant part for sxos.
If you click on Disable, all 84 bytes are written to 0, if you click on Enable, the TX 84 bytes are written...
 
Last edited by TheyKilledKenny,
  • Like
Reactions: eco95

Alchemy_Gaming

Active Member
Newcomer
Joined
Mar 11, 2019
Messages
32
Trophies
0
Age
31
XP
198
Country
United States
Software developed in VB6, source code available on request
Only dependencies of win32 were used.

This software does what can already be done with a normal DD command, no real transformation is done to the data.

Known bug:
- need to align Atmosphere emuMMC files to 4MB, maybe this solves the booting slowness for atmosphere Emu on file.
I’d like to request the source please :)
 

TheyKilledKenny

Well-Known Member
OP
Member
Joined
Dec 5, 2015
Messages
112
Trophies
0
XP
748
Country
Italy
run time error '6' Overflow in visual basic 6.0
Did you succeed in starting EmuTool in Admin mode?

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

still same error with admin mode
windows7 x64
Ok, Win7 64Bit.

I need to check. I have only a Win7 32bit, I'm going to find a 64bit one.
 
  • Like
Reactions: eco95 and yyoossk

TheyKilledKenny

Well-Known Member
OP
Member
Joined
Dec 5, 2015
Messages
112
Trophies
0
XP
748
Country
Italy
Yep, the same error as yyoossk said, at the very startup, with Admin mode too:

In the attached Zip you can find 2 Exe file.
They are the same version, but one with an embedded manifest to force Admin mode.
Without changing the name of the exe files, can you please try to execute both one at a time as Admin and see what happen?

Unfortunately the error not caught is the initial reading of the SD to check if there is an SX partition, so if the software is not able to read from SD card can be a problem.

This new version have the error trapped, so we can see if the error is the same.

Thank you for your support.
 
Last edited by TheyKilledKenny,
  • Like
Reactions: eco95
General chit-chat
Help Users
    AncientBoi @ AncientBoi: [grabs my official Star Trek Disruptor] come in