Hacking Question Can you copy your EmuNAND to your SysNAND?

benfah

Member
OP
Newcomer
Joined
Jun 23, 2019
Messages
9
Trophies
0
Age
21
Website
github.com
XP
312
Country
Germany
Hello guys,
I'm currently facing a problem, that my SysNAND is bricked and I'm missing BOOT1.bin to restore my nand, yet my EmuNAND is intact. So, is there currently any way to Copy your EmuNAND to your SysNAND?

Thanks in advance,
benfah :)

Edit: I was able to restore my nand backup, because I made a backup of my BOOT0/1 and used the BOOT1 from the fresh backup with the BOOT0 of my old backup.
 
Last edited by benfah,

ksanislo

Well-Known Member
Member
Joined
Feb 23, 2016
Messages
386
Trophies
0
Location
Seattle, WA
XP
512
Country
United States
In case someone else needs this still, you can use the following bash script on a Mac or Linux computer to extract an emuMMC partition into files that can be restored to your sysMMC.


#!/bin/bash
# The device node for your sd card, yours may be different.
device=/dev/disk3

# emummc_sector from your .ini in decimal, not hex. 0x2 == 2 is the default SX location.
offset=2

#################################################################
# These values shouldn't change unless there's new hardware revision with a different size internal storage.
# All of these are in bytes.
sectorsize=512
nandsize=31276924928
maxsize=2147483648
bootsize=4194304

# The position is counted in sectors, not bytes.
position=0

# Dump our BOOT0 file
dd bs=${sectorsize} if=${device} of=BOOT0 skip=$(( ${offset} + ${position} )) count=$(( ${bootsize}/${sectorsize} ))
position=$(( ${position} + ${bootsize}/${sectorsize} ))

# Dump our BOOT1 file
dd bs=${sectorsize} if=${device} of=BOOT1 skip=$(( ${offset} + ${position} )) count=$(( ${bootsize}/${sectorsize} ))
position=$(( ${position} + ${bootsize}/${sectorsize} ))

# This loops over the rest and dumps the rawnand.bin.* files
while [ ${position} -lt $(( ${nandsize}/${sectorsize} )) ] ; do
if [ $(( ${position} + ${maxsize}/${sectorsize} )) -gt $(( ${nandsize}/${sectorsize} )) ] ; then
sectors=$(( ${nandsize}/${sectorsize} - ${position} ))
else
sectors=$(( ${maxsize}/${sectorsize} ))
fi

filename=$( printf "rawnand.bin.%02d" $(( (${position} - ${bootsize}/${sectorsize} * 2) / (${maxsize}/${sectorsize}) )) )

dd bs=${sectorsize} if=${device} of=${filename} skip=$(( ${offset} + ${position} )) count=${sectors}
position=$(( ${position} + ${sectors} ))
done
 
  • Like
Reactions: benfah and thaikhoa

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Cool. Same here.