Go Back   xda-developers > Windows Mobile Development and Hacking > Windows Mobile Software Development


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th November 2005, 02:25 AM
mamaich mamaich is offline
Senior Member
 
Join Date: Apr 2004
Posts: 939
Default Beta: WM5 ROM editing tool

I've made a set of tools that can assist in cooking your own WM5 ROMs. These tools were tested only on BlueAngel devices. They should also work on Himalaya. Universal and Wizard support is also present, but it is untested, so the tools may crash or turn your device into brick. But it is possible to extract files from universal/wizard ROMs and use them on other devices.

I've attached 2 archives - make_hv.rar, a tool from Platform Builder that can be used to recreate .HV files (they contain default and boot registry), and imgfs_tools.rar - these tools should be used to edit WM5 IMGFS partition.
With these tools and http://forum.xda-developers.com/viewtopic.php?t=33321 (it can edit WM5 boot XIP partition) it is possible to replace/add/delete any file in WM5 ROM.

Usage:
Code:
prepare_imgfs.exe
  Splits nk.nba into imgfs_raw_data.bin and imgfs_removed_data.bin.
imgfs_raw_data.bin - contains raw IMGFS data
imgfs_removed_data.bin - contains extra data (something like FAT table).
Usage:
  prepare_imgfs.exe nk.nba [-nosplit] [-mpx200] [-acer]
Use "-nosplit" for HTC Wizard and Universal ROMs that don't contain extra 
blocks of data. In this case imgfs_removed_data.bin would be empty.


make_imgfs.exe
  Reverse of prepare_imgfs. Combines imgfs_raw_data.bin and imgfs_removed_data.bin
into nk.nba file. Use -nosplit if it was specified for prepare_imgfs.exe.
Usage:
  make_imgfs.exe nk.nba [-nosplit]
The nk.nba file would be used as a template, its contents would be overwritten.


viewimgfs.exe
  Dumps the contents of imgfs_raw_data.bin to "dump" subdirectory. Files are 
dumped as is, modules as directories. File time and attributes are preserved.
If RecMod.exe is present in the current directory, all modules are 
reconstructed as working DLLs/EXEs and placed in the corresponding subdirectory.
Tool creates dump_MemoryMap.txt with address ranges occupied by modules.
Usage:
  viewimgfs.exe imgfs_raw_data.bin

RecMod.exe
  Reconstructs a module dumped as directory to a working state. Rebuilds 
relocations information, and tries to guess section names.
Usage:
  RecMod.exe [path to module directory]


BuildImgfs.exe
  Reverse of viewimgfs. Reconstructs imgfs_raw_data.bin and imgfs_removed_data.bin
from files in "dump" directory. Overwrites contents of imgfs_raw_data.bin/imgfs_removed_data.bin
files. Does not check for errors or end of free space. Approximate free space
left is displayed when program is finished. In case of error contents of bin
files is undefined.
Usage:
  BuildImgfs.exe
It would overwrite imgfs_raw_data.bin/imgfs_removed_data.bin in current directory.


DelFile.exe
  Deletes one file or module from imgfs_raw_data.bin. Wildcards are not supported.
Usage:
  DelFile.exe filename.ext
Uses imgfs_raw_data.bin from current directory. Does not check for errors.


AddFile.exe
  Adds one file to imgfs_raw_data.bin. Would reuse space freed by DelFile.
Usage:
  AddFile.exe filename.ext
Uses imgfs_raw_data.bin from current directory. Does not check for errors.


The typical process should be:
prepare_imgfs.exe nk.nba
viewimgfs.exe imgfs_raw_data.bin
...modify "dump" directory as you need...
BuildImgfs.exe
make_imgfs.exe nk.nba

or
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


Of cause you'll need a tool to convert NBF<->NBA files. SD-card images can be also used instead of NK.NBA file, but this was not tested!
Troubleshooting.
In case of invalid ROM the tools would crash without saying anything. In this case they may destroy the contents of input files.

Use these tools at your own risk! They may make your device completely unusable! Always make an SD-card backup of your ROM and Extrom!
The worst case I had during tests was complete destroying of DOC partition on my device. I had to flash WM2003 OS, repartition DOC from there and this fixed the device. Of cause this method cannot be used on Wizard or Universal.

I've published these tools so that someone could integrate BA patches into a ROM or play with cooking own ROMs.


edited 12.12.2005. AddFile/BuildImgfs should work on Universal/Wizard ROMS (i.e. roms with empty imgfs_removed_data.bin file).

edited 15.01.2005. Fixed a major bug found by TofClock. Short name of files with filename length 24 chars or longer (like "instmsgrresources.96.dll") was incorrectly generated and in some cases they were inaccessible by OS.

edited 05.02.2005. Added several checks so that viewimgfs.exe does not crash on incorrectly patched ROMs (MPX200). Don't use buildimgfs.exe on such ROMs.

edited 30.03.2006. Added RecMod tool that reconstructs modules dumped as directories to a working DLL. So reusing modules from other ROMs is now much easier. Added updated prepare_imgfs.exe with support of ACER N300 ROM (thanks to Tuatara).

edited 12.07.2006. Added source code of prepare_imgfs/make_imgfs tools, so anyone can add the support of new devices.

edited 25.10.2006. Published the source code on my site. The code is ugly and is not commented at all. Don't ask me how to compile or use it!


I've stopped working on this project. There would be no updates.
Complete source code is available on my site.
Attached Files
File Type: rar make_hv_111.rar (54.2 KB, 16207 views)
File Type: rar imgfs_tools_182.rar (123.1 KB, 104426 views)
File Type: rar prepare_imgfs_src.rar (1.4 KB, 9305 views)
__________________
HTC Universal
128 Mb RAM
WM 6.1 build 19xxx

Last edited by mamaich; 25th October 2006 at 12:53 AM..
Reply With Quote
Sponsored Links

  #2  
Old 30th November 2005, 02:47 AM
clustered clustered is online now
Senior Member
 
Join Date: Oct 2005
Location: Kuala Lumpur
Posts: 538
Default

mamaich,

can this be done on Alpine device??? Alpine that known as faster Himalaya also should be running WM5.....

thanks
Reply With Quote

  #3  
Old 1st December 2005, 12:47 PM
baniaczek baniaczek is offline
Senior Member
 
Join Date: Jul 2005
Location: Warsaw
Posts: 344
Default

Looks nice :)

Some questions:

1. AddFile:
Can I add single file like
Code:
AddFile something.exe
or have I use 'modules as directories' [like directories dumped with ViewImgfs]

2. AddFile:
Is it possible to add files into directories not in \Windows? For example: "\Program Files\Something\something.exe"

3. Is it possible to modify the kernel? Can I extract and replace \Windows\fatfsd.dll?

Thanks in advance.
__________________
Qtek9090 (BlueAngel): WM6.1 19202 remake (RC1)
--
baniaczek
Reply With Quote

  #4  
Old 1st December 2005, 02:36 PM
efjay efjay is offline
Senior Member
 
Join Date: Nov 2004
Posts: 573
Default

mamaich, would for example replacing the internet explorer exe be enough to get it to render gifs correctly? Or are extra dll needed? Also is it necessary to use the other tool you linked to as it appears your tool can add and delete files itself? thanks

Edit: Forgot to add, thanks for your hard work.
__________________
Pharos Traveler 137
Reply With Quote

  #5  
Old 1st December 2005, 03:12 PM
ramram's Avatar
ramram ramram is offline
Senior Member
 
Join Date: Mar 2004
Location: Beirut
Posts: 474
Default

mamaiiiiichhhhh I was waiting those tools gr8 work mate, can you upload the modified rom that you already customized for testing it?
__________________
I'm back to the loyal device....
Reply With Quote

  #6  
Old 2nd December 2005, 07:17 AM
mamaich mamaich is offline
Senior Member
 
Join Date: Apr 2004
Posts: 939
Default

Quote:
Originally Posted by baniaczek
1. AddFile:
Can I add single file like
Code:
AddFile something.exe
You can use both methods, but subdirs can be used only if you are really know what you are doing (i.e. you know all addresses of each section and 100% sure that they don't overlap some other modules and you've edited .VM and .ROM files). In most cases you should add EXE/DLL files as normal files.
Quote:
Is it possible to add files into directories not in \Windows? For example: "\Program Files\Something\something.exe"
All files are placed into \windows dir and then moved by coldinit to subdirs according to instructions in initflashfiles.dat. Of cause you can modify that file as you like.
Quote:
3. Is it possible to modify the kernel? Can I extract and replace \Windows\fatfsd.dll?
Boot part can be edited with http://forum.xda-developers.com/viewtopic.php?t=33321

ramram
There is no ROM I can release for public testing. I would not integrate my patches into the ROM, I'm working on adopting Wizard's ROM for our devices. But everything is on too early stage, I have to combine registry settings, ROM files, find and patch drivers for ROMs to work, etc. And Wizard's ROM is larger than ours, some files should be removed.
__________________
HTC Universal
128 Mb RAM
WM 6.1 build 19xxx
Reply With Quote

  #7  
Old 2nd December 2005, 07:18 AM
mamaich mamaich is offline
Senior Member
 
Join Date: Apr 2004
Posts: 939
Default

Quote:
Originally Posted by efjay
mamaich, would for example replacing the internet explorer exe be enough to get it to render gifs correctly? ...
I don't have any problems with IE.
__________________
HTC Universal
128 Mb RAM
WM 6.1 build 19xxx
Reply With Quote

  #8  
Old 2nd December 2005, 10:42 AM
ramram's Avatar
ramram ramram is offline
Senior Member
 
Join Date: Mar 2004
Location: Beirut
Posts: 474
Default Ic

mamaich,
I'll wait you then until you finish the wizard rom adoptation, I'll be glad trying it on the BA if you don't mind, consider my device for development purpose and beta testing if needed.

Concernig the IE, I have the same problems as Efjay mentioned earlier.
Thank you
__________________
I'm back to the loyal device....
Reply With Quote

  #9  
Old 2nd December 2005, 02:09 PM
baniaczek baniaczek is offline
Senior Member
 
Join Date: Jul 2005
Location: Warsaw
Posts: 344
Default

@mamaich

Thank you for the answer. And thank you for your hard work [sinze Siemens SL45i].
__________________
Qtek9090 (BlueAngel): WM6.1 19202 remake (RC1)
--
baniaczek
Reply With Quote

  #10  
Old 2nd December 2005, 07:11 PM
efjay efjay is offline
Senior Member
 
Join Date: Nov 2004
Posts: 573
Default

Quote:
Originally Posted by mamaich
Quote:
Originally Posted by efjay
mamaich, would for example replacing the internet explorer exe be enough to get it to render gifs correctly? ...
I don't have any problems with IE.
mamaich, the problem is with viewing gif files. On this site using PIE i cannot see the quote button and other buttons below a post. Even manually opening a gif file on the BA opens PIE with a blank page.
__________________
Pharos Traveler 137
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:06 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.