Hacking Pasta CFW - A CFW that allows unsigned CIA to be installed on Old and New 3DS! (required ninjhax)

Status
Not open for further replies.

will67

Well-Known Member
Newcomer
Joined
Apr 3, 2015
Messages
58
Trophies
0
Age
52
XP
206
Country
France
Tried on a 2ds 9.2 eur no problem with firmlaunch enabled everything working good
continue testing
 

nastys

Well-Known Member
Member
Joined
Aug 5, 2014
Messages
1,732
Trophies
1
Age
26
Location
Earth
XP
1,816
Country
Italy
you can find it here. (but i'm not sure the whole firm.bin generation stuff is implemented yet ^^')
Where can I download the Mac Configurator?
Still working on it :(
I'm trying to figure out what this piece of code does exactly (part 1 done).
Code:
progressBar1.Value = 5;
            textBox3.Text = null;
            // ---------------- PART1: DOWNLOAD FILES ------------------
            WebClient downloader = new WebClient();
            string file1_url;
            string file2_url;
            string file3_url;
            string file4_url;
            if (comboBox2.SelectedIndex == 0) //oLD 3DS
            {
                file1_url = "http://albertosonic.bplaced.net/pasta/O3DS_file1.bin";
                file2_url = "http://albertosonic.bplaced.net/pasta/O3DS_file2.bin";
                file3_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/00000049";
                file4_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/cetk";
            }
            else //New 3DS
            {
                file1_url = "http://albertosonic.bplaced.net/pasta/N3DS_file1.bin";
                file2_url = "http://albertosonic.bplaced.net/pasta/N3DS_file2.bin";
                file3_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/0000000f";
                file4_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk";
            }

            textBox3.AppendText("Downloading file1.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file1_url, "file1.bin");

            textBox3.AppendText("Downloading file2.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file2_url, "file2.bin");

            textBox3.AppendText("Downloading file3.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file3_url, "file3.bin");

            textBox3.AppendText("Downloading file4.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file4_url, "file4.bin");

            progressBar1.Value = 10;

            //------------------------ PART 2: READ CETK ------------------------
            textBox3.AppendText("Getting the key");
            textBox3.AppendText(Environment.NewLine);

            byte[] file4_array = new byte[0x10];
            FileStream file4_stream = new FileStream("file4.bin", FileMode.Open);
            file4_stream.Seek(0x1BF, SeekOrigin.Begin);
            file4_stream.Read(file4_array, 0, 0x10);

            byte[] file1_array= new byte[0x10];
            FileStream file1_stream = new FileStream("file1.bin", FileMode.Open);
            file1_stream.Seek(0, SeekOrigin.Begin);
            file1_stream.Read(file1_array, 0, 0x10);

            byte[] key = new byte[0x10];
            for (int i = 0; i < file4_array.Length; i++)
            {
                key[i] = (byte)(file4_array[i] ^ file1_array[i]);
            }

            progressBar1.Value = 30;
            //----------------------- PART 3: DECRYPT FILE3.BIN ------------------
            textBox3.AppendText("Decrypting");
            textBox3.AppendText(Environment.NewLine);

            byte[] file3_array = File.ReadAllBytes("file3.bin");
            byte[] file3_dec=AES_Decrypt(file3_array, key);

            progressBar1.Value = 50;
            //----------------------- PART 4: EXEFS ------------------------------
            textBox3.AppendText("Getting EXEFS info");
            textBox3.AppendText(Environment.NewLine);

            byte[] EXEFS_offset_array = new byte[4];
            EXEFS_offset_array[0] = file3_dec[0x1A3];
            EXEFS_offset_array[1] = file3_dec[0x1A2];
            EXEFS_offset_array[2] = file3_dec[0x1A1];
            EXEFS_offset_array[3] = file3_dec[0x1A0];
            var EXEFS_offset = EXEFS_offset_array[0] << 8 | EXEFS_offset_array[1]; //TODO: DO THIS BETTER
            EXEFS_offset = EXEFS_offset << 8 | EXEFS_offset_array[2];
            EXEFS_offset = EXEFS_offset << 8 | EXEFS_offset_array[3];
            EXEFS_offset *= 0x200;

            byte[] EXEFS_size_array = new byte[4];
            EXEFS_size_array[0] = file3_dec[0x1A7];
            EXEFS_size_array[1] = file3_dec[0x1A6];
            EXEFS_size_array[2] = file3_dec[0x1A5];
            EXEFS_size_array[3] = file3_dec[0x1A4];
            var EXEFS_size = EXEFS_size_array[0] << 8 | EXEFS_size_array[1]; //TODO: DO THIS BETTER
            EXEFS_size = EXEFS_size << 8 | EXEFS_size_array[2];
            EXEFS_size = EXEFS_size << 8 | EXEFS_size_array[3];
            EXEFS_size *= 0x200;

            progressBar1.Value = 70;
            //-------------------------- PART 5: FIRM --------------------------
            textBox3.AppendText("Extracting EXEFS");
            textBox3.AppendText(Environment.NewLine);

            byte[] file2_array = new byte[EXEFS_size];
            FileStream file2_stream = new FileStream("file2.bin", FileMode.Open);
            file2_stream.Seek(0, SeekOrigin.Begin);
            file2_stream.Read(file2_array, 0, EXEFS_size);

            byte[] firm = new byte[EXEFS_size];
            for (int i = 0; i < EXEFS_size; i++)
            {
                firm[i] = (byte)(file2_array[i] ^ file3_dec[EXEFS_offset+i]);
            }
            progressBar1.Value = 90;

            textBox3.AppendText("Saving the FIRM.bin");
            textBox3.AppendText(Environment.NewLine);

            FileStream firm_writer = new FileStream(comboBox1.SelectedItem + "3ds/PastaCFW/firm.bin", FileMode.Create);
            for (int i = 0; i < EXEFS_size-0x200; i++)
            {
                firm_writer.WriteByte(firm[0x200 + i]);
            }
            firm_writer.Close();

            file4_stream.Close();
            file2_stream.Close();
            file1_stream.Close();

            File.Delete("file1.bin");
            File.Delete("file2.bin");
            File.Delete("file3.bin");
            File.Delete("file4.bin");

            progressBar1.Value = 100;
            textBox3.AppendText("DONE!");
            textBox3.AppendText(Environment.NewLine);
            MessageBox.Show("FIRM.bin downloaded!", "YEAH");
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
Still working on it :(
I'm trying to figure out what this piece of code does exactly (part 1 done).
Code:
progressBar1.Value = 5;
            textBox3.Text = null;
            // ---------------- PART1: DOWNLOAD FILES ------------------
            WebClient downloader = new WebClient();
            string file1_url;
            string file2_url;
            string file3_url;
            string file4_url;
            if (comboBox2.SelectedIndex == 0) //oLD 3DS
            {
                file1_url = "http://albertosonic.bplaced.net/pasta/O3DS_file1.bin";
                file2_url = "http://albertosonic.bplaced.net/pasta/O3DS_file2.bin";
                file3_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/00000049";
                file4_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/cetk";
            }
            else //New 3DS
            {
                file1_url = "http://albertosonic.bplaced.net/pasta/N3DS_file1.bin";
                file2_url = "http://albertosonic.bplaced.net/pasta/N3DS_file2.bin";
                file3_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/0000000f";
                file4_url = "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk";
            }

            textBox3.AppendText("Downloading file1.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file1_url, "file1.bin");

            textBox3.AppendText("Downloading file2.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file2_url, "file2.bin");

            textBox3.AppendText("Downloading file3.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file3_url, "file3.bin");

            textBox3.AppendText("Downloading file4.bin");
            textBox3.AppendText(Environment.NewLine);
            downloader.DownloadFile(file4_url, "file4.bin");

            progressBar1.Value = 10;

            //------------------------ PART 2: READ CETK ------------------------
            textBox3.AppendText("Getting the key");
            textBox3.AppendText(Environment.NewLine);

            byte[] file4_array = new byte[0x10];
            FileStream file4_stream = new FileStream("file4.bin", FileMode.Open);
            file4_stream.Seek(0x1BF, SeekOrigin.Begin);
            file4_stream.Read(file4_array, 0, 0x10);

            byte[] file1_array= new byte[0x10];
            FileStream file1_stream = new FileStream("file1.bin", FileMode.Open);
            file1_stream.Seek(0, SeekOrigin.Begin);
            file1_stream.Read(file1_array, 0, 0x10);

            byte[] key = new byte[0x10];
            for (int i = 0; i < file4_array.Length; i++)
            {
                key[i] = (byte)(file4_array[i] ^ file1_array[i]);
            }

            progressBar1.Value = 30;
            //----------------------- PART 3: DECRYPT FILE3.BIN ------------------
            textBox3.AppendText("Decrypting");
            textBox3.AppendText(Environment.NewLine);

            byte[] file3_array = File.ReadAllBytes("file3.bin");
            byte[] file3_dec=AES_Decrypt(file3_array, key);

            progressBar1.Value = 50;
            //----------------------- PART 4: EXEFS ------------------------------
            textBox3.AppendText("Getting EXEFS info");
            textBox3.AppendText(Environment.NewLine);

            byte[] EXEFS_offset_array = new byte[4];
            EXEFS_offset_array[0] = file3_dec[0x1A3];
            EXEFS_offset_array[1] = file3_dec[0x1A2];
            EXEFS_offset_array[2] = file3_dec[0x1A1];
            EXEFS_offset_array[3] = file3_dec[0x1A0];
            var EXEFS_offset = EXEFS_offset_array[0] << 8 | EXEFS_offset_array[1]; //TODO: DO THIS BETTER
            EXEFS_offset = EXEFS_offset << 8 | EXEFS_offset_array[2];
            EXEFS_offset = EXEFS_offset << 8 | EXEFS_offset_array[3];
            EXEFS_offset *= 0x200;

            byte[] EXEFS_size_array = new byte[4];
            EXEFS_size_array[0] = file3_dec[0x1A7];
            EXEFS_size_array[1] = file3_dec[0x1A6];
            EXEFS_size_array[2] = file3_dec[0x1A5];
            EXEFS_size_array[3] = file3_dec[0x1A4];
            var EXEFS_size = EXEFS_size_array[0] << 8 | EXEFS_size_array[1]; //TODO: DO THIS BETTER
            EXEFS_size = EXEFS_size << 8 | EXEFS_size_array[2];
            EXEFS_size = EXEFS_size << 8 | EXEFS_size_array[3];
            EXEFS_size *= 0x200;

            progressBar1.Value = 70;
            //-------------------------- PART 5: FIRM --------------------------
            textBox3.AppendText("Extracting EXEFS");
            textBox3.AppendText(Environment.NewLine);

            byte[] file2_array = new byte[EXEFS_size];
            FileStream file2_stream = new FileStream("file2.bin", FileMode.Open);
            file2_stream.Seek(0, SeekOrigin.Begin);
            file2_stream.Read(file2_array, 0, EXEFS_size);

            byte[] firm = new byte[EXEFS_size];
            for (int i = 0; i < EXEFS_size; i++)
            {
                firm[i] = (byte)(file2_array[i] ^ file3_dec[EXEFS_offset+i]);
            }
            progressBar1.Value = 90;

            textBox3.AppendText("Saving the FIRM.bin");
            textBox3.AppendText(Environment.NewLine);

            FileStream firm_writer = new FileStream(comboBox1.SelectedItem + "3ds/PastaCFW/firm.bin", FileMode.Create);
            for (int i = 0; i < EXEFS_size-0x200; i++)
            {
                firm_writer.WriteByte(firm[0x200 + i]);
            }
            firm_writer.Close();

            file4_stream.Close();
            file2_stream.Close();
            file1_stream.Close();

            File.Delete("file1.bin");
            File.Delete("file2.bin");
            File.Delete("file3.bin");
            File.Delete("file4.bin");

            progressBar1.Value = 100;
            textBox3.AppendText("DONE!");
            textBox3.AppendText(Environment.NewLine);
            MessageBox.Show("FIRM.bin downloaded!", "YEAH");

Check this out: -link-
 
  • Like
Reactions: nastys

MeisterFenster

Well-Known Member
Member
Joined
Nov 18, 2014
Messages
168
Trophies
0
Age
28
XP
165
Country
Gambia, The
Would this allow me to get a higher firm game on the eShop (Poke Toru with NTR Spoof, since I dont want to install any homebrew/"backup" cia) and play it without changing anything in sysnand?

Edit: With to cubic ninjas on N3DS, one for NTR, one for Ninjhax Homebrewloader
 

DJPlayer

Banned!
Banned
Joined
May 21, 2015
Messages
542
Trophies
0
Age
46
XP
429
Country
Netherlands
Would this allow me to get a higher firm game on the eShop (Poke Toru with NTR Spoof, since I dont want to install any homebrew/"backup" cia) and play it without changing anything in sysnand?

Edit: With to cubic ninjas on N3DS, one for NTR, one for Ninjhax Homebrewloader
Just use one "Retail" Cubic Ninja and install another CN as Cia with NTR-Loader
 
  • Like
Reactions: MeisterFenster

joserdo

Member
Newcomer
Joined
Mar 14, 2009
Messages
9
Trophies
0
Age
42
XP
487
Country
Mexico
I have tested the beta 1.3 on O3DS 8.1 usa without firmlaunch it boots fine but with firmlaunch enabled the 3ds just freeze on blackscreen with the line:
"apply patch for type c.... Done!"

in commpanion app show error "pasta CFW has ben found but the system.txt is not found or not complete press OK to create it"

before you run the app file system.txt is 811 after the error has 00


I use the 1.3 beta 4
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
52
Website
www.albertosonic.com
XP
1,396
Country
Italy
I have tested the beta 1.3 on O3DS 8.1 usa without firmlaunch it boots fine but with firmlaunch enabled the 3ds just freeze on blackscreen with the line:
"apply patch for type c.... Done!"

in commpanion app show error "pasta CFW has ben found but the system.txt is not found or not complete press OK to create it"

before you run the app file system.txt is 811 after the error has 00


I use the 1.3 beta 4
Use this companion app: https://mega.co.nz/#!1dw3lCJR!j34C5XYJaYz9w-E0c5oUBCT-BosCK0PXsrYDpnCdOIs
 

froggestspirit

Aspiring Game Dev
Member
Joined
Jul 28, 2011
Messages
1,281
Trophies
1
XP
1,561
Country
United States
i have no idea how that'd work but i imagine it'd be similar to loading 3ds roms - install hooks, redirect device descriptors and call kernelsetstate() in order to boot into nds firmware?
I'm thinking it'd be more so converting NDS roms to load like dsiware, however, dsiware needs to be installed to the nand, and it would destroy MSET every launch (for those using MSET).
I'd love to have my NDS collection digital in a nice folder though!
 

ccfman2004

Well-Known Member
Member
Joined
Mar 5, 2008
Messages
2,863
Trophies
2
XP
3,310
Country
United States
I'm thinking it'd be more so converting NDS roms to load like dsiware, however, dsiware needs to be installed to the nand, and it would destroy MSET every launch (for those using MSET).
I'd love to have my NDS collection digital in a nice folder though!
If we could run them in emuNand when it comes out with Pasta that would eliminate the MSET resetting in sysNand.
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
i have no idea how that'd work but i imagine it'd be similar to loading 3ds roms - install hooks, redirect device descriptors and call kernelsetstate() in order to boot into nds firmware?
The immediate problem is the fact that it has to be DSiware or it won't boot (I've tried). That and the fact that every game expects an eeprom or similar for saving.
 

NyaakoXD

( ͡° ͜ʖ ͡°)
Member
Joined
Dec 16, 2013
Messages
1,860
Trophies
2
Location
In your closet...
XP
3,697
Country
United States
@nop90 I think you said something along those lines? To try and create an application which can load ROM in this format? Are you still pursuing these plans? It would be awesome because I don't like those CIA conversions.
Yeah, I also really don't like using .CIA files since my SD card needs to have enough free space that's more than twice the size of the .CIA file that I want to install.
 

ccfman2004

Well-Known Member
Member
Joined
Mar 5, 2008
Messages
2,863
Trophies
2
XP
3,310
Country
United States
Yeah, I also really don't like using .CIA files since my SD card needs to have enough free space that's more than twice the size of the .CIA file that I want to install.
At least the N3DS accepts 64GB microSD cards which is what I use now. The only reason I use Gateway os for emuNand which nothing else supports on the N3DS for now.

Although I've opened my 3DS so many times to remove the microSD card, the plastic holding one of the screws in broke and the other screw is barely holding on. Thanks Nintendo for not liking us Mac users.
 

OctopusRift

GBATemp's Local Octopus, Open 9am-2am. "Not Yet"
Member
Joined
Nov 19, 2014
Messages
1,460
Trophies
0
XP
947
Country
Saint Kitts and Nevis
Does this support MSET yet? I'd like the new features, without having to sacrifice mset!
 

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,478
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,937
Country
United States
If we could run them in emuNand when it comes out with Pasta that would eliminate the MSET resetting in sysNand.

Your best bet is if someone can get Sudokohax + modified homebrew loader to load them. It will likely not occur directly from the home menu. Good luck finding someone willing to program something like that. :P
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Btw it seems like the user dtapple disabled others posting on their profile, either he is going...