[Windows Mobile] hilaireg:
Extracting the RUU_SIGNED.NBH Contents

Extracting the Contents

An .NBH is a signed group of modules or packages; they are typically comprised of .NB files. An .NBH can contain any combination of .NB files. An .NB file is a block of code that can be a Radio ROM, Operating System packages (XIP and IMGFS), Startup Splash Screen (or SPL).

The file we will be working with is the OS.NB file; it contains the ULDR, XIP, and IMGFS (OEM, SYS). To extract the contents of an .NBH file, we issue the following command.

NBHextract.exe RUU_signed.nbh

Upon completion, the following files will have been extracted: Unknown.nb, 01_SPL.nb, 02_MainSplash.bmp, 02_MainSplash.nb, and 03_OS.NB. For the purposes of this guide, the 03_OS.NB file is the file we will be working with; it will be renamed to OS.NB.

Splitting the OS.NB File

In any ROM, the OS.NB is padded with extra data that is split into packets for the flashing process. This ensures that incorrectly transmitted packets can be re-transmitted to a device without having to resend from the beginning. Packets are usually groups of bytes and vary between devices - a packet will typically contain of data followed by padding.

For the Raphael, the data packets are 800 bytes in size and padded with 8 bytes. For the purposes of this guide, this padded portion is not required and therefore, we strip it from the OS.NB using with the NBSPLIT tool by issuing the following command.

nbsplit -kaiser os.nb

The -kaiser option instructs the NBSPLIT tool to process 0x800 (2048 decimal) hexadecimal bytes of data and that 8 bytes of padding will follow each 800 bytes. Upon completion, the following will have been extracted: os.nb.payload, os.nb.extra. For the purposes of this guide, the os.nb.extra is not required.

At this point, we need to extract the contents of the ULDR, XIP, IMGFS (OEM, SYS) from the .PAYLOAD file as we will be changing the ULDR and XIP. Most of the .PAYLOAD file content is the IMGFS; this is the portion that makes up content of the OEM and SYS folders. Most chefs add/remove OEM packages in these folders during their cooking process - you'll eventually do the same.

Tools Required

The following tools are required for the RUU_SIGNED.NBH extraction activities.

NBHextract

NBSplit

ImgfsFromNb

ImgfsToDump

RomMaster

DumpROM

PKGTool

Procedure

The following procedure initiates the ROM Extraction (NBH, IMGFS, and XIP) activity via a script that is included in the Generic Simple Kitchen. The extraction process can take a significant amount of time to complete.

Copy the RUU_SIGNED.NBH file to the C:\XDA\My_Kitchen\BaseROM\ folder.

Navigate to the C:\XDA\My_Kitchen\Tools\ folder.

Launch RaphaelKitchen.cmd.

Select E, press ENTER.

Select A, press ENTER.

At the Done! message, allow the process to resume – do not close command prompt!

At the Now Start Cooking Your ROM! Press Any Key To Continue message, press ENTER.

Select X, press ENTER.

References

NBHextract: Extract Contents From NBH Files

http://xdaforums.com/showthread.php?t=289830

[TUT] ROM For Everyone (Video Tutorial To Cook The ROM)

http://xdaforums.com/showthread.php?t=413782

[REF] Cooking Class Class of 2008/09 [ONLINE]

http://xdaforums.com/showthread.php?t=335631