Hacking Official [Release] CakesFW

Krude

Well-Known Member
Member
Joined
May 18, 2013
Messages
344
Trophies
0
XP
1,208
Country
Gambia, The
Loading decrypted firm files is excellent news, it's a PITA to find an encrypted 9.0 N3DS firm for when you want to boot an exploitable firmware.

Really looking forward to the next stable release now.
 
  • Like
Reactions: mid-kid

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
54
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,857
Country
Belgium
You can use dd and a certain offset (can't remember it at the moment, maybe someone else does) to make an arm9loaderhax.bin from a Cakes.dat

dd if=Cakes.dat of=arm9loaderhax.bin bs=512 skip=144

Offset: 0x12000

You guys are aware that build/main.bin IS the arm9loaderhax.bin, right? dd isn't needed if you're building from upstream source code. Just copy that.

So true and most easy to use ;)

Or just add this to the Makefile

all: arm9loaderhax.bin

arm9loaderhax.bin: $(dir_build)/main.bin
@cp -av $(dir_build)/main.bin $@

Simplifies running 'make' and 'copy arm-TAB g:' :P

Alternatively, 'cp arm9* /media/<user>/<disk>' for people like me.
Or just use xcopy like i do (if building yourself from git)

xcopy "%dir%\CakesForeveryWan\build\main.bin" "%dir%\CakesForeveryWan\out\arm9loaderhax.bin*"

Else the dd command is the best solution :) (put it in a batch file)

Example: "a9lhcakes.bat" -> put it in the same folder as your "cakes.dat"
- If arm9loaderhax.bin file is found the program will tell you and stop
- If cakes.dat file is found it will create arm9loaderhax.bin from cakes.dat
- If no cakes.dat file is found, batch file will tell you and say it needs to be in the same folder as cakes.dat.
Code:
@echo off
cls
if exist "arm9loaderhax.bin" (
echo.
echo You already have an arm9loaderhax.bin file!
echo.
pause >nul
GOTO EOF
)
if exist "cakes.dat" (
dd if=Cakes.dat of=arm9loaderhax.bin bs=512 skip=144
) else (
echo.
echo Put this batch file in the same folder as your cakes.dat
echo.
pause >nul
GOTO EOF
)
echo.
echo Done! arm9loaderhax.bin is now in your folder
echo.
pause >nul
It's quick and dirty script, i bet a way experienced scripter will do it with less lines :)
 
Last edited by DjoeN,
  • Like
Reactions: A_Random_Guy

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
54
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,857
Country
Belgium
I was bored, so i cleaned up and made the batch script bigger!

So if you are on a Windows computer you or lucky!
Use this batch script to get "arm9loaderhax.bin" for CakesFW

How to use!
- Run the batch file and read
- For those that don't want to read the batch output! try to read the next lines!

- IF you build CakesFW yourself
--- Put this batch file in the same folder as your "CakesForeveryWan" folder (see screenshot)
---and select option "1"

cakes01.png


- IF you don't build yourself, (Downloaded a build version)
--- Put this batch file in the same folder as your "Cakes.dat" (see screenshot)
---and select option "2"
cakes02.png


- IF you don't know what this is for or you don't want it
--- Run it and choose option "3"

- IF you already have "arm9loaderhax.bin" in your folder
--- Try me if you dare!

That's it

- Ow, if you build yourself, the script will check if you have a CakesForeveryWan folder and if you have a main.bin file in the build folder
(yes it will also check if you already have an "arm9loaderhax.bin" file in your cakes folder :) )

Happy A9LH Cakes running!

Right i forgot!
Here's the script! -> put it in a file and rename it whatever you like. For example: "GetCakesA9LH.bat"
Code:
@echo off
cls
Title = Get arm9loaderhax.bin for CakesFW!

:MENU
cls
COLOR B
ECHO.
ECHO.
ECHO .....................................
ECHO . Get arm9loaderhax.bin for CakesFW .
ECHO .....................................
ECHO.
ECHO 1 - I BUILD MYSELF GET ME A9LH
ECHO .............................................................................
ECHO . If you build yourself!                                                    .
ECHO . Put this batch file in the same folder as your CakesForeveryWan folder!!! .
ECHO . Then use option "1"                                                       .
ECHO .............................................................................
ECHO.
ECHO 2 - I DON'T BUILD MYSELF! GET ME A9LH
ECHO ..................................................................
ECHO If you don't build yourself!                                     .
ECHO Put this batch file in the same folder as your Cakes.dat file!!! .
ECHO Then use option "2"                                              .
ECHO ..................................................................
ECHO.
ECHO 3 - I DON'T WANT IT, GET ME OUT OF HERE!
ECHO ........................................................................
ECHO If you wonder what you're doing here! Then get the Hell out of here!   .
ECHO If you don't want to, same rule as above!                              .
ECHO I need to place this batch file in the right spot! Get me out of here! .
ECHO Use option "3"                                                         .
ECHO ........................................................................
ECHO.
ECHO.
choice /C 123 /M "Enter your choice then press ENTER:"
IF ERRORLEVEL 3 GOTO EOF
IF ERRORLEVEL 2 GOTO ARM9
IF ERRORLEVEL 1 GOTO A9LH

:A9LH
cls
%~d0
cd %~dp0
COLOR E
if not exist "CakesForeveryWan" (
    echo.
    echo Sorry NO CakesForeveryWan folder found!
    echo.
    echo Hit ANY key to exit!
    pause >nul
    goto EOF
) else (
cd CakesForeveryWan\out\
)
if exist "arm9loaderhax.bin" (
    echo.
    echo You already have an arm9loaderhax.bin file!
    echo.
    echo Hit ANY key to exit!
    pause >nul
    goto EOF
)
cd %~dp0\CakesForeveryWan\build\
if not exist "main.bin" (
    echo.
    echo You adon't seem to have a "main.bin" file in your build folder!
    echo.
    echo Hit ANY key to exit!
    pause >nul
    goto EOF
)
xcopy %~dp0\CakesForeveryWan\build\main.bin %~dp0\CakesForeveryWan\out\arm9loaderhax.bin*
echo.
echo main.bin copied to arm9loaderhax.bin and placed in the out folder...
echo.
COLOR A
echo.
echo Done! arm9loaderhax.bin is now in your folder
echo.
pause >nul
goto EOF

:ARM9
cls
COLOR E
if exist "arm9loaderhax.bin" (
    echo.
    echo You already have an arm9loaderhax.bin file!
    echo.
    pause >nul
    GOTO EOF
)
if exist "cakes.dat" (
    dd if=Cakes.dat of=arm9loaderhax.bin bs=512 skip=144
) else (
    echo.
    echo Put this batch file in the same folder as your cakes.dat
    echo Then rerun the batch file!
    echo.
    pause >nul
    GOTO EOF
)
COLOR A
echo.
echo Done! arm9loaderhax.bin is now in your folder
echo.
pause >nul

:EOF
 
Last edited by DjoeN,

Wolfvak

nyaa~
Member
Joined
Oct 25, 2015
Messages
918
Trophies
1
XP
3,486
Country
Uruguay
I don't get it... why are you extracting the payload? As chaoskagami has already said, it is *exactly* the same as main.bin in the build folder.
Wouldn't it be easier to just add my snippet to the Makefile, rather than running dd to extract something you already have?

It's almost like compressing a file and keeping the original, but to obtain the original you have to decompress it rather than copy the original to where you want.

EDIT: Nevermind, this is for users who have Cakes.dat but not the source
 
Last edited by Wolfvak,
  • Like
Reactions: DjoeN

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
54
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,857
Country
Belgium
I don't get it... why are you extracting the payload? As chaoskagami has already said, it is *exactly* the same as main.bin in the build folder.
Wouldn't it be easier to just add my snippet to the Makefile, rather than running dd to extract something you already have?

It's almost like compressing a file and keeping the original, but to obtain the original you have to decompress it rather than copy the original to where you want.
That's why i explain it!
IF you don't build yourself! You don't have a main.bin file or a makefile

Like said i was bored and it was funny :)
It's for the lazy ones (like me) (Ok, i build myself ;) , i don't need this thing ;) )

[EDIT]
Indeed, but it's also for builders (Option 1) and non builders (Option 2) and even people who don't use CakesFW (Option 3 :D )
 
Last edited by DjoeN,
  • Like
Reactions: Wolfvak

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Loading decrypted firm files is excellent news, it's a PITA to find an encrypted 9.0 N3DS firm for when you want to boot an exploitable firmware.

Really looking forward to the next stable release now.

I'm actually super glad mid-kid contacted me and that I got those changes merged. It should handle incomplete decryptions with the arm9 segment still encrypted on newer 9.6+ firmware too (which are how Luma/Cosmo handle it, afaik) ReiNand's firmware.bin still won't work because of memekey.
 

GothicIII

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
831
Trophies
0
Age
36
XP
2,240
Country
Gambia, The
Loading decrypted firm files is excellent news, it's a PITA to find an encrypted 9.0 N3DS firm for when you want to boot an exploitable firmware.

This is so untrue. All you need is ctrtool, the fw files and the parameter meta=meta (with a few more). This will extract an encrypted version of the firmware.bin.
This is just not common knowledge. So it's not 'PITA'
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
This is so untrue. All you need is ctrtool, the fw files and the parameter meta=meta (with a few more). This will extract an encrypted version of the firmware.bin.
This is just not common knowledge. So it's not 'PITA'

Well, to the average user who doesn't understand how to operate developer tools, it is a PITA. I've extracted firmware that way before. But you've probably already gone over most average user's heads there by lack of exact commands. Most users do not understand how to operate ctrtool directly, even. :/

Anyways, there's other good reasons for decrypted firmware support including manual sysmodule injection, interopability, and a slight load speed increase from not having to decrypt. Either way, it's a useful feature to have.

I just hope mid-kid can get around to #40 eventually.
 

Krude

Well-Known Member
Member
Joined
May 18, 2013
Messages
344
Trophies
0
XP
1,208
Country
Gambia, The
This is so untrue. All you need is ctrtool, the fw files and the parameter meta=meta (with a few more). This will extract an encrypted version of the firmware.bin.
This is just not common knowledge. So it's not 'PITA'

Well yeah, but you also need the cetk to boot the encrypted firmware with Cakes, and AFAIK you can only get that cetk from the NUS. (Or not anymore, since the 9.0 cetk isn't on the servers anymore)

I'd love to be proven wrong if you can show me some way of getting the 9.0 cetk out of an update CIA or something.
 

mid-kid

GBAtemp spamBOT
OP
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
25
XP
1,163
Country
Well yeah, but you also need the cetk to boot the encrypted firmware with Cakes, and AFAIK you can only get that cetk from the NUS. (Or not anymore, since the 9.0 cetk isn't on the servers anymore)

I'd love to be proven wrong if you can show me some way of getting the 9.0 cetk out of an update CIA or something.

The CETK is the same for all firmwares (the only difference being between n3ds and o3ds firmwares). I have no idea why it's such a common misconception.

Also, I'm sorry for my sudden absence for a while, I've been dealing with IRL shit, and I'm pretty demotivated overall right now.
I'm still working on this, but even slower than I used to. I hope I can pick up again at some point.
 
Last edited by mid-kid,

pbanj

The "friendly" neighborhood sandwich
Member
Joined
Dec 29, 2014
Messages
2,750
Trophies
1
Location
in a ziploc
Website
pbanjin.space
XP
1,671
Country
United States
The CETK is the same for all firmwares (the only difference being between n3ds and o3ds firmwares). I have no idea why it's such a common misconception.

Also, I'm sorry for my sudden absence for a while, I've been dealing with IRL shit, and I'm pretty demotivated overall right now.
I'm still working on this, but even slower than I used to. I hope I can pick up again at some point.
Real life comes first, take your time.
 

The Catboy

GBAtemp Official Catboy™: Boywife
Member
Joined
Sep 13, 2009
Messages
27,984
Trophies
4
Location
Making a non-binary fuss
XP
39,501
Country
Antarctica
The CETK is the same for all firmwares (the only difference being between n3ds and o3ds firmwares). I have no idea why it's such a common misconception.

Also, I'm sorry for my sudden absence for a while, I've been dealing with IRL shit, and I'm pretty demotivated overall right now.
I'm still working on this, but even slower than I used to. I hope I can pick up again at some point.
Don't push yourself for us. We know you are still working on this project and we can wait for you.
Real life comes before this project, take care of yourself first.
 
  • Like
Reactions: matpower and pbanj

Krude

Well-Known Member
Member
Joined
May 18, 2013
Messages
344
Trophies
0
XP
1,208
Country
Gambia, The
The CETK is the same for all firmwares (the only difference being between n3ds and o3ds firmwares). I have no idea why it's such a common misconception.

Also, I'm sorry for my sudden absence for a while, I've been dealing with IRL shit, and I'm pretty demotivated overall right now.
I'm still working on this, but even slower than I used to. I hope I can pick up again at some point.

Hm, I could've sworn i compared the CETKs from the firmwares i actually had (9.6.0+) at some point when i was looking for a way to boot 9.0 FIRMm and they had different CRCs. I admit i never actually tried booting with a CETK from a newer firmware.

But i just checked again, and now the CETKs come up with the same hashes. *shrug* Well, that takes care of that fringe problem at least!


edit: actually wait, i found the problem. The CETKs i have for 9.6.0, 10.0.0 and 10.4.0 FIRMs have the same CRC, but the one for 10.2.0 is different. I probably only checked the two newest ones i had and concluded every firm must have their own unique CETK. That's weird.
 
Last edited by Krude,

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
The CETK is the same for all firmwares (the only difference being between n3ds and o3ds firmwares). I have no idea why it's such a common misconception.

Also, I'm sorry for my sudden absence for a while, I've been dealing with IRL shit, and I'm pretty demotivated overall right now.
I'm still working on this, but even slower than I used to. I hope I can pick up again at some point.

Take your time, and have fun with stuff. RL is crap sometimes (I know, trust me.)

Until I finish coding my own CFW someday[1], I'll continue using cakes as my main since it's well designed, cleanly coded, and extensible - rather than a stack of hacks like most ReiNAND derivatives (looking at you, Luma.)

[1] Someday, as in: When half-life 3 comes out . Read: probably never.
 

Halvorsen

Well-Known Member
Member
Joined
Aug 12, 2015
Messages
2,060
Trophies
0
Website
halcove.com
XP
1,891
Country
United States
Hey, just started using the arm9loaderhax build.
I downloaded the firmware.bin and cekt, but the cekt won't decrypt correctly.
I removed the .bin extension. I suspect this was discussed earlier, but scrolling past the last three pages I'm writing this. New 3DS btw
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    You need to setup a time lapse camera, be neat
  • BigOnYa @ BigOnYa:
    I actually use a pic of it on my pc desktop cause its cool looking
  • Xdqwerty @ Xdqwerty:
    Apparently the pro versión of pizza boy is back aswell
  • Xdqwerty @ Xdqwerty:
    Gonna download the update
  • Xdqwerty @ Xdqwerty:
    Only 2 antiviruses detected the APK as a virus on virustotal so it Must be safe
  • Xdqwerty @ Xdqwerty:
    Cuz false positive
  • Xdqwerty @ Xdqwerty:
    Wait
  • Xdqwerty @ Xdqwerty:
    Eh nvm
  • BakerMan @ BakerMan:
    sadly, the clouds are setting in now

    hey BigOnYa the clouds are coming from the south, maybe check again
  • Xdqwerty @ Xdqwerty:
    Good night it's 11 pm
  • BakerMan @ BakerMan:
    night
  • BigOnYa @ BigOnYa:
    @BakerMan Nuh I'm in for the night playing Fallout 4, ill look tomorrow night
  • BigOnYa @ BigOnYa:
    Ok had let dog out, and yea still can't see it, oh well. Maybe tom night.
  • K3Nv2 @ K3Nv2:
    Ballocks these drives aren't allowing raid
  • BigOnYa @ BigOnYa:
    That sucks, well you will get double the space then atleast.
  • K3Nv2 @ K3Nv2:
    @Sicklyboy needs to come back
  • BigOnYa @ BigOnYa:
    Did you try Raid 10?
  • K3Nv2 @ K3Nv2:
    I did raid69
  • K3Nv2 @ K3Nv2:
    The physical disk keeps disabling in bios
  • BakerMan @ BakerMan:
    hey ken did you see the aurora tonight?
  • BakerMan @ BakerMan:
    also sorry it was too cloudy, that sucks
  • SylverReZ @ SylverReZ:
    @K3Nv2, This chat is sponsored by Raid Shadow Legends.
  • K3Nv2 @ K3Nv2:
    So I guess raid0 doesn't allow mismatched storage oh well
    +1
  • K3Nv2 @ K3Nv2:
    In other news GeForce experience is still shit
    K3Nv2 @ K3Nv2: In other news GeForce experience is still shit