DIY your ROM

Search This thread

gmap

New member
Nov 19, 2005
3
1
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.
 

Attachments

  • rommaster.zip
    70.8 KB · Views: 7,210
  • rommaster.rar
    62.9 KB · Views: 4,855
  • Like
Reactions: romngenie

oltp

Senior Member
Oct 12, 2005
1,488
25
Nexus 7
Huawei Mediapad M3
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.
 

mamaich

Retired Recognized Developer
Apr 29, 2004
1,150
228
mamaich-eng.blogspot.ru
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

New member
Nov 19, 2005
3
1
mamaich said:
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

Retired Recognized Developer
Apr 29, 2004
1,150
228
mamaich-eng.blogspot.ru
gmap said:
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.

... 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

Senior Member
Nov 18, 2004
1,549
64
gmap, can you tell me what file i can use this with? Is it for nbk or nba files? Thanks
 

TofClock

Senior Member
May 16, 2005
268
0
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 ?
 

celiruss

Member
Dec 19, 2005
22
0
mamaich said:
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?

mamaich, or anyone else, what did you use to extract after 1C0000?
splitrom?

any help would be greatly appreciated.

Russ
 

ahlok_hk

Senior Member
Jan 6, 2006
292
114
Thx gmap for this great tool. 8)

Recently I want to replace the TureFFS.dll at the XIP area of Wizard OS ROM.
ftp://xda:xda@xda-developers.com/Uploads/HTC_Wizard/Roms/Qtek/Qtek_9100_1_6_7_ENG__OS_ONLY.zip

I type the following command and it says that it cannot replace the file.
Code:
D:\>RomMaster.exe -d TrueFFS.dll -a TrueFFS.dll -w 5 -o new.nba os.nba
[Info]          It is a common ROM.
[Warning]       o32_rom(0x8c268ef8)'s o32_data at 0x00000000 is zero.
[Warning]       Found dif-referenced region [OLD] Address=0x8c1e1290 Length=0x00000800 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c1e1290 Length=0x00000800 ObjectType=0x00008000
[Warning]       Found dif-referenced region [OLD] Address=0x8c1fe538 Length=0x00000600 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c1fe538 Length=0x00000600 ObjectType=0x00008000
[Warning]       Found dif-referenced region [OLD] Address=0x8c211018 Length=0x00000a00 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c211018 Length=0x00000a00 ObjectType=0x00008000
[Warning]       Memory Block(0x8c101000,0x8c1510ac) overlap with Block(0x8c10288c,0x8c1028b8).
[Error]         You want to get an object whose size is 108, but it is 112.                     RomOffset=0x8c268e00
[Error]         Could not replace 'TrueFFS.dll' with 'TrueFFS.dll'.
However, I can successfully replace the boot.hv file. Do you know why?
 

gmap

New member
Nov 19, 2005
3
1
ahlok_hk said:
Thx gmap for this great tool. 8)

Recently I want to replace the TureFFS.dll at the XIP area of Wizard OS ROM.
ftp://xda:xda@xda-developers.com/Uploads/HTC_Wizard/Roms/Qtek/Qtek_9100_1_6_7_ENG__OS_ONLY.zip

I type the following command and it says that it cannot replace the file.
Code:
D:\>RomMaster.exe -d TrueFFS.dll -a TrueFFS.dll -w 5 -o new.nba os.nba
[Info]          It is a common ROM.
[Warning]       o32_rom(0x8c268ef8)'s o32_data at 0x00000000 is zero.
[Warning]       Found dif-referenced region [OLD] Address=0x8c1e1290 Length=0x00000800 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c1e1290 Length=0x00000800 ObjectType=0x00008000
[Warning]       Found dif-referenced region [OLD] Address=0x8c1fe538 Length=0x00000600 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c1fe538 Length=0x00000600 ObjectType=0x00008000
[Warning]       Found dif-referenced region [OLD] Address=0x8c211018 Length=0x00000a00 ObjectType=0x00200000
[Warning]       Found dif-referenced region [New] Address=0x8c211018 Length=0x00000a00 ObjectType=0x00008000
[Warning]       Memory Block(0x8c101000,0x8c1510ac) overlap with Block(0x8c10288c,0x8c1028b8).
[Error]         You want to get an object whose size is 108, but it is 112.                     RomOffset=0x8c268e00
[Error]         Could not replace 'TrueFFS.dll' with 'TrueFFS.dll'.
However, I can successfully replace the boot.hv file. Do you know why?

In replace mode, new file should not biger than old file. So, you should delete old 'TrueFFS.dll' first, then add the new one(You can delete some file next to 'TrueFFS.dll' to get free space or move it to a big free space, then modify the file size and related infomation of 'TrueFFS.dll' by hand to make it bigger). Replacing module isn't stable, I confused by some of the module data. If you want to replace a module, it may not work. I haven't find a way that can be used to calculate all of the data.
 

ahlok_hk

Senior Member
Jan 6, 2006
292
114
gmap said:
In replace mode, new file should not biger than old file. So, you should delete old 'TrueFFS.dll' first, then add the new one(You can delete some file next to 'TrueFFS.dll' to get free space or move it to a big free space, then modify the file size and related infomation of 'TrueFFS.dll' by hand to make it bigger). Replacing module isn't stable, I confused by some of the module data. If you want to replace a module, it may not work. I haven't find a way that can be used to calculate all of the data.

Thx for your explanation. Actually the new file is smaller than the one being replaced. And I just found that I can only delete those non-module files while all modules could not be deleted.

Thx again. Hope to see new version if you have time to find out how to calculate the data. :wink:
 

MR2

New member
Feb 19, 2006
3
0
Hello,

I have a Apache Rom,

I would like to delete nk.exe are replace it.

iv tryed:

rommaster -w 5 -d nk.exe nk.nba

also

rommaster -w 5 -d nk.exe -a nk.exe nk.nba

keeps telling me i can delete that file.

just to let you know: if i use dumprom i get the boot partition files (containing nk.exe) and if i use imgfs i get all the os files (not containing nk.exe)

Any help would be great thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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.