ROMs For Dummies: Part Three

From AllShadow.com Wiki

Contents

Introduction

Welcome to Part 3 of ROMs For Dummies. This part will deal with getting a better understanding of the ROM dump created in Part 2. The actual customization of the ROM image starts in this part and is picked up in Part 4.

Tools you will need

You will need the following tools in order to complete this part:

Packages Creator 5.4 - Creates a software package from a cab file or set of files.

InitFlashFiles.dat - Shows file structure for the ROM. Download Image:Initflashfiles.zip.

Understanding the ROM image

Pre-Customization Checklist

At this point, you should have a dump folder in your Dump folder that contains two folders: OEM and SYS. In order to keep this clean, move the dump (Note that this is the ROM dump, not your folder) folder to the IMGFS folder you made in the Shadow Kitchen. Keep in mind that you should cut and paste (or move) the folder instead of copying because copying takes up a considerable amount of time and disk space.

How it's organized

Now that you've moved the dump into the IMGFS folder, it's time to take a closer look at the dump. There are two main folders: OEM and SYS

SYS folder

The SYS folder contains the Windows Mobile OS in components such as the core, the phone, wifi and bluetooth radio stacks, media, etc.

OEM folder

The OEM (Original Equipment Manufacturer) folder contains all of the applications provided by the OEM (HTC) or by the carrier (T-Mobile). This includes drivers for components of the phone to work as well as software provided by either the carrier or OEM to either enhance the device or to style it in a particular way. This is the folder that we will be spending our time in.

Fixing the OEM mess

Re-organizing and restructuring the OEM folder

Because the PackageTool program that you used can't replicate exactly the way either HTC or T-Mobile designed the ROM image and because specific information was not provided by them, all of the apps that either company bundles has been jam packed into three main folders: OEMAPPS, OEMDrivers, and Extended_Pkg.

Using the InitFlashFiles.dat

What is the initflashfiles.dat? It's the file that tells the operating system how to structure itself and place folders and shortcuts accordingly. For example, the initflashfiles can set which files or folders should appear in the start menu. This part you'll need because it's organized by each bit of software and tells you exactly what files and dlls relate to a certain bit of software (e.g. files for ArcSoft MMS 4.0). You can download the initflashfiles for the original shadow ROM above.

Open up the initflashfiles and scroll through it. You'll notice that each bit of software has a header and then states where to place each file. For each software title you see, create a new folder in your OEM folder with the same name.

InitFlashFiles.dat

Once you've done that, start looking for each of the files specified in the initflashfiles.dat and copy them to their respective folders. Keep in mind that some files may be in different OEM packages (OEMDrivers/OEMAPPS/etc.).

Structured OEM Folder

Create the OEM Packages

Now, you'll need to convert each of the folders you made into a package. Open up the PackageCreator 5.4 and click on "open package."

Package Creator

Select one of the packages you made and click ok to the prompt and then "Done" on the next prompt. In the package "in option.xml field", type in the name of the package and can press "Complete Package". Repeat the previous steps for all of the packages you've created.

If you take a look one of the packages now, you'll see that a long and random number file has been added to the package. This is called a GUID (Globally Unique ID). This will let the software that rebuilds the OS know which files and folders correspond to a certain package. A similar file with the same GUID will need to be created later to house all registry edits. That process will be covered in the next section.

Summary

By restructuring the OEM package manually, you should have a better idea of how the ROM image fits together. In the SYS folder, there are packages similar to the OEM folder and have already been structured into indivudual packages that you can further manipulate with ease.

On to the Next Part

If you are done with Part 3, click here for Part 4 of 5: Creating Registry Edits, adding Provisioning XML and 3rd party Applications

Or if you are looking for other parts, Part 1 of 5: Answering basic questions, Part 2 of 5: Choosing your source and Extraction, Part 5 of 5: Rebuilding and Flashing your ROM.