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)
Building your own kitchen (Part 2)
(continued from above port)
Step 6a: Changing the registry
After you’ve followed step 1 to 5, you also extracted the default.hv and user.hv and can be found in SYS\Metadata directory. This is the registry that also contain all the bits and pieces of registry files that are in the packages (the .RGU files)
To modify these 2 files, use these commands:
SET _FLATRELEASEDIR=.
rgucomp -o default.hv -nologo > default.txt
rgucomp -o user.hv -nologo > user.txt
Add "REGEDIT4" in the beginning of the files and leave a blank line at the end of the file. Save the file as UTF-16 or Unicode format. (Ultra-Edit is very good editor for this)
After you have made the changes, you will need to covert them back to a format your PPC will understand. Use these commands:
SET _FLATRELEASEDIR=.
copy default.txt boot.rgu
rgucomp -b
ren boot.hv default.hv
copy user.txt boot.rgu
rgucomp -b
ren boot.hv user.hv
---------------
The next steps are basically the reverse from the first 5 steps: After taking the files apart, they now need to be put back into place.
----------------------------------
Step 7: Building the ROM up again.
To start building the ROM now, the first command you execute is BuildOS.exe.
This program will create the dump directory again and will copy the directories and files from SYS and OEM to the directory.
Remark: There are several versions of BuildOS on this forum. Xplode’s kitchen is using a more advanced version where you can easily select the packages you want to be included (instead of moving them in and out the directory). This is a much nicer approach and will make ROM building as simple as installing a regular piece of software on your PC. However, to keep it a bit more simple for this how-to, I’m assuming an older version of BuildOS.exe that will not ask for any user input. (The more advanced version will require you to modify XML files to add packages. It’s not too difficult, but does require a bit more background knowledge)
Step 8: Building the file image system
Now you have all the files and directories that make up the ROM, you’ll need to convert it back into a file image.
For this, you run the program BUILDIMGFS (without any parameters)
Remark: For some reason, but this program is very memory intensive. If you don’t have that much internal memory, or your swap file is too small, this program is never able to completely run. I’ve noticed this problem on more then 1 computer. (I have the source code of this program and tried if I could do something about this. However, the program is heavily relying on a DLL called “cecompr_nt.dll” and I expect that that DLL is the culprit. I’ve been searching for more information on this DLL, but have not found anything on the internet about it)
Important note: If you have added to many modules to your own ROM, the BUILDIMGFS process may crash. So, if this happens, you’ll need to go back to step 6 and remove some of the packages you’ve added. If you go back to step 6, you’ll need to delete the “dump” directory first.
This program will convert the dump directory back in the file “imgfs_raw_data.bin”.
Once the program has run, the file should be something like 27 mb again.
If the program does not crash and runs to completion, there is still a chance that you have added to many packages to your ROM. When the BUILDIMGFS is ready, it will show the number of free sectors at the end of file system image. If it is showing something like ffffef that means that it’s too big, since it should show a small (hexadecimal) number like 1e or something like that.
Since/If you want to add as many packages as possible to the ROM (instead of installing them in RAM) you may need to repeat step 6, 7 and 8 several times. To make your life a bit easier, make a screen shot of the OEM directory and keep track which one worked and which one didn’t). If you go back to step 6, you’ll need to delete the “dump” directory first.
Step 9: Building the nk.nba
To create the nk.nba file again, you need the file you just created in step 8, but also the other file created in step 2: imgfs_removed_data.bin (maybe this file is created by buildimgfs??)
When you have these 2 files in a directory together, run this command:
MAKE_IMGFS nk.nba
Once the program is complete, the nk.nba file should be something 32 mb again.
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 BA ROM.
Step 10: Convert the nk.nba back into nk.nbf
The final step of the process: creating the file that our BA understands: nk.nbf
This step is into 2 pieces:
A: Update the check-sum of the nk.nha file with this command:
XDA3NBFTOOL -c -u nk.nba
B: Convert the file:
XDA3NBFTOOL -x nk.nba nk.nbf 0x20040521
As you can see, the last parameter is the same as in step 1. This is some sort of password that is needed to encode the file with.
Now, the ROM is complete and you’re ready to flash it on your BA. I assume that you know how to do that part
** Can I use Notepad to edit and save ???
I got error here. When I try to do
To modify these 2 files, use these commands:
SET _FLATRELEASEDIR=.
rgucomp -o default.hv -nologo > default.txt
rgucomp -o user.hv -nologo > user.txt
Add "REGEDIT4" in the beginning of the files and leave a blank line at the end of the file. Save the file as UTF-16 or Unicode format. (Ultra-Edit is very good editor for this)
After you have made the changes, you will need to covert them back to a format your PPC will understand. Use these commands:
SET _FLATRELEASEDIR=.
copy default.txt boot.rgu
rgucomp -b
ren boot.hv default.hv
copy user.txt boot.rgu
rgucomp -b
ren boot.hv user.hv
************************************************************
C:\Scoter Kitchen\Utilities\TOOLS>rgucomp -b
Microsoft (R) RGUComp Version 1.0.000
Registry file processor and hive builder.
Copyright (C) 2004 Microsoft Corporation All Rights Reserved.
built: Nov 19 2004 15:17:13
importing registry file ".\boot.rgu"...
InitRegistry FAILED in file ".\boot.rgu" within a few lines of line 1.
BuildBootHive: (RGUComp) !ERROR failed importing ".\boot.rgu"
wmain: (RGUComp) !ERROR failed building BOOT hive
****************************************************
Now, I got errors on line 3 of default.rgu and line 154 of user.rgu ...
I didn't edit those line at all .. Why errors !!
I put REGEDIT4 in the first line of both default.txt, and user.txt and leave 1 blank line at the end.
I saved it into unicode.
Thank you for the info, will sure to give it a try when I have time later on...
Thank you very much! Will try to localize ROM using OEM Packages.
How to localize WWE ROM to other language?
Related
So I've been playing around for a little while with the intention of creating my own custom ROM. I think I've got everything all figured out - however I'm having a problem that I think is related to the initflashfiles.dat file. Basically, after flashing my new OS ROM, my 8125 hangs at the splash screen with the version numbers on it. As a test, I redid my modified ROM, except I used the original initflashfiles.dat - this worked just fine. Tried it again by building the ROM with my modified initflashfiles.dat - same problem.
Here are the steps I'm going through.
1. Parse out the nk.nbf file using typhoonnbfdecode -x
2. prepare_imgfs 80040000-OS.nb -nosplit
3. viewimgfs imgfs_raw_data.bin
4. Modify contents of dump directory. Basically I've deleted files I don't need and added new ones.
5. Modifiy initflashfiles.dat (which I've attached). After modifying the file I open it in a hex editor and remove the first two bytes - making the first byte 3B (";"). I save it and mark it as read-only.
6. buildimgfs
7. make_imgfs 80040000-OS.nb -nosplit
8. Run nb2nbf_tornado.exe. I do run this correctly, using the correct memory address for the OS .nb file.
9. Put the new nk.nbf into an existing RUU self-extracting archive and run it.
It really seems like it's the initflashfiles.dat file - as I've successfully loaded this ROM with the original file (its really not the original, it's from a summiter ROM that I'm basing mine off).
Any thoughts?
I'm going to bump this once just in case people missed it originally.
I've messed around a bit more, and have pretty much isolated that this is my problem - but for the life of me I can't figure out what I'm doing wrong.
CameronJ said:
I'm going to bump this once just in case people missed it originally.
I've messed around a bit more, and have pretty much isolated that this is my problem - but for the life of me I can't figure out what I'm doing wrong.
Click to expand...
Click to collapse
Hi,
i see that the file you've attached isn't actually a .DAT file. It is a .dat.TXT that's the same that saying it's a TXT file!!!
If the file you're putting inside your ROM is this very same file (.dat.txt) then you've found your problem: you need a .DAT and NOT a .dat.txt file!!!
Try following this procedure on your PC (i suppose you're using XP or 2003 server):
- open a folder (whichever folder you like, it's not important)
- on the Tools menu click Folder Options.
- click the View tab.
- clear the Hide extensions for known file types check box.
- press OK
PS: Here is an illustrated guide on how to show file extensions
Now go to the place where your initflashfiles.dat is. If the file is named 'initflashfiles.dat.TXT' (like the file you uploaded in this forum) then:
- select the file
- press F2 (or right click and choose 'Rename')
- remove the tailing .txt from the name
Finally:
- let us know if it worked
Bye bye
risidoro said:
i see that the file you've attached isn't actually a .DAT file. It is a .dat.TXT that's the same that saying it's a TXT file!!!
Click to expand...
Click to collapse
:lol: Thanks for the reply.
I had to add the .txt extension otherwise the forum wouldn't let me upload the file (.dat files are not on the list of available file types for upload).
When I loaded the file I meant to put that explanation in there but forgot before I finished the post.
Hi. I don't know if you're still working on this, but I'd like to share with you my experience last night. I examined your initflashfiles.dat, and it is perfectly ok.
As I see in your initflashfiles.dat, there are a lot of folder customization like:
Directory("\Program Files\Task Manager"):-File("taskmanager.exe","\Windows\taskmanager.exe")
There is nothing wrong with this as we need the file to be in the right location. BTW, THIS FORMAT WORKED FOR ME. Just a thought, you might be editing the default.hv and user.hv (hives) to put in the registry keys of some applications?
My device (Himalaya) did not start out correctly and did not execute the initflashfiles.dat, BUT when I connected my Hima through active sync, you can actually explore the contents. SO, in this non-working state, I experimented in tracing the culprit, by restoring a couple of the original files I edited. I found out that it has something to do with the way I edited the hives.
Steps I made in experimenting:
1. I sync my Hima to my PC.
2. Copied the original default.hv to \windows directory
3. Hard Reset Hima, BUT answer NO to all three boot options
4. My Hima started normally and executed initflashfiles.dat to the detail.
Discovery from experiment:
1. The files were only copied to the directory were we wanted it, BUT the original file is still in the \windows directory. Therefore, we did not save storage memory.
2. We only benefitted from an already installed app built into the ROM.
Hope this gives you some insight.
Hi, I followed the thread: "How to reconstruct a dumped ROM"... (obviously I had, before, did a rom dump!). Now I have a directory named "dump" with several subdirs.
In the step 3) there is written: "After this step you can optionally edit the OS files with the proper tools"... now the question is: what are these proper tools? I searched in the forum, in the other threads but I didn't find anything... My needs are: to delete some programs that are in the rom (for example Pocket Word, Pocket Excel, other..) in order to obtain more space, but to install other tools at the free space.
Thanks in advance for your help....
Great question ! i can't help you , but i wait for answers ....
I asked the same thing the other day, and got an answer(thx again to him).
Actually, I'm doing it right now, as a test I've successfuly dumped and rebuilt lsvw's rom using enhanced imgfs tools batch files, nbdump.bat nbname.nb & nbbuild nbname.nb, now I'm removing files from the rom and maybe add some other, like that quick gps thingy, latest msn(optimized for trinity, removed vga resources), phone pad, and some other thing on my custom extrom.
I had the same doubt as you, but it seems that we're overcomplicating things, you can simply use the file explorer to remove files from that dir, beware of which files you remove/alter.. initflashfiles.dat has some operations to be done after flashing the device(creating folders,renaming files, moving them to startup/start menu/etc folders), I thought that if the file didn't exist on the windows folder, whatever invoques initflashfiles.dat would crash, but it doesn't seem to be the case, I haven't put this to test, but I've found several missing files on the initflashfiles.dat(and a typo, "floder", go figure what it means - lazy/rushed editing IMO), so there seems to be some tolerance to the operations contained in that file.
I won't edit the wiki until I'm 100% sure that what I know is correct, but to sum it up:
dump the files
add/delete files with explorer
edit the registry using rgucomp
edit initflashfiles.dat using the original windows notepad & use an hexeditor to remove the 1st 2 bytes
run NBBuild.bat to create the *.nb file
OSchecker.exe to validate the *.nb file
nbhtool.exe to create the nbh
flash it(I prefer the sd card method)
Code:
rgucomp needs setting _FLATRELEASEDIR environment variable to current directlry like this:
set _FLATRELEASEDIR=.
Dump default.hv/user.hv file to .reg with:
rgucomp.exe -nologo -o default.hv > default.reg, then add line "REGEDIT4" to the beginning of REG file.
Modify the .reg file to your liking, (save it in UTF-16 with CR+LF terminations and a new line at the end of the file) and convert it back to .hv
And don't forget to flash Olipro's Hard SPL before, it may save your device.
"and convert it back to .hv"
http://forum.xda-developers.com/showpost.php?p=1186635&postcount=1
(no wonder I didn't find this info, forum search is almost useless, googled for rgucomp and voilà, first result(above) right answer)
Hi, I am starting to get a bit more ambitious and decided i would like to put together my own collection of apps to go in bepe's ROM kitchen. I have a collection of about 30 .cabs that I want to have as part of my ROM.
I went to the wiki, and here are the instructions:
Code:
How-To build ur own OEM Package:
An OEM Package is just a simple folder containing files and registry settings for the ROM
First of all you'll need a GUID number for your Package.
Go to http://www.famkruithof.net/uuid/uuidgen to get one.
In my case:
283b9db7-cb03-4c1b-820e-ca49b2c3b5db
Necessary steps:
1. Create a new folder:
Dev/OEM/(Your package name)/
2. Create a empty text file:
Dev/OEM/(Your package name)/283b9db7-cb03-4c1b-820e-ca49b2c3b5db.dsm
(CreateOS.exe will finish this file for you)
If needed:
# Create an UNICODE text file:
Dev/OEM/(Your package name)/283b9db7-cb03-4c1b-820e-ca49b2c3b5db.rgu
This file could be used to add registry entries to the ROM
First line is:
REGEDIT4
...
and there MUST be a empty line at the end!!
# Create an UNICODE text file:
Dev/OEM/(Your package name)/initflashfiles.txt
This file could be used to create folders or copy files on the ROM.
Example: Open Dev/LOC/initflashfiles.dat using a text editor
So from the directory with BuildOS in it, I created a folder Dev, then OEM.
Now how do I integrate my cabs into the rom? (Everything before was so I don't get flamed for not reading the wiki because I did!)
Thanks,
hardingt0110
For those of you who want to customize wm6.1, here it a simple ROM kitchen to do so. Beginners, please wait for my GUI release. It is much simpler to use. This isn't that hard, but it takes a little bit of time on your side.
The basics:
All software and regedits are contained in folders called OEM packages. These are in the OEM folder.
All operating system stuff is in the SYS folder. I've also moved the shadow drivers here so you don't have to mess with them.
To make OEM packages:
Download ervius's package creator 5.4 from XDA-developers. Use this to open the cab file to convert into a package.
Copy the OEM package to the OEM folder.
Do NOT delete the OEM packages you don't want. You will choose them later in a different way.
NOTE: You can always download premade OEM packages from XDA-Develoers. There are tons of options.
If you want to make a regedit.
Create a new folder in the OEM folder and convert it into a package using Package Creator 5.4.
Open the RGU file inside with notepad
Edit like following. Note that this isn't the way to comment in regedit files:
Code:
REGEDIT4 <-----Make sure this is always the first line
------Leave one line blank here-------
[HKEY_LOCAL_MACHINE\Software\Example Software\Example Key] <----- Navigate to keys like this
"Example String" = "test" <-------- Write values with quotes. Strings are given with quote after the equal sign.
"Example Directory" = "Windows\\test.jpg" <------ Use \\ to indicate a \ between directories. Otherwise, the ROM build will not work.
"Example Number" = dword: 5000 <----- use dword: to indicate a number or hex value.
<----- You can add more reg entries after the first one. Make sure to specify a different key when needed
-----leave 2 lines at the end of file------
For Sliding Panels:
Leave ROM as it is.
For Neo interface:
Replace Chome folders and bronze folders in SYS folder with the ones attached below.
Select Neo Interface in the buildos step.
Build ROM:
start buildos.bat
when it opens packagetools+buildos, click on the buildos tab.
Click load rom and navigate and select the kitchen folder
Select which oem packages you want and then click Go.
Once it is done, close out.
Sit back and relax for a while so the batch file can build the ROM.
Self-explanatory from here.
Post any questions/problems here.
link: http://www.sendspace.com/file/ap9n8w
NOTES: The inlcuded T-Mobile Edition Package is my beta version. Feel free to build on it. You might also notice the empty placeholder folder for my N33D4SP33D Edition rom that I haven't worked on yet.
To make OEM packages:
Download ervius's package creator 5.4 from XDA-developers. Use this to open the cab file to convert into a package.
Click to expand...
Click to collapse
I found the program but get many errors when I start it up on my computer.. Im currently running Vista Ultimate. I went into control panel and changed the enviroment to emulate WinXP when the program runs and still get many errors..
Is there a vista friendly program out there or alternative available?
I'm running Vista Ultimate too and it works perfectly for me.
Attached is the version I have.
ND4SPD said:
I'm running Vista Ultimate too and it works perfectly for me.
Attached is the version I have.
Click to expand...
Click to collapse
Great! yours works thanks alot now to get my feet wet in all this lol
I got this error
'Error building default.hv and user.hv! (see imto "BuildOsX-log.Txt")
i can't see anything in there. What now. Thanks
Do you mean there's nothing in the BuildOsX-lot.txt? There should be. A few lines from the last, or the last line, there should be the registry file that messed up and on which line it messed up on. The file is given by the GUID, or that long string of numbers and letters that you see.
no, there is nothing what tell me what to do. so what should i do with that error.
i will make stick this thread.Hope next times will see some roms with this kitchen
Thanks tom. I'll make sure to post my GUI kitchen soon to let more people create ROMs a lot easier.
kormanb1123 said:
no, there is nothing what tell me what to do. so what should i do with that error.
Click to expand...
Click to collapse
what kind of things did you modify or add? Maybe I can help based on that.
I get the same error for the following:
InitRegistry FAILED in file ".\Registry\fcbf420c-04fd-478f-bd29-e4ab55973337.rgu" within a few lines of line 359.
ImportFromPackageListStrict: (RGUComp) !ERROR failed importing ".\Registry\fcbf420c-04fd-478f-bd29-e4ab55973337.rgu"
wmain: (RGUComp) !ERROR failed building DEFAULT hives
Looked through each App in the OEM folder until I found the matching rgu number, which in my case is the HTC DirectShow. Took that out of my ROM build, ran again and it states that it completed.
I think there is a problem with the directshow package. I'll check the registry entries. Until then, I think you might need to go without that.
This may sound like a stupid question, but hear me out. I have used BuildOS in the past for an Apache from PPCGeeks\PPCKitchens. Once the ROM is finished creating in that version it auto prompts to update your device.
After the ROM is done in your version, I then selected the Package Tool tab and pointed it to the "temp" directory and it did it's thing. Now I am at a loss for what to do next. I see a .nb file temp\dump\ROM directory but i don't see a .nbh file. Do I use the NBHTool even though PHOEB is not listed?
ND4SPD said:
I think there is a problem with the directshow package. I'll check the registry entries. Until then, I think you might need to go without that.
Click to expand...
Click to collapse
I'm not too worried about the directshow, I just that maybe the other guy was getting the error for the same reason so figured I would pass on my resolution.
Sorry, I guess I didn't completely read you post. For the HTC Rom Tool, use the exacalibur settings. Those are the exact same as the Juno.
all I have is o4_osxip.nb.exe in the temp folder no nbh is this the right nb. file I use with
htc tool I put exacalibur settings but don't no what to put in firmware contents
do I put o4_osxip.nb.exe in system and none in the ipl spl and splash and 0x800 radio
ok i did this
Build ROM:
start buildos.bat
when it opens packagetools+buildos, click on the buildos tab.
Click load rom and navigate and select the kitchen folder
Select which oem packages you want and then click Go.
Once it is done, close out.
Sit back and relax for a while so the batch file can build the ROM.
ok where is the rom all i have is o4_osxip.nb.exe in the temp
i have no file imgfs-new.bin in the temp all i have is 04_OSXIP.nb.exe and cecompr_nt.dll and CECompressv4.dll
and where would i look for the batch file
Thank you for your works, ND4SPD
but i can not download your kitchen, it says reached the 4G limit.
because i want to know is there any wrong method i used.
My issue is :
when buildimgfs, the total sections can not bigger than 1B200.
when i put too many files into the imgfs file, the buildimgfs will quit without any info.
but the 71M imgfs.bin have about 22000 sections.
do you have issue too ?
Is it because my PC have only 1G RAM, not enough to do the building?
@Hikey: I have that same problem too. It's the way t-mobile packaged the rom. I'm going to try using the dopod rom for the base next. It might be the PC too. I only have 1GB of RAM, maybe it isn't enough.
@kron2:
run buildos
download this zip: http://www.sendspace.com/file/xuhlc5
copy the files from the zip archive to the temp directory.
open up the cmd that's now in the temp directory.
type the following:
Code:
ImgfsFromDump imgfs-old.bin imgfs-new.bin
Sit back and relax. If this finishes without crashing like Hikey said, do this:
Code:
ImgfsToNb imgfs-new.bin 04_OSXIPN.nb os.nb -conservative
Now you can run the htccert program in the main directory of the kitchen to build the rom. When you are done making the nbh, copy it to the RUU folder and run the update utility.
DO NOT POST IN THREAD YET PLEASE
Intro
This guide was originally developed by hilaireg. It can be found here. It will be modified by me and maintained by me and hopefully users of this forum also.
The sections are intended to be followed in sequence as the last section should provide you with a final product that can be flashed to your device.
Applying Original/Cooked ROM's
You probably won't be able to apply an Original or Cooked ROM to your device as your Cellular Carrier has most certainly locked your device. You'll need to unlock your device before venturing into the world of ROM installation. These activities are beyond the scope of this guide; you can however, go to this Wiki page to learn more.
Outro
Lastly, this guide only covers the ROM cooking process; changing your device Startup Splash Screen and Radio or flashing a HardSPL are beyond the scope of this guide; you can however, go to these Wiki and/or Forum pages to learn more.
This guide is intended to help you learn how to cook your own ROM's; it will walk you through the process of extracting the contents of an Official ROM, adjusting the Page Pool, changing the Data Cache Size, and Patching the ROM to remove Certificate verification. The guide does not cover the steps required to add/remove ROM packages or port an XIP from a different ROM version or device.
Disclaimer; I take no responsibility and will not be held liable for any problems you encounter with your device before and after following this guide … flashing a ROM is done at your own risk. If you spot mistakes or inaccuracies in the guide however, please let me know so that I may correct them.
[TUT] Modding Guide to Visual Kitchen...continued
Location, Location, Location
There are many fine Kitchens out there to use; Semi-Automated Kitchens (Raphael, Da_G), Automated Kitchens (Bepe), and Visual Kitchens (Ervius). This guide uses the Ervius Visual Kitchen to assist you in learning the basics of operating a Kitchen; which ultimately, allows you to produce your own ROM.
References
Ervius..: http://forum.xda-developers.com/showthread.php?t=469420
Da_G....: http://forum.xda-developers.com/showthread.php?t=471288
Raphael.: http://forum.xda-developers.com/show....php?p=2453788
Bepe....: http://forum.xda-developers.com/showthread.php?t=467488
Inspecting the Facility
It’s important to get acquainted with any new facility; last thing you want to find out is that you don’t know where to plug your utensils or appliances. Here’s a brief tour of the facilities to get you on your way.
EXT Folder
The External packages (EXT) folder is divided into Device Specific folders and a Shared folder. The Shared folder is typically used for files (packages) that can be installed on any device. Device Specific folders are typically used for files (packages) that should only be applied to a specific type of the device – for example, the Raphael device.
Each Device Specific folder is further divided into Operating System Build Version Specific folders and a Common folder. The Common folder is typically used for files (packages) that can be installed on any Operating System build version. Operating System Build Version Specific folders are typically used for files (packages) that should only be applied to a specific build (version) of Operating System – for example, build version 20764.
Operating System Build Version Specific folders, the Common folder, and the Shared folder can be further divided into sub-folders making file (package) management simpler – for example, .\Raphael\20764\Raphael_External_Packages.
Tip
The EXT Build drop-down box in the Visual Kitchen permits selection of different Operating System Build Version Specific folders.
OEM Folder
The OEM folder can contain multiple Device Specific folders. Device Specific folders are typically used for files (packages) that should only be applied to a specific type of the device – for example, the Raphael device.
Each Device Specific folder is further divided into Locale Specific folders and a Common folder. The Common folder is typically used for files (packages) that can be installed in any locale – not specific to a language. Locale Specific folders are typically used for files (packages) that should only be applied to a specific locale – for example, 0409 (English).
Tip
The Language drop-down box in the Visual Kitchen permits selection of different Locale Specific folders.
ROM Folder
The ROM folder is divided into Device Specific folders and a Shared folder. The Shared folder is typically used for kernel system files that are compatible amongst devices. Device Specific folders are typically used for kernel system files that should only be applied to a specific type of the device – for example, the Raphael device.
The Shared folder is further divided into Operating System Build Version Specific folders. Operating System Build Version Specific folders are typically used for kernel system files that should only be applied to a specific build (version) of Operating System – for example, build version 20764.
Each Device Specific folder is further divided into Operating System Build Version Specific folders. Operating System Build Version Specific folders are typically used for kernel system files that should only be applied to a specific build (version) of Operating System – for example, build version 20764.
Tip
The XIP Build drop-down box in the Visual Kitchen permits selection of different Operating System Build Version Specific folders.
Advanced OEMXipKernel and MSXipKernel operations can be performed using the XIPPORTEREX & ROM tool.
SYS Folder
The system (SYS) folder is divided into Operating System Build Version Specific folders. The Build Version Specific folders will often contain files (packages) specific to the device DPI (Dot Per Inch) and Horizontal/Vertical display size.
Each Operating System Build Version Specific folder is further divided into a ROM DPI, ROM Resolution, and Shared folder – providing a significant amount of flexibility during ROM compilation.
The ROM DPI, ROM Resolution, and Shared folders are further divided into Locale Specific folders and a Common folder. The Common folder is typically used for system files (packages) that can be installed in any locale – not specific to a language. Locale Specific folders are typically used for system files (packages) that should only be applied to a specific locale – for example, 0409 (English).
Tip
The ROM DPI and ROM Resolution drop-down boxes in the Visual Kitchen permits selection of different Operating System Build Version Specific resolution and bit depth.
Continued
Preparing Your Facility
Before you can begin to cook your own ROM, you need to equip your facility with some Kitchen utensils. Your Kitchen is going to require a good Unicode & UTF-8 text editor; I personally use ConTEXT & Notepad. Another handy utensil to have is a comparison utility for date/file/binary comparisons; I use WinDiff & BeyondCompare. Some other utensils that you're going to require are: Microsoft ActiveSync, .NET Framework 2.x/3.x. You will also need an archive extraction utensil; I use IZArc, WinRAR, and WinZIP. You’ll also need a good Hexadecimal calculator; I use Windows Calculator (Scientific Mode).
It's also a good idea to ensure that your Kitchen remains "pest" free; common pest control services include AVG, McAfee, and Symantec anti-Virus. You'll need to add the RaphaelWrapper tool to your list of anti-virus exclusions as it may be detected as a "Generic Dropper (Trojan)".
References
CustomRUU for Raphael
http://forum.xda-developers.com/showthread.php?t=410761
To assist you in your apprenticeship, I have included a link to the Generic Visual Kitchen that I used to prepare this guide - the kitchen also includes a .DOC and .PDF format of this guide. The procedures were tested against a GSM Raphael device. I can’t confirm that these procedures will work on CDMA device ROM’s. Additionally, other device ROM’s may not be compatible with this kitchen format.
Generic Visual Kitchen (17 MB)
http://rapidshare.com/files/24006232...n_31052009.rar
You’re going to need a RUU_SIGNED.NBH file; I used the following HTC Official Generic ROM – you’ll need to extract the contents of the .EXE and .RAR/.ZIP using an archive utensil.
[ROM] [WWE] Raphael HTC 5.05.405.1 Radio Signed (52.58.25.3 0,1.11.25.01)
http://rapidshare.com/files/19396608...25.01_Ship.rar
http://www.megaupload.com/?d=0F50UM5K
For the purpose of this guide, I will assume that you have added the C:\XDA\ folder, sub-folder, and files to your anti-virus exclusion list – at the very least RaphaelWrapper.exe – and that the contents of the Generic Visual Kitchen were extracted to the following folder.
C:\XDA\MY_VISUAL_KITCHEN
The guide is divided into the following sections:
Extracting the RUU_SIGNED.NBH Contents ....... 4
Reducing the .PAYLOAD File ................... 5
Extracting the XIP.BIN Contents .............. 6
Increasing the Data Cache .................... 7
Unlocking the Paging Pool .................... 8
Disabling Certificate Checking ............... 9
Reducing the Update Loader (ULDR) Partition .. 10
Changing the Unsigned CAB Policies ........... 11
Changing the Unsigned Themes Policies ........ 12
Changing the Remote API (RAPI) Policies ...... 13
Compiling the New RUU_SIGNED.NBH File ........ 14
Flashing the RUU_SIGNED.NBH File ............. 15
Advanced Topic: XIP Porting .................. 16
Sous-Chef's TIPs ............................. 20
I will attempt to provide an overview, the list of tools required, and the process to follow in each section. As you become more comfortable (and familiar) with the activities, you will find that you can consolidate (or skip) certain outlined steps. Incidentally, you'll probably want to keep these web links open in case you need to lookup some of the terms or concepts in the guide.
Acronyms
http://wiki.xda-developers.com/index...ename=Acronyms
Glossary
http://wiki.xda-developers.com/index...ename=Glossary
Development Resources for Windows Mobile
http://forum.xda-developers.com/showthread.php?t=445396
Extracting the RUU_SIGNED.NBH 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 initiate the Ervius NBH/NB/PAYLOAD Dumper tool from within the Generic Visual Kitchen.
Upon completion, the following files will have been extracted: OS.nb, OS.nb.payload. Additionally, the Ervius NBH/NB/PAYLOAD Dumper tool creates a DUMP folder that contains all the files required.
Tools Required:
The following Ervius Visual Kitchen tool will be used for the RUU_SIGNED.NBH extraction activities.
Dump NBH/NB/PAYLOAD
Procedure
The following procedure initiates the ROM extraction activity via the Ervius NBH/NB/PAYLOAD Dumper tool built into the Generic Visual Kitchen. The extraction process can take a significant amount of time to complete.
Copy the RUU_SIGNED.NBH file to the C:\XDA\My_Visual_Kitchen\BaseROM\ folder.
Navigate to the C:\XDA\My_Visual_Kitchen\ folder.
Launch ErviusKitchen.exe.
At the multiple warning messages, click OK.
Warnings that may appear include:
Folder Not Found
Could Not Find A Part Of The Path
You Need To Specify … First
Click the Dump NBH/NB/PAYLOAD button.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\BaseROM\ folder.
Select the RUU_signed.nbh file and then click Open.
At the All Done... Nbh/nb/payload Dumped and ''Kitchen'' created Successfull!!! message, close the Ervius Visual Kitchen application.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\DUMP\ folder.
Move the sub-folders (and content) to the C:\XDA\MY_VISUAL_KITCHEN\ folder.
At the Confirm Folder Replace message, click Yes To All.
At the Confirm File Move message, click Yes To All.
Tip
The C:\XDA\MY_VISUAL_KITCHEN\BaseROM\Dump\ folder should be empty at this point – and can be removed.
Reducing the .PAYLOAD File
At this point, the Ervius NBH/NB/PAYLOAD Dumper tool has removed the contents of the IMGFS (OEM, SYS) from the .PAYLOAD file in preparation for changes to the ULDR and XIP. Removing the IMGFS (OEM, SYS) contents from the .PAYLOAD file reduces the size of the .PAYLOAD file making it easier to work with.
The Ervius NBH/NB/PAYLOAD Dumper tool has placed a copy of the reduced .PAYLOAD file in the C:\XDA\My_Visual_Kitchen\ROM\Raphael\ folder.
Tip
Advanced .PAYLOAD file operations can be performed using the XIPPORTEREX & ROM tool.
References
[TUT] Manual Full XIP Porting (& MANY MORE TUTORIALS)
http://forum.xda-developers.com/showthread.php?t=438676
Extracting the XIP.BIN Contents
The Execute-in-place (XIP) region is an area where an application can execute code directly from ROM rather than loading it from RAM. It is possible to use the XIP.BIN contents from a newer version of a ROM from a different device or a newer operating system. This is typically done by chefs who are looking for the most recent versions of system files from a specific device or version of an operating system – you'll eventually do the same.
At this point, the Ervius NBH/NB/PAYLOAD Dumper tool has extracted the contents of the XIP.BIN and placed a copy of the file in the C:\XDA\My_Visual_Kitchen\ROM\Raphael\ folder.
For the purposes of this guide, we will be using the same version of the system files.
Tip
Advanced XIP.BIN file operations can be performed using the XIPPORTEREX & ROM tool.
You can change the ROM Date/Version using the XIPPORTEREX & ROM tool.
References
[TUT] Manual Full XIP Porting (& MANY MORE TUTORIALS)
http://forum.xda-developers.com/showthread.php?t=438676
XIP Porting Guide
http://forum.xda-developers.com/showthread.php?t=379598
Increasing the Data Cache
File caching improves performance and also improves power management; when an application accesses physical storage, the storage device uses much more power. The less often physical storage is accessed, the longer storage devices spend in a low-power state.
By increasing the DataCacheSize registry value, you effectively improve the performance of applications that are file system intensive such as database and mapping applications – which results in lower physical storage access requirements. Drastically increasing the DataCacheSize however, may have adverse effects and slow the device down as a result of longer auto-compaction processing.
For the purposes of this guide, we are going to increase the current DataCacheSize value from 4MB to 8MB.
Tools Required
The following tools are required to adjust the DataCacheSize value.
Unicode Text Editor
Hexadecimal Calculator
Procedure
The following procedure will change the current DataCacheSize value of 4MB to 8MB.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\ROM\Raphael\20764\OEMXipK ernel\ folder.
Launch a text editor and open the BOOT.RGU file.
Search for the following registry key entry:
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\ FLASHDRV\FATFS]
Locate the following registry value underneath the key:
"DataCacheSize"=dword:00000800 ;2048 sectors(2048*2048=4MB)
Change the registry value to the following:
"DataCacheSize"=dword:00001000 ;4096 sectors(4096*2048=8MB)
Save the BOOT.RGU file.
Exit the text editor.
Tip
Make a backup copy of the BOOT.RGU file before editing; delete the backup file when done.
Disabling Certificate Checking
During the startup process of your device, the operating system verifies that each system file against an internal certificate store to ensure that each file is signed with a trusted certificate; if the system file is not signed, the file is ignored.
To allow execution of non-signed system files, we need to disable the internal certificate store verification. Once disabled, the operating system will trust all code installed regardless of its signature. This provides more control over the code that gets installed on the device – you no longer need to load and manually sign additional certificates such as those from the sdkcerts.cab into the device root certificate store.
For the purposes of this guide, we are going to apply a change to the kernel binary file which will disable the internal certificate store verification.
Tools Required
The following tools are required to disable the internal certificate store verification.
Unicode Text Editor
Procedure
The following procedure will change the kitchen_build_rom.bat disable the internal certificate store verification.
Launch a text editor.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\Tools\ folder and open the kitchen_build_rom.bat file.
In the Find (Search) box, type:
implantxip
Add the following implantxip command line option:
-NoCert
Select the Save option in your text editor.
Select the Exit option in your text editor.
Tip
Spaces are usually required between command line options; the command line option should only appear once.
You can add output logging to file by adding the following command instructions to the end of a command line:
| ..\tools\mtee /+ ..\%LOG_FILE%
Newer versions of Ervius Visual Kitchen provide built-in logging and an Option button to disable the Certificate Store verification.
Unlocking the Paging Pool
The Paging Pool serves as a limit on the amount of memory that can be consumed by pageable data. It includes an algorithm for choosing the order in which to remove pageable data from memory. Pool behaviour is typically determined by the OEM – Microsoft sets a default value for the paging pool, but the OEM can change that value. Applications do not have the ability to set the behaviour for their own executables or memory-mapped files.
For the purposes of this guide, we are going to apply a change to the kitchen_build_rom.bat to set the Paging Pool size (initially set to 6MB) to a new size of 8MB.
Tools Required
The following tools are required for the Paging Pool unlock activities.
Unicode Text Editor
Procedure
The following procedure will change the kitchen_build_rom.bat to set the Paging Pool size during ROM compilation.
Launch a text editor.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\Tools\ folder and open the kitchen_build_rom.bat file.
In the Find (Search) box, type:
implantxip
Add the following implantxip command line option:
-PP 8
Select the Save option in your text editor.
Select the Exit option in your text editor.
Tip
Spaces are usually required between command line options; the command line option should only appear once.
You can add output logging to file by adding the following command instructions to the end of a command line:
| ..\tools\mtee /+ ..\%LOG_FILE%
Newer versions of Ervius Visual Kitchen provide built-in logging and an Option button to set the Paging Pool size.
Reducing the Update Loader (ULDR) Partition
The boot loader can accommodate multiple execute-in-place (XIP) regions where individual modules can be updated after the initial operating system image file has been written to the device – the ULDR is an example of this use. The Update Loader (ULDR) provides Flash-Over-The-Air (FOTA) capabilities permitting your carrier to issue changes such as Hotfixes over the cellular network – generally, most carriers avoid this practice.
As this is generally undesirable in a cooked ROM, since we are making modifications that a carrier Hotfix might roll back, we will reduce the partition. This will cause the device to report insufficient ULDR space to the carrier FOTA request … and the freed up space becomes available for our uses.
For the purposes of this guide, we are going to apply a change to the kitchen_build_rom.bat to reduce the ULDR – effectively providing approximately 3 MB of space.
Tools Required
The following tools are required to disable the internal certificate store verification.
Unicode Text Editor
Procedure
The following procedure will change the kitchen_build_rom.bat disable the internal certificate store verification.
Launch a text editor.
Navigate to the C:\XDA\MY_VISUAL_KITCHEN\Tools\ folder and open the kitchen_build_rom.bat file.
In the Find (Search) box, type:
implantxip
Add the following implantxip command line option:
-uldr
Select the Save option in your text editor.
Select the Exit option in your text editor.
Tip
Spaces are usually required between command line options; the command line option should only appear once.
You can add output logging to file by adding the following command instructions to the end of a command line:
| ..\tools\mtee /+ ..\%LOG_FILE%
Newer versions of Ervius Visual Kitchen provide built-in logging and an Option button to enable or disable ULDR reduction.
Guide is not complete
The guide is not complete yet so PLEASE DO NOT POST IN THE THREAD until I complete it.
Thanks!
This is a work in progress and will be done some time today. Please do not post in thread.
At0mAng said:
Preparing Your Facility
………………
Generic Visual Kitchen (17 MB)
http://rapidshare.com/files/24006232...n_31052009.rar
…………
Click to expand...
Click to collapse
Hi At0mAng,thanks you tutorial. This link was deaded, can you repost or fixed it? thanks again.
Bumped as id really like to see the rest of this too =D
Can you please re-up the files Atom?
Wow Atom, fantastic work, must have cost you too much time to write all that, and it's well strucutred too. Thanks and keep up the good work