[MDA III, XDA III, PDA2k, 9090 Software Upgrading] GerardNL:
Xplode has created a really great kitchen for us to play with and have made my custom ROM with this kitchen. I think it’s so easy that everyone is now able to create his own ROM.

However, I would like to go a bit further: Instead of just using the kitchen someone has made, I would like to take any of the ROMs (e.g. Helmi_BA_WM2k5_AKU3.5_v1.4.CF2 R2 by baniaczek) and use that as my kitchen starting point.

I’ve been doing a lot of reading on the subject and this is what I’ve figured out so far. It is by no means complete (or maybe even correct), but I can certainly use some help to get further. Below information is not something I found out on my own, but is based on what is mentioned in other postings in different forums and websites and picking apart the batch files I’ve found in several kitchens.

My intention of this posting is to make a simple how-to wiki-page so anyone could create his/her own kitchen and from that kitchen create the best possible ROM for their own use: Add the packages they use and leave out the stuff they don’t need. My plan is not that everyone will start publishing the ROM they have created from a decompiled ROM since there would simply be to many chefs :-)

------------------

Step 1: Convert the nbf file to an nba file.

The ROM file that you load on your phone is always called nk.nbf. However, before you can do anything with this file, you’ll need to convert to to nk.nba. For this you use a tool called “xda3nbftool.exe” (yes, the one you used to set the operator with)

The command to do the conversion is: xda3nbftool.exe -x nk.nbf nk.nba 0x20040521

After a minute or so, you’ll have a file called “nk.nba” that is the same size as the original

Step 2: Brake the nk.nba file into separate files.

The nk.nba file consists of 2 parts and need to be split. To do this split, you’ll use the following command:

prepare_imgfs.exe nk.nba

After the program has run, you’ll have 2 files: “imgfs_removed_data.bin” (0.5 mb) and “imgfs_raw_data.bin” (variable size, but e.g. 27 mb)

Obviously, the part we’re interested in is the bigger file of the 2.

Important remark: For other HTC platforms (like HTC Uni), the above command is executed with an extra parameter “-nosplit”. However, if that parameter is added the output is unusable when performed on the Blue Angel ROM.

Step 3: Extract the modules

Now you have the raw image file, you’ll need to extract it and convert it back into modules.

To do this, you’ll first need to place a file called “recmod.exe” in the directory where the imgfs_raw_data.bin file is. The next step is to run this command:

viewimgfs imgfs_raw_data.bin

This command will create a directory called “dump” and it will extract all the files and many directories in this directory. You can have a look in this directory and will probably recognize a lot of the names if you have been building ROMs on someone’s kitchen.

Step 4: Dividing the modules into SYS and OEM

Before you can do anything with these modules, you’ll first need to convert them to packages. To do this, you’ll need a piece of software called “Package Tool” (from Bepe)

Start the program and select the dump folder via “File\Open”. Once selected, it will give some basic information about the dump directory like OS etc.

Now select Tools\Build Packages, but before you start the command, make sure you have the file map.txt in the same directory as the Package Tools application. That way, many of the GUID numbers will be translated to readable names.

This program will just run a few seconds. After it is complete, you’ll now find a SYS and OEM directory in the dump directory. If everything went well, then there will be just 1 file left: initflashfiles.dat. All other files and directories that were there before are now in the SYS or OEM directory.

However, in the real world…. My experience with several ROMs I’ve tried, the Package Tools program is unable to properly complete the process for a, to me, unknown reason and when it has run, the directory is far from empty. Under the section “[Missing Files]” there is the information about files that are missing.

When you look in this file, you’ll see that all the missing files are not really missing but are directories with the same names and extension of the files that where not placed in the correct sub-directories. All is not lost yet. You can manually move the files to the mentioned directories. Once you have completed this job, you should still end up with a virtually empty dump directory.

There is also a chance, like with fake WM6 ROM on this forum, that after you move all the files that are mentioned in the “missing files”-section but still end up with a long list of files in the dump directory. If that’s the case, then obviously something went wrong. However, at this point, I don’t know why this happens. However, it does look like it’s not a good starting point to build your own ROM with.

Remark: The “Missing files” section may also contain entries like this one:

19a7f28b-6bc7-4fe9-b060-76ae3a65ff72

19a7f28b-6bc7-4fe9-b060-76ae3a65ff72.rgu (File)

This indicates that the RGU file is missing. However, this is not a big problem. Just create an empty file with the name in the mentioned directory. Later on, the BuildOS.exe program will use the empty file to place the correct information in the file.

Step 5: Move the 2 directories

Now you have the correct SYS and OEM files, you’re on you way to start cooking. Move the 2 directories to a different directory. (like how it is in Xplode kitchen for example) and remove the dump directory

------------ Now, I’m at this point and here I’m a bit lost ------

Step 6: Adding and removing

Now you are at the part that was the whole point of the exercise: Adding and removing packages. Adding premade packages is not too difficult: With some luck the packages you want to add can be found in a different kitchen or is otherwise available. (Helmi and others wrote some documents on how to create packages, so refer to those).

Take the packages and place them in the OEM directory.

Taking out packages should be as simple as well: Just move the directories of packages you don’t want to a different directory (you could also just delete them, but you might need them again later). When removing packages, there is of course a big chance that you remove something that is essential for a part of the OS that you are not aware of, so removing bit and pieces is more trail, error and a bit of luck.

(continued on the next post)