Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,480 Members 52,953 Now Online
XDA Developers Android and Mobile Development Forum

DIY your ROM

Tip us?
 
gmap
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Nov 2005
Default DIY your ROM

Hi,
I write some code that can modify the ROMs, it can save your time to add and delete files by hand.

RomMaster V2.0 Beta
Usage: RomMaster [options] imagefile
-d[m] <dfile> - delete file
replace file/module together with -a option
'm' delete module, deleting module isn't suggested
-a[c] <afile> - add file into the rom
'c' means use compress(need CECompressv4.dll)
-o <ofile> - output imagefile name
-v <0~9> - print info, 0 detail, 9 only show errors, default is 5
-w <5> - 5 is 2005, default is 2003&SE
-x - only save XIP(OS) data
-s <0x...> - Fix XIP start address(Hex)
-e <0x...> - Fix XIP end address(Hex)
In replace mode, 'c'&'m' is useless

It is now 2.0 Bata Release.
You can delete file/modules you don’t like from the ROM.
RomMaster –d “filename” –o “newROMname” “ROMname”
You can add files into the ROM.
RomMaster –a “newfilename” –o “newROMname” “ROMname”
You can replace file in the ROM
RomMaster –d “filename” –a “newfilename” –o “newROMname” “ROMname”
“newfile”’s size should be the same or small than the file you want to replace, new file will occupy the same space as the old one.

I test some ROM in my SP; include SDA, Dopod 575 & 585. I only tested one 2005 ROM. Replace module may don’t work, I am still working on it.

Before you burn the image generated by the tool, make sure you finish follow step:
1. RomMaster –o “TestROM” “SrcROM”
2. Do binary compare “SrcROM” with “TestROM”
a) If they are 100% same, I think you can safely use this tool.
b) If they are 99% same, you should be careful, make sure you only burn the OS part. Because some ROM are modified by someone before, there are maybe some useless data in the ROM, only burn the OS part won’t damage your SP.
c) Else, the “SrcROM” may contain some unknown structure or data, the “TestROM” may won’t work, don’t try burning it into you SP. If you want to modify it, tell me where I can find the ROM, if I am free, I can give some help.
3. I only tested one 2005 ROM, its structure isn’t very correct, and I think that ROM is extracted form emulation ROM. So if 2005 ROM isn’t 100% same, don’t try and be careful even they are 100% same.
Attached Files
File Type: zip rommaster.zip - [Click for QR Code] (70.8 KB, 7124 views)
File Type: rar rommaster.rar - [Click for QR Code] (62.9 KB, 4784 views)
 
ncruz
Old
#2  
Senior Member
Thanks Meter 1
Posts: 230
Join Date: Jul 2003
Location: Lisboa, Portugal
This is great!!!

Going to try it!
 
oltp
Old
#3  
oltp's Avatar
Senior Member
Thanks Meter 22
Posts: 1,486
Join Date: Oct 2005
ncruz,

I'll wait for your experience, cause if this is working we can all save space by directly burning upgraded cameras etc into the rom. will save me at least 1MB ram or storage.

The tools sounds great gmap.
Google Nexus 7 32GB
Wolfgang AS-AT50SE
 
mamaich
Old
#4  
Recognized Developer
Thanks Meter 214
Posts: 1,150
Join Date: Apr 2004

 
DONATE TO ME
Default Re: DIY your ROM

There already exists MKROM tool - http://www.xs4all.nl/~itsme/projects/xda/romtools.html
it is 100% working with WM2003/2003SE devices. But it is rather inconvenient.
I'll test your "-w 5" option on a real device. Real WM5 device has one XIP kernel section with only few modules and about 1Mb free space. All other data is kept in IMGFS partition, I'm currently working on a tool that would work with it.
And one question. When you add new files to ROM, do you add them to a new XIP or extend the existing XIP? And when you delete modules, do you reuse the freed space after adding new ones?
...
 
gmap
Old
#5  
Junior Member - OP
Thanks Meter 0
Posts: 3
Join Date: Nov 2005
Default Re: DIY your ROM

Quote:
Originally Posted by mamaich
There already exists MKROM tool - http://www.xs4all.nl/~itsme/projects/xda/romtools.html
it is 100% working with WM2003/2003SE devices. But it is rather inconvenient.
I'll test your "-w 5" option on a real device. Real WM5 device has one XIP kernel section with only few modules and about 1Mb free space. All other data is kept in IMGFS partition, I'm currently working on a tool that would work with it.
And one question. When you add new files to ROM, do you add them to a new XIP or extend the existing XIP? And when you delete modules, do you reuse the freed space after adding new ones?
That's great if we can modify IMGFS partition I am waiting for it.

I know that tool and i don't know how it works. I made this tool only for interesting.

You can find XIP chain in 2003 ROM, by XIP chain, you can know the address and length of each XIP section. I will scan the hole XIP region before inserting the new file to reduce memory fragment. When a module is deleted, its space will be freed and reused when adding files. I freed about 6M space in my own ROM by deleteing the useless files, and add about 5M files into it, it works OK.

It seems 2005 don't have XIP chain information in the ROM, i only test one 2005 ROM, and i didn't find the XIP chain info. If your 2005 ROM don't have XIP chain info too, you should modify ROMHDR.physlast to a correct value by hand. Because if i can't find the XIP chian info, I use ROMHDR.physlast to decide the end address of XIP. Or, there are almost no space for you to add new file. My 2005 ROM physlast=0x8c253278, and only about 78732 bytes free before 0x8c253278.

I update the the tool V2.2 , fixed a bug when deeling with MDA(818) ROM.
 
mamaich
Old
#6  
Recognized Developer
Thanks Meter 214
Posts: 1,150
Join Date: Apr 2004

 
DONATE TO ME
Default Re: DIY your ROM

Quote:
Originally Posted by gmap
That's great if we can modify IMGFS partition I am waiting for it.
I've PMed you a test version. I'll make it available to public later.

Quote:
... If your 2005 ROM don't have XIP chain info too, you should modify ROMHDR.physlast to a correct value by hand.
My ROM has all needed info, I had to extract everything from rom image after 1C0000 address to a separate file and gave it to your tool. It is working perfectly. I've managed to delete and add a new file to ROM. I have not tested "-dm" option. It seems that all modules/files in XIP section of WM5 are uncompressed. I'm using BlueAngel's WM5 ROM. Later I'll try to replace boot.hv file with my own version.
Can you add a switch to your program "-s bytes" so that it woud skip the given number of bytes from file start, so it would be possible to work directly on NBA files with header?
...
 
efjay
Old
#7  
Senior Member
Thanks Meter 63
Posts: 1,544
Join Date: Nov 2004
gmap, can you tell me what file i can use this with? Is it for nbk or nba files? Thanks
Dell Venue Pro, it's alive!
 
TofClock
Old
#8  
Senior Member
Thanks Meter 0
Posts: 268
Join Date: May 2005
Location: Bordeaux
I'm not able to edit the xip sextion ...

i've tried your tool on 1.60c.07CHS rom for xdaII :

RomMaster.exe -w 5 -x -o test.bin nk.nba
result :
[Info] It is a common ROM.
[Error] File is damaged, end address small than start address.
[Error] File is damaged, end address small than start address.

RomMaster.exe -w 5 -x -o test.bin imgfs_raw_data.bin (created with mamaich's tool)
result :
[Info] It is a common ROM.
[Error] Load nb00 failed.

RomMaster.exe -w 5 -x -o test.bin img.bin (created by nba part 1C0000 to end)
result :
[Info] It is a common ROM.
[Error] File is damaged, end address small than start address.
[Error] File is damaged, end address small than start address.

How to save the XIP section ?
Qtek 2020 - SFR(France)

OS: 2.03aWWE Beta
Radio: 1.17

THANKS to Buzz, Bepe, Mamaich, Asukal ...
THANKS to all users for their support
----
http://www.pilipub.com
 
mamaich
Old
#9  
Recognized Developer
Thanks Meter 214
Posts: 1,150
Join Date: Apr 2004

 
DONATE TO ME
Quote:
Originally Posted by TofClock
RomMaster.exe -w 5 -x -o test.bin imgfs_raw_data.bin (created with mamaich's tool)
This would not work. My tool works with IMGFS and you need to edit XIP
...
 
TofClock
Old
#10  
Senior Member
Thanks Meter 0
Posts: 268
Join Date: May 2005
Location: Bordeaux
and ... how to edit XIP ?
Qtek 2020 - SFR(France)

OS: 2.03aWWE Beta
Radio: 1.17

THANKS to Buzz, Bepe, Mamaich, Asukal ...
THANKS to all users for their support
----
http://www.pilipub.com

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


And the Winners in the XDA Pebble Development Challenge Are…

Almost two months ago, we set out with Pebble to findthree amazing … more

MediaTek Releases Full Kernel Source for First Android One Devices

Those who might have thought that MediaTek wouldnever release working … more

Submitting a Patch to Gerrit – Featuring XplodWild – XDA Developer TV

Not every developer specializes in every area of … more

Learn How to Make a Live Wallpaper all by Yourself

Stillimages can bebeautiful, but some of you prefer to see animations on your screens. … more