So, I hope this will help noobs: Things you need to know when WM5 ROM Cooking for Hima using mamaich tools:
xda2nbftool.... necessary to decrypt/encrypt ROM file: nk.nbf
Decrypt HIMA ROM
- Code: Select all
xda2nbftool nk.nbf nk.nba 0x20040304
[size=1em] [/size]
Encrypt HIMA ROM
- Code: Select all
xda2nbftool -c -u NK.nba
xda2nbftool -x NK.nba NK.nbf 0x20040304
[hr] Using IMGFS tools by mamaich:
Method I wrote:
- Code: Select all
prepare_imgfs.exe nk.nba
DelFile.exe filename.ext
AddFile.exe filename.ext
...you may add/delete as many files as you need...
make_imgfs.exe nk.nba
NOTE: To add/delete a file with filename separated by spaces: (i.e. Pocket Plus.lnk)
Addfile.exe Pocket" "Plus.lnk
Method II wrote:
- Code: Select all
prepare_imgfs.exe nk.nba
viewimgfs.exe imgfs_raw_data.bin
...modify "dump" directory as you need...
BuildImgfs.exe
make_imgfs.exe nk.nba
NOTE:
1. Only IMGFS content of nk.nbf will be shown in dump directory. XIP part requires ROM Master.
2. If recmod.exe is present in the same directory as viewimgfs.exe, modules will be converted into files from within the module directories.
3. To manually convert modules into files use
- Code: Select all
[b]recmod.exe modulename filename[/b]
4. There is currently no reverse tool as of the moment: converting files into modules.
Special Note: If your desktop PC has limited RAM, there is a tendency for it to be screwed; such that, when you keep on using these tools, it will sometimes generate a defective ROM. To avoid this, simply restart you PC. Better yet, plan all the things you need to modify and place it on a batch file.
You can download and learn more of these tools by mamaich at http://forum.xda-developers.com/showthr ... ight=imgfs
[hr] Registry editing tools:
Pocket PC Tools wrote:TaskManagerby dotFred
Resco File Explorer with registry plugin
PHM registry editing tool
Note: You can use these tools to edit/import/export PPC registry files
Desktop PC Tools wrote:Registry Workshop (info by TomasNM)
Notes:
1. You can use this to do registry comparison before and after installing a .cab file on PPC.
2. You can use this program for editing in conjunction with the attached scripts found in Workshop.zip
default.hv - This is where [HKEY_CLASSES_ROOT] and [HKEY_LOCAL_MACHINE] entries go.
user.hv - This is where [HKEY_CURRENT_USER] entries go.
RGUCOMP - Tool to compile/decompile the PPC registry hive.
Decompile Registry wrote:
- Code: Select all
SET _FLATRELEASEDIR=.
RGUCOMP -o default.hv -nologo > boot.rgu
Notes for MS Word editor:
1. Edit boot.rgu with MS Word to preserve registry entries.
2. First line must contain REGEDIT4
3. There should be one entry per line
4. Last line should be an empty line
5. Save file as UNICODE
Notes for Registry Workshop as edtor:
1. decompile registy hive (default.hv / user.hv) using RGUCOMP
2. name the file as ms.reg
3. execute workshop.vbs in the same directory as ms.reg
4. edit ms.reg with Registry Workshop
5. save changes
6. execute bootrgu.vbs in the same directory as ms.reg
7. boot.rgu will be generated
8. compile registry hive using RGUCOMP
* When using Notepad.exe and Wordpad.exe in editing boot.rgu and saving to UNICODE, it sometimes causes two entries in a single line resulting in compilation errors. You can use ansi2unicode to convert your text file to UNICODE or the vbscript contained in NewReg.zip. The vbscript will look for boot.rgu file, it will automatically add REGEDIT4 into first line, and save the boot.rgu into UNICODE.
Compile Registry wrote:
- Code: Select all
SET _FLATRELEASEDIR=.
RGUCOMP -b
Note: This will look for boot.rgu file in UNICODE format and generate boot.hv
Registry Tweaks wrote:You can explore on registry tweaks to fully customize your ROM :)
LOCATION: USER.HV
Setting the default SoftKeys
- Code: Select all
[HKEY_CURRENT_USER\Software\Microsoft\Today\Keys\113] -> Right
"Open"="\\windows\\FlightMode.exe" -> program
@="FlightMode" -> name to appear
[HKEY_CURRENT_USER\Software\Microsoft\Today\Keys\112] -> Left
@="Messaging"
"Open"="\\windows\\tmail.exe"
Default Volume Levels
- Code: Select all
[HKEY_CURRENT_USER\ControlPanel\Volume]
"Ringer"=dword:ffffffff --> f-loudest / 9-default / 1-lowest
"Volume"=dword:ffffffff
Backlight Default Levels
- Code: Select all
[HKEY_CURRENT_USER\ControlPanel\BackLight]
"BrightNess"=dword:00000004
"ACTimeout"=dword:0000003c
"ACTimeoutUnchecked"=dword:00000000
"BatteryTimeoutUnchecked"=dword:00000000
"BatteryTimeout"=dword:0000001e
"OnOff"=dword:00000001
"OnOffAC"=dword:00000001
"OnOffBatt"=dword:00000001
"AutoMode"=dword:00000000
"ACBrightness"=dword:0000000a
"BacklightOnTap"=dword:00000001
"ACBacklightOnTap"=dword:00000001
"DefaultBrightness"=dword:0000000a
"DefaultACBrightness"=dword:0000000a
"MAXBrightnessScale"=dword:0000000a
"MAXACBrightnessScale"=dword:0000000a
*It is best to set the desired levels on you PPC, then export the registry, and copy settings like the above to your custom registry.
Default Ringtone List
- Code: Select all
[HKEY_CURRENT_USER\ControlPanel\Sounds]
"Ringtones"=hex(7):57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,44,00,65,00,\
66,00,61,00,75,00,6c,00,74,00,20,00,2e,00,77,00,6d,00,61,00,00,00,4a,00,69,\
00,67,00,20,00,2e,00,77,00,6d,00,61,00,00,00,4f,00,6c,00,64,00,50,00,68,00,\
6f,00,6e,00,65,00,20,00,2e,00,77,00,6d,00,61,00,00,00,52,00,65,00,77,00,69,\
00,6e,00,64,00,69,00,6e,00,67,00,20,00,2e,00,77,00,6d,00,61,00,00,00,00,00,\
00,00
*It is best to use registry editing software to enter your list then export the key to generate the hex values.
LOCATION: DEFAULT.HV
Disable the Power Battery Icon at system tray
- Code: Select all
[HKEY_LOCAL_MACHINE\Services\Power]
"Flags"=dword:00000004
Disable the Comm Manager Icon at system tray
- Code: Select all
[HKEY_LOCAL_MACHINE\Services\WirelessMgr]
"Flags"=dword:00000004
Today Items
- Code: Select all
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items"Device Lock"]
"Order"=dword:00000003 --> Order in relation to other Today Items
"Enabled"=dword:00000001 --> 1-enabled / 0-disabled
* Other Today items include: "Date", "Owner Info", "Messaging", "Tasks", "Calendar"
Enable/Disable Transcriber
- Code: Select all
[HKEY_CLASSES_ROOT\CLSID\{F0034DD0-2AD4-11d1-9CB0-E84BE8000000}\IsSIPInputMethod]
@="1" --> 1-Enable / 0-Disable
Enable/Disable Letter Recognizer
- Code: Select all
[HKEY_CLASSES_ROOT\CLSID\{42429690-ae04-11d0-a4f8-00aa00a749b9}\IsSIPInputMethod]
@="0"
Enable/Disable Block Recognizer
- Code: Select all
[HKEY_CLASSES_ROOT\CLSID\{42429691-ae04-11d0-a4f8-00aa00a749b9}\IsSIPInputMethod]
@="0"
Default Time Zone and Starting Time
- Code: Select all
[HKEY_LOCAL_MACHINE\System\State\DateTime]
"Time"=hex:00,3a,24,af,55,10,c7,01
"Timezone Bias"=dword:fffffe20
*Do the method similar to backlight registry entries.
[hr] Creating link files or PPC shortcuts of programs using any text editor (as shown on Programs window)
File Content Format wrote:
- Code: Select all
XX#"\path\filename.ext"?"\path\iconfile.ext,n"
where:
XX = no. of characters after #
n = icon offset on iconfile (iconfile is optional)
Note: Save the file as Filename.lnk
Sample Link File 1 wrote:
- Code: Select all
19#"\Windows\pword.exe"
Note: The icon contained in pword.exe will be shown
Sample Link File 2 wrote:
- Code: Select all
25#"\Windows\pword.exe?\Windows\IcoRes.dll,004"
Note: This link file will activate pword.exe, but will show an icon stored in IcoRes.dll offset 004.
[hr]initflashfiles.dat is used for putting(copying) files in the right path and/or creating subdirectories during hard reset
* Normally all files added to ROM are placed \Windows folder. You need to modify initflashfiles.dat to define were to put the files, copy and rename the files, and create subdirectories. The initflashfiles.dat will be parsed during a hard reset. So, if your device happen to boot up after a ROM flashing with nothin in the start menu other than Today and/or coldinit; chances are there is a defect in initflashfiles.dat and/or the default.hv You can still access the contents of PPC at this state using ActiveSync though.
initflashfiles.dat Sample Entries wrote:To create a sub-directory not at root level
- Code: Select all
Directory("\path"):-Directory("new directory")
To create sub-directory at root level
- Code: Select all
root:-Directory("new directory")
To copy and rename Filename.Ext to \Program Files directory
- Code: Select all
Directory("\Program Files"):-file("Filename2.Ext","\windows\Filename.Ext")
** ASSUMPTION IS MADE THAT \Program Files ALREADY EXIST PRIOR TO COPYING.
Note: After editing initflashfiles.dat using notepad.exe, you need to hex edit the first two entries with a hex editor. You can replace the first two entries as 3B 00; otherwise, the file could not be parsed after hard reset.You may want to use EditPad Lite as suggested by llbasha it's a text editor that easily converts ANSI and UNICODE format without breaking the structure; so, no more hex editing is needed.
[hr]Extracting contents from CAB files
MSCEInf wrote:I just found a very nice progy to do CAB extraction, this is called Win CE CAB Analyzer It gives you the ease of looking at both OLD and NEW cab file contents and extraction. It even gives you a report on a per CAB basis so you can do some tracing were files go and what registry entries are added at installation. Best of all its FREEWARE!
Pocket PC Installation Creator wrote:Now, if you want to create your own CAB, we can also use this FREEWARE Installation Creator. This is handy for making some patch, or tweaking/modifying your existing CABs to install the way you want it to. (i.e. force to install everything on storage card)
[hr]
File Compression using UPX 2.91 Beta wrote:Compressing PPC Executable files
- Code: Select all
UPX --lzma -9 --strip-relocs=0 --compress-icons=0 filename.ext
where: EXT may be EXE or DLL / -9 maximum compression / -1 least compression
Decompressing the files back to original state
- Code: Select all
UPX -d --strip-relocs=0 filename.ext
BIG THANKS to Laszlo Molnar, co-author of UPX.(tu)
[hr]Creating Custom Icons
Tools: Microangelo Toolset and Resource Tuner wrote:If you want your programs to have different icons, you can use create linksto point to your custom made Icon resource file generated by Librarian from Microangelo Toolset. You can also pick up existing Icons from PHM tools, shell32.dll from Windows XP, and shellres.96.dll from WM5 PPC to be incorporated in your custom resource file.
Note: Currently, these tools could not directly edit and replace the existing icons of the PPC executables.
Custom Folder Icons in Programs Window wrote:1. Create a link file named icon.lnk
2. Place the file inside the desired folder
3. Change the file attributes to hidden
[hr]Changing Boot Splash Screens
1st and 2nd Boot Splash Screen wrote:1. Create a jpeg/bmp file with 240px (w) x 320px (h) @ 72dpi resolution
2. Convert jpeg/bmp file into splash1.nb & splash2.nb using madkat nb_image converter tool
3. Edit the Boot Splash Installer cab file and replace splash1.nb / splash2.nb with your own.
4. Installing the cab file on your HIMA will replace the first two boot splash screens.
Third Boot Splash Screen wrote:The third boot splash screen is named welcomedhead.96.png Simply replace it with an image having 320px (w) x 320px (h) @ 72dpi PNG file. ONLY THE FIRST 240px width are displayed on screen.
Banner Image During Setup after Hard Reset wrote:Replace blankbanner.96.gif with an image 320px (w) x 60px (h) @ 72dpi
[hr]
WM5 Themes wrote:To easily create your own Windows Mobile Themes, you can use ThemeGenCE
Read the extensive help file and find out how themes are made; so, you can incorporate it into your ROM.
[hr]
Custom ROM Memory Sizes wrote:Ramdisk + Program Memory = 128MB You just need to set Program Memory and Ramdisk values first. Pagepool will automatically subtract from Program Memory.
1. You need hex editor capable of editing large files like: UltraEdit, Advanced Hex Editor, etc.
2. Decrypt nk.nbf
3.Computing Program Memory Size wrote:128MB Program Memory = 128*1024*1024 = 134217728 (decimal) = 8000000 (hex)
64MB Program Memory = 64*1024*1024 = 67108864 (decimal) = 4000000 (hex)
4. Hex edit nk.nba and locate the following hex entry:
- Code: Select all
FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 08 ---> 128MB
FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 04 ---> 64MB
* Please note of the reversed order of hex numbers
5.Computing RAMDISK Size wrote:32MB Ramdisk = 32*1024*1024 = 33554432 (decimal) = 2000000 (hex)
96MB Ramdisk = 96*1024*1024 = 100663296 (decimal) = 6000000 (hex)
6.Computing RAMDISK Address wrote:2432 - 16MB = 2416*1024*1024 = 2533359616 (dec) = 97000000 (hex) ---> Address of 16MB Ramdisk
2432 - 32MB = 2400*1024*1024 = 2516582400 (dec) = 96000000 (hex) ---> Address of 32MB Ramdisk
7. Change Registry Entries for RAMDISK (sample)
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RAMDisk] ---> 16 MB RAMDisk
"Size"=dword:01000000
"Address"=dword:97000000
8. To set Pagepool, hex edit nk.nba at address 0×00404650 and change the following entries:
- Code: Select all
64 00 00 00 D8 FF 21 80 01 00 00 00 00 00 50 00 --> 5MB PagePool(Default)
64 00 00 00 D8 FF 21 80 01 00 00 00 00 00 00 01 --> 16MB PagePool
64 00 00 00 D8 FF 21 80 01 00 00 00 00 00 80 01 --> 24MB PagePool
64 00 00 00 D8 FF 21 80 01 00 00 00 00 00 00 02 --> 32MB PagePool
[hr]Customization of your DEVICE after a hard reset can be done using Autroun package described by buzz here This stuff will automatically install a custom theme, run some cab installation, execute a ppc program, etc. right after a hard reset.
[hr][size=large]ENJOY ROM COOKING![/size]
I may have missed out some things, please feel free to fill in the details.
Thank you.




