Tutorial  Updated

Recover the image from a set of IPS patches for Bootlogo.

Sometimes you can find a set of bootlogo's IPS patch files, but you do not remember which image was used to created them or you loose the original image.

In order to recover the image you can patch an uncompressed main file from the NCA with the titleID VI from a set of firmware files, then apply the IPS patch to that file and then extract the image from the patched file. For last use Gimp to convert the binary data to a image.

Tools you need



In order to complete the task you need:
  • FLIPS, a tool to apply IPS patches to binary files on your computer.
  • A set of original firmware files (legally acquired) any version 5.0.0 or newer will work.
  • A set of keys extracted from your console (or generic ones)
  • Hacktool
  • A Hex editor, I really love HxD Hex Editor
  • Gimp
  • A list of the match of the firmware version to IPS files names, by example on the script of PalomitasLogoConverter you can see all supported ones.

First step: Identifying the files you have


Imagine you have this set of files:
1791591696490.png


using the file https://github.com/StarDustCFW/Logo-para-switch.Palomitas/blob/master/data.txt you can know to which firmware correspond each file:

IPSfilenameFirmware versionsOffset(dec)
7B4123290DE2A6F52DE4AB72BEA1A83D11214C71.ips05_00_01831168
723DF02F6955D903DF7134105A16D48F06012DB1.ips05_01.01835264
967F4C3DFC7B165E4F7981373EC1798ACA234A45.ips06_00_01573120
98446A07BC664573F1578F3745C928D05AB73349.ips07_00_01589504
0767302E1881700608344A3859BC57013150A375.ips08_00_01593600
7C5894688EDA24907BC9CE7013630F365B366E4A.ips08_01_01593600
7421EC6021AC73DD60A635BC2B3AD6FCAE2A6481.ips09_00_01536256
96529C3226BEE906EE651754C33FE3E24ECAE832.ips10_00_01544448
D689E9FAE7CAA4EC30B0CD9B419779F73ED3F88B.ips11_00_01655040
65A23B52FCF971400CAA4198656D73867D7F1F1D.ips11_00_11655040
B295D3A8F8ACF88CB0C5CE7C0488CC5511B9C389.ips12_00_01696000
82EE58BEAB54C1A9D4B3D9ED414E84E31502FAC6.ips13_00_01708288
AFEAACF3E88AB539574689D1458060657E81E088.ips14_00_0 & 14_01_0&14_01_21716480
7E9BB552AAEFF82363D1E8C97B5C6B95E3989E1A.ips15_00_0 & 15_00_11704192
BA15B407573B8CECF0FAE2B367D3103A2A1E821C.ips16_00_0 & 16.00.1 & 16.00.2&16.00.3 & 16.01.02191616
34D15383767E313EE76F1EE991CD00AD2BF8C62A.ips17_00_02023680
9D8D6EFEE01E97E95E00D573530C09CB5AB5B8A0.ips18_00_0 & 18_00_1&18_01_02031872
D94508595598713DD2C3390BD0518C9A748D273F.ips19_00_02031872
B4CC8E35D5011901554107EFC883EEAFC745FBEF.ips20_00_02007296
AFC93F0B66744F3FDE73C02D244B9E309B8738DE.ips20_01_1&20_01_5 & 20_02_0&20_03_0 & 20_04_02007296
CBF3505D9F075CD771B1F7A2D7202D2C0D3CEE62.ips21_00_0 & 21_01_0 & 21_02_01990912
9527BE3A3BAAFBFB987A6DE1B62EF4792C01A19E.ips22_00_0 & 22_01_0 & 22_05_01970432
B259CAB3BE7CD0DDEFB2B50150EB4AA818B4AE72.ips23_00_0&23_00_11974528

With this information now you can know which firmware you can use to recover the image.

Process the firmware


The next steps are the same used to «extract original bootlogo from firmware» as explained on the post recover the original bootlogo once you know for which firmware(s) do you have a IPS file you can choose one of them and run this steps:
This example is for Firmware version 11.0.0

FIRMWARE EXTRACTION​

The first step is find the NCA file which contains the «VI» module, for that you need to copy the Hactool.exe to the same folder where the firmware NCAs files are, then run this command on a windows command line (CMD) and on the firmware files. (you must have the prod.keys file in the folder %USERPROFILE%\.switch\):


del TitleList.txt & cls & for %n in (*.nca) do echo %n >> TitleList.txt & hactool.exe --disablekeywarns -i %n | findstr /I "Title Name:" | findstr /I "vi" >> TitleList.txt

this create a file called «TitleList.txt» open that file and look for the line with the text: «Title Name: vi» the filename immediately before that line is the name of the NCA file which contains the vi module.


1762735013239.png



In this example is e6d29b9be4f402bea5325d1eb9d1cc29.nca, now we need to extract the contents of the NCA file, you can do it using the next commands:

First we will be sure is the correct file:

hactool.exe --disablekeywarns -i e6d29b9be4f402bea5325d1eb9d1cc29.nca


1762735235058.png


with that command you can get two importad data from the file, THE TITLE ID, AND TITLE NAME

TITLE EXTRACTION​

Now using the commmand:
hactool --disablekeywarns -t nca --exefsdir Folder_out e6d29b9be4f402bea5325d1eb9d1cc29.nca

You can extract the NCA content to the Folder_out folder

1762735395663.png



Inside that folder you will find this two files:


1762735500002.png



We are interested on main file, but that file is compressed, you need to expand the file for that you need to execute the commands:

copy hactool.exe Folder_out
cd Folder_out
hactool --disablekeywarns --uncompressed=main_uncompressed -t nso0 main


1762735639001.png



this create the new file main_uncompressed and also give us the important data Build ID This must match with the IPS file to be used.

Apply the Patch​

Now we have a main_uncompressed file this file contains the original Bootlogo, now we can use FLIPS to apply the IPS file to that file and convert it to the Bootlogo of the patches.
Open FLIPS:
1791593584436.png


Press the button «Apply Patch», the first dialog is open, you must select the IPS file you have for the version of Firmware you are proccesing, on the table above we can see the file for Firmware 11 is 65A23B52FCF971400CAA4198656D73867D7F1F1D.ips so select that file and press «Open»
1791593773895.png


immediately a new file dialog is shown, now you have to open the main_uncompressed file extracted on the previous step. in order to the dialog show the main_uncompressed file you need to change the file type to ALL FILES (*.*)
1791593877859.png


Then select main_uncompressed and press the «open» button

The last step is give to the new file a name and save the result of apply the IPS patch
1791594045417.png

In this example I did used main_uncompressed.patched name.

This new file have the bootlogo patched to the image on the IPS file. So now we need extract the image from that file






BootLogo Image data extraction​


Open the main_uncompressed.patched file with a Hex editor and search for the Hex string "00 00 00 FF 00 00 00 FF" what is the start of the original bootlogo, by the table above, we know for sure what the offset is 1655040 (dec) = 0x194100 (Hex)

1762735843100.png



On this example the string start on the offset 0x194100 (1655040), now you need to select a block starting on that offset and with the length of the original bootlogo.

The original bootlogo is stored as a binary stream of RGBA data with a 4 byte for each pixel, the original size is 308 * 350 pixels so they are 107800 pixels and as each pixel is made of 4 bytes the length of the stream is 431,200 bytes equal to 0x69460 bytes

so FOR THIS EXAMPLE you need to select the block starting on 0x194100 and length 0x69460


1762736155642.png



Extract that block to a new file called BootLogo.data


1762736220457.png




1762736322639.png



that new file must be 431200 bytes long!



Raw data processing.​


Now this file can be open with GIMP, and on the «Load Image from Raw Data» dialog, be sure of select RGBA 8-bit from the Pixel format, and the size of the image 308 * 350 pixel you must get something like:

1791594548475.png



Do not worry about the blank lines, is a bug on GIMP, the image will open fine. Click on the «Open» button.

On the GIMP app select File -> Export As… to export the image as a PNG file

1791594626343.png




1762736677900.png



write BootLogo.png and click «Export» button.

1762736713244.png



Select the options you like or use default ones and click again on export button, the only option I change is the compression level I took it to 9 as the PNG use a non loose compression so no data will be lost.


1762736804820.png
 
Last edited by impeeza,

Site & Scene News

New Hot Discussed User Submitted