PDA

View Full Version : Tool to create custom Ext roms for Alpine


bal666
24th October 2005, 02:31 AM
Hi folks,

I've had some sleep now so am editing the original posting to make it clearer and give due credit!

The attached application is based mostly on Wilems (itsme) tool (http://nah6.com/~itsme/cvs-xdadevtools/xda2nbftool/alpinenbfdecode.pl) - so the bulk of the credit goes to him. All I did was work out the checksum algorithm; but as I really suck at Perl, my tool is written in C.

Anyway, this tool allows the decoding of ms_.nbf extended rom files to their header and fat16 image (which can be mounted and modified).

The sneaky part of this tool then allows these two components to be encoded to give a working rom file that can be uploaded to the Alpine device using the usual ROMUpgradeUt.exe application.

Now, PLEASE USE WITH CARE - as I won't be held responsible if using this tool results in a dead Alpine device! Usual disclaimer ..... Also this is an alpha version, so any feedback would be appreciated.

The tool is command line based (no GUI yet - although I will do that soon).
Run the tool without any parameters to get the help - but here's a quick guide:

1. Extract a suitable upgrade (e.g. XDA_IIi_Upgrade_v1.11.162.exe) to a directory like c:\upgrade
2. delete nk.nbf & radio_.nbf files
3. put the alpine_ext_rom_tool.exe in this directory (c:\upgrade)
4. run it to extract the fat16 file and header :
alpine_ext_rom_tool.exe -d -n ms_.nbf
5. this creates ms_.fat and ms_.hdr
6. edit the ms_.hdr (see comments in this file for instructions)
7. mount ms_.fat and add/remove files as needed (updating Config.txt)
8. delete the old ms_.nbf file in c:\upgrade
9. run the tool to create a new nbf file:
alpine_ext_rom_tool.exe -e -f ms_.fat
10. make sure the files been created
11. run ROMUpgradeUt.exe or MaUpgradeUt_noID.exe to update the extended rom on your alpine!

Let me know how you get on if you do decide to give it a go!

Cheers

There's a new GUI version of this tool now available here : http://forum.xda-developers.com/viewtopic.php?t=34783&highlight=

bal666
25th October 2005, 10:12 AM
Well as a follow up and after some experimenting - seems like the splash screen is hidden within the extended rom somewhere.

I used the Imate and O2 extended roms as bases, and even after deleting all cabs, etc, within these files and placing my own cabs within - I still get a splash screen which is different between. That is the Imate one using the imate extended rom and the o2 one using the o2 extended rom.

I assume that this is hidden somewhere, but not as a file. It would be nice to be able to edit this as well. Does anyone have any information on where the splash screen may be?

Although I haven't tried using a new, clean, FAT16 image file ... maybe that would give just the default windows mobile splash.... hmmmm

Hey ho

bal666
26th October 2005, 05:54 PM
Splash screen is appended at the end of the FAT16 image.

The size of the fat file extracted from the nbf file is 0x18C0000 and the last 0x40000 bytes of this file are the splash screen in nb format.

So theoretically if you replace the last 0x40000 bytes of the fat file with your chosen splash screen (format as nb using nb_image_converter_859_418.exe) then that's the splash screen you'll get on startup....

Hmmmmm, quiet round here ain't it? Maybe I'll just talk to myself :wink: - more than likely this has all been figured out before ... perhaps I should've done some searching before I started?

Hey ho

buzz_lightyear
26th October 2005, 08:52 PM
hey ho! ;o)
bro, you've made a cool proggie!
don't be disappointed by no answers... maybe there are not so many Alpine users out there...

keep it up and take care...
buzz

bal666
26th October 2005, 11:46 PM
Hi Buzz,

Dakujem - thought I was talking to myself there for a little while .... not unheard of!

I suppose until hacking these roms becomes simpler (at least until there are some nice gui programs) it'll remain a bit of a niche market.

But I'm learning to live with the short-comings of the XDA 2i ... nearly :shock:

buzz_lightyear
27th October 2005, 12:33 AM
;o)))
nemas za co... ;o)))

buzz

SubZero5
27th October 2005, 01:01 PM
I don't think the same as bal666.. In fact there are many people waiting for their Alpine 's to be mungled and squeezed just like the BlueAngel ;) There are just so many stuff for the BlueAngel and it makes some people buy BlueAngel. I believe there are a lot of non-posters here that are waiting for some stuff like yours :) <g>

miket39
27th October 2005, 03:07 PM
Hi all
Yes i'm another, doing the rounds of the forum's and threads looking for a convienient solution to the extended ROM. I been sitting on the outer cause i don't think i can make a worthwhile contribution to your quest.

I'm just not prgram savy
Good at following instructions thow!!
I'm desperate to build a nice extended ROM with all the features of Special edition you guys produced some time ago.

Could you point me to a CABS listing that can tell me whats worth retaining/ updating/removing. I'm using the Dump ROM out method.
Which incidently is giving a little grief with format of the created files, ext .img. Any thoughts

So keep up the good work, i'm sure theres a stack of people counting on your good work.

Mike

bal666
27th October 2005, 10:33 PM
Hi SubZero & Mike,

thanks for that - makes it seem somewhat more worthwhile. I actually wrote the tool out of boredom, and the fact that I continually play with my XDA and wanted an easy way to restore all my programs and settings; rather than doing it manually.

Mike, there are a number of pages/sites with extended rom cab listings - like http://www.dmmh.nl/xda/ although I couldn't get into it today.

As for your dumprom problems ... sorry mate I've never used it - although there is a thread somewhere here with that (although I'm sure you've seen it) ...

Anyway, the next program will do the same as now but also allow the alteration of the built-in splash screen image - might as well now I've started. But I doubt I'll do a gui version, it's just not worth the aggro!

Cheers

miket39
28th October 2005, 06:46 AM
Your right link seems to be down, any other sites would be good.
How could we, the alpine community convince you to develop a GUI??
Think of the incredible personal prestige and total job satisfaction you would get from this.

This is a terrible suck job if you hadn't realized by now.

Thanks
Miket

GBird
28th October 2005, 10:34 AM
I thought I'd post this here as a link to a thread I started on updating the XDA2i extended ROM (you are not alone in your crusade) :)

http://forum.xda-developers.com/viewtopic.php?p=171104#171104

There are lots of bits inside there but the method pointed to works if all you want is to modify the Extended ROM.

http://en.pdamobiz.com/en/forum/forum_posts.asp?TID=373&PN=1

Have fun,
Graham.

bal666
28th October 2005, 02:09 PM
Hi GBird,

thanks for that.

Also I've had a few people ask how the checksum is calculated, so the code is included below. The alpine_crc_key_lookup uses the same keyset as the blue angel - see nbfutils from wilem (itsme); and I suspect the algorithm is the same as well (I'm not going to go and look ... too much effort involved).

Generate a crc for the fat16 image portion of the extended rom and add this to the crc for the header portion (without the checksum field, meaning only the first 120 bytes). This gives you the key you should be using to encode the whole extended rom.

Enjoy!
Bal

--------------------------------------------------

DWORD alpine_crc(
char data[],
int data_len,
DWORD crc)
{
int i = 0;
DWORD crc_new = crc;

/************************************************** *********
* Calculate the CRC for this data stream
* Based on a decompilation of the RUU.dll loc_1000C174()
************************************************** *********/
for (i = 0; i < data_len; i++) {
crc_new = (crc_new >> 8) ^ alpine_crc_key_lookup((data[i] & 0xFF) ^ (crc_new & 0xFF));

}

return(crc_new);
}

harryphung
30th October 2005, 07:38 PM
Dear bal666

As a newbee, please instruct in detail the upgrade process from step # 6, 7 & 9

wait for your news

thanks for your hard work

bal666
31st October 2005, 10:20 PM
Hi Harry

simple instructions would be as follows:

1. Extract a suitable upgrade, preferably from your provider to a directory like c:\upgrade. Mine is O2, so I use e.g. XDA_IIi_Upgrade_v1.11.162.exe
2. delete nk.nbf & radio_.nbf files from the c:\upgrade directory
3. put the alpine_ext_rom_tool.exe in this directory (c:\upgrade)
4. Open a dos window and cd to c:\upgrade
5. Run alpine_ext_rom_tool.exe to extract the fat16 file and header, like this : alpine_ext_rom_tool.exe -d -n ms_.nbf
6. this creates ms_.fat and ms_.hdr
7. download and install "Extra Drive Creator Pro" from http://www.extradrivecreator.com/download/
8. In Extra Drive Creator add a "File to Drive" using the ms_.fat file in the c:\upgrade directory
9. Add/remove files cab files as needed
10. update the Config.txt file on the mapped drive, open it in a text editor and you'll notice it contains a list of cab files and the order to install them
11. delete the old ms_.nbf file in c:\upgrade
12. run the tool to create a new nbf file: alpine_ext_rom_tool.exe -e -f ms_.fat
13. make sure the ms_.nbf file has been created in c:\upgrade
14. run ROMUpgradeUt.exe to update the extended rom on your alpine!

Hope that helps
Bal

pug
1st November 2005, 10:28 AM
Hi there,

Do you know if there is an issue with the size of the files that are added to the extended ROM ie can you use the whole 24MB?

Using the SD card method with the ntrw.exe file, you are limited to 20.8MB otherwise you start have corrupt CAB files in your extended ROM.

bal666
1st November 2005, 11:01 AM
Hi Pug,

alot of my understanding of the Alpine device is based on supposition and blind experimentation .... :shock:

But, from what I believe the extended rom nbf file to do; I reckon you can use the whole 24Mb to store cab files. Let me explain:

The length and structure of the so-called fat16 image that exists in the nbf file maps rather nicely to the rom structure of the Alpine (and I assume the same holds true of other 64rom devices) - see the following web page for what I mean http://wiki.xda-developers.com/index.php?pagename=AlpineRomStructure

If you take an extended rom nbf file and decode it, you end up with a file (excluding header) that is layed out as follows:

0x0000000 - 0x17FFFFF = extended rom fat16 image
0x1800000 - 0x187FFFF = 0xFF padding
0x1880000 - 0x18A57FF = Splash image in nb format
0x18A5800 - 0x18BFFFF = 0x00 padding

This is an exact match to the rom structure - so the so called fat16 image contains alot more than just the extended rom files!

Errrr, to get back to your point - I think you can fill the whole 24Mb with cab file; but best approach would be to try it ....

Bal

bal666
1st November 2005, 11:20 AM
Pug,

just had a thought about what you said. The size of the fat16 image (as a whole) is 24Mb on the nose.

So with overhead of MBR, FAT tables, etc - you're probably looking at something like 23.7Mb of storage ....

pug
1st November 2005, 11:35 AM
Thought that's what you'd say so I'm experimenting now.

23.4MB didn't work so I'm trying to slim it down now. Shouldn't have to slim it down more than about 0.5MB so I'm reckoning that 23MB will be the limit.

Now I've put it on a diet I'm trying to find files to beef it up from 21.5MB, suprising how difficult that actually is.

Will let you know when I've found out.

For the record though.....YOU ROCK.

bal666
1st November 2005, 11:50 AM
Why thank you :oops:

Let me know how it goes ... I'm trying to get some time to update the tool to extract and insert splash screens too - but I have some real work to do too!

GBird
1st November 2005, 12:01 PM
Thought I'd try and help out a little here:
0x0000000 - 0x17FFFFF (Extended ROM Fat 16 image)

This is a size of 25,165,824 bytes (24Mb)

FAT tables are usually in 512 chunks and each 512 chunk gives you a pointer to 256 blocks of memory. The blocks are usually in 1,024 bytes (1Kb) though this can vary (in a full file system the blocks are usually much larger).

In a standard OS there are usually two FAT tables (as a backup system) so I will assume that there are two here also.

On top of this there will be at least one block taken up with the directory structure (more if you have subdirectories).

So if my numbers are close then you will need 96 * 2 512 byte FAT tables (This makes an overhead of 98,304 bytes).
On top of this there is 1,024 bytes for the root directory giving a total overhead of around 99,328 bytes.

This leaves you with 25,066,496 bytes for data (23.9 Mb).

You may lose an extra 512*32 (16,384) if there is an MBR on the front of this, though I would think that would be elsewhere.

The rest of the space you will lose through slack space (1,024 blocks that are not completely filled by the data you are using) so if you have a large number of files this theoretical 23.9Mb may drop significantly.
For instance, the Config file is probably around 600 bytes so you will lose the rest of the 1,024 block (424 bytes) as slack space.

If any of this helps you then great :)

Hope you have fun,
Graham.

pug
1st November 2005, 01:30 PM
OK, got it to 22.9MB with 33 files and absolutely nothing else to put in the ROM without filling it with junk.

This is still 2 MB more than the SD card method - a lot easier and quicker too. Just found my new method for cooking roms.

The only thing I will say is if you are doing trail and error like I did, start with a freshly extracted ms_.nbf file each time, it gradually gets corrupted ie the splash image got corrupted after about 3 or 4 attempts.

GBird, thanks for the info. Very helpfull.

Bal666, That is one hell of a program you've created, well done.

And thanks to Itsme for the initial leg work on this project.

All in all an excellent program.

Keep it up.

bal666
1st November 2005, 04:32 PM
Cool

Quick question - how are you mounting the fat files? I'm wondering how to reduce the corruption of the splash screens - and most effective method would probably be to just extract the extra information to a different file (rather leaving it tagged onto the end of the fat file)

Cheers

pug
1st November 2005, 04:47 PM
I mounted them using Extra Drive Creator Pro v5.0

It's probably just my computer but I found that I needed to use a freshly extracted ms_nbf from the original update program otherwise it would get corrupted eventually, after say 5 or 6 re-writes. Bear in mind that I've done about 20 updates by the time I finished so things will get corrupted after being written to that many times. Not an issue to me at all as I just keep the files I use to replace the extended rom in a different folder and copy them over replacing every file in the original extended rom.

Finding a way of extracting the splash image to another file would be good as it should make it easier to replace with a better one. At the moment I've just put one in the extended rom to autoinstall on hard reset. Overkill I know but hey...........

Hope this is of some help to you.

harryphung
1st November 2005, 06:19 PM
Thank for your instruction.

BAL666 YOU ARE GREAT

SubZero5
4th November 2005, 05:50 PM
I now see a registry setting under: HKLM/SOFTWARE/OEM/Splash with name: StartAddr with a DWORD value 0x83F80000 (2214068224 in dec)

what is this? (Currently using Sonofon standard rom)

clustered
4th November 2005, 07:36 PM
special thanks to bal666

keep up!!

bal666
8th November 2005, 11:12 AM
Hi guys, thanks for the support.

I'm just trying to create a generic htc 64 extended rom GUI tool, should work with Magician, Alpine and Universal.

It's taking a little bit of time, as I seriously suck at windows gui programming .... command line is so much less hassle :wink:

Bal

miket39
8th November 2005, 02:24 PM
Thanks to all involved in the building of the extended ROM tool.
Follow the instructions and it all works!

Well done!!
Miket

pug
8th November 2005, 06:23 PM
Can we have this thread sticky please.

Wesone
10th November 2005, 11:39 AM
hi everybody,

My question go out to Pug, clustered, bal666 or buzz.
or everybody who wants to answer my question!
no offence to the others butt i think those guys have a lot of experience
in what my question relate to.

I am pretty new to this!

But i am willing to give it a try!!
But can somebody veryify of the prog i want to put in
my ext rom wil work :
-uptime :battery prog
-mymoney 2006 : money prog ms
-skype : voip
-spb pocket plus 30 : today enhancement
-totalcommander : ftp + nav tool
-truefax from xda : fax app (o2 org)
-zip : zip app (o2 org)
-shutdown : windows xp shutdown style
-beta player .66 : divx player

And what is the best why to capture the cab's of these progs?
will there be any problem with progs that are original for wm2002?
and the last question is it possible to remove the following standard
progs of O2 like:
-Midlet manager
-o2 music player
-Pocket msn

thanx in advance for all the tips and info guys

Ps: wish me luck hehe ;-)

Wesone
11th November 2005, 06:44 PM
nobody wants to help me out?0

pmandrews
11th November 2005, 10:29 PM
nobody wants to help me out?0

:cry: Well if no-ne else will offer you help, then I will try...

The o2 midlet crappy stuff is stored in the extended rom image in a file called "tao<something>.cab.

Just delete that file and it's entry in "config.txt" whilst you have the ROM image mounted on your desktop PC, burn your new ROM image and Robert is your mother's brother.

hope this helps!

pmandrews
11th November 2005, 10:32 PM
nobody wants to help me out?0

Also meant to say, I think Pocket MSN is part of the Windows CE distribution. I'm sure someone round here knows how to edit the CE ROM's, but that's currently beyond the realms of a newbie like me! :?

FJR
12th November 2005, 11:55 PM
Pug have you made the latest rom without the O2 stuff yet.

Cheers :D

cctay
13th November 2005, 02:26 AM
My XDA IIi has developed an interesting characteristic; it skips a second every now and then, resulting in it gaining about 2 seconds every 10! Does anyone know what is causing this?? is it a virus or buggy software??

pug
13th November 2005, 11:55 AM
Sorry about the rom folks. Been maxed out in work the last week or 2 and to top it all, my laptop has crapped out and needs a complete windows re-install. You lot will be the first to know.

FJR
14th November 2005, 05:31 AM
@ Pug in your own time, thanks in advance :D

Wesone
14th November 2005, 10:28 AM
And what is the best why to capture the cab's of these progs?



Anybody? search the alpine forum no real results
thnx in advance!!

pug
14th November 2005, 01:05 PM
If you are using XP, goto c:\program files\microsoft activesync and you will find all the folder in there. Look in the relevant folder and you will find the cab files.

Some progams install to the program files directory though.

shaju
14th November 2005, 09:33 PM
My storage in PDA2 is 15mb only, can anybody help me?

clustered
14th November 2005, 09:53 PM
shaju,

FLASH! BlueAngel_DOC_Resize.exe works on Alpine! copy to your device and run it, put in 63000 value and format it! get 61.0 meg usable storage.

special thanks to buzz

pug
14th November 2005, 11:05 PM
For those who tried the Blueangel DOC resize, try 63232. Only gives 61.2MB but for some that little extra will go a long way.

Wesone
15th November 2005, 01:14 PM
First four steps completed!

result: (config-file)
EXEC:\Extended_ROM\TPDisable.exe
CAB: \Extended_ROM\BA_cm_rm_map_o2_v3.CAB
CAB: \Extended_ROM\BackpackDriver.sa.CAB
CAB: \Extended_ROM\Caller_ID_Alpine_Generic_WWE_RC16.CA B
CAB: \Extended_ROM\CV2.41.386_wwe.CAB
CAB: \Extended_ROM\Delete_shortcut.sa.CAB
CAB: \Extended_ROM\SmartDialing_Alpine_Generic_WWE_RC13 .CAB
CAB: \Extended_ROM\PhonePad_Alpine_Generic_WWE_RC11.CAB
CAB:
\Extended_ROM\CAB-TaoJava-10.1.4.127-Alpine-O2Music-ENU-01Apr05-MMP1051-v101.CAB
CAB: \Extended_ROM\O2UK_removeACCEPT_12212004.CAB
CAB: \Extended_ROM\VideoMMSB22.sa.CAB
CAB: \Extended_ROM\O2UK_PIE_homepage.sa.CAB
CAB: \Extended_ROM\O2UK_Regional_TimeZone.sa.CAB
CAB: \Extended_ROM\O2UK_RingTone.sa.CAB
CAB: \Extended_ROM\Patch_Camera_9650.sa.CAB
CAB: \Extended_ROM\Patch_Eraphone.sa.CAB
CAB: \Extended_ROM\Patch_Update_SIM_Mgr_2.2.1.0.sa.CAB
CAB: \Extended_ROM\Alpine_SMS05272005.sa.CAB
CAB: \Extended_ROM\PressKey.sa.CAB
CAB: \Extended_ROM\wap.CAB
CAB: \Extended_ROM\Certificate.CAB
CAB: \Extended_ROM\version.CAB
CAB: \Extended_ROM\IPV4_132.sa.CAB
EXEC:\Extended_ROM\TPEnable.exe
CAB: \Extended_ROM\v36024_install.ARM.CAB

I am living in belgium? What can is savlely remove out of it? i believe what in red is savely removeable.
For whats the tp enable en disable?
And what to do wit programs with more than one cab files to install?

once again thanks in advance!!

shaju
17th November 2005, 11:14 AM
I want get rid of some cab files from ExtendedRom PDA2 and put some cab instead of it, any way to delete?
Thank you for storage retrieve problem
thak you buzz

bal666
17th November 2005, 03:42 PM
Shaju,

currently there are only two ways of doing this:

1. use the SD card method to dump out the alpine rom, edit it and write back to alpine
2. use the tool from the first page on this thread to create your own ms_.nbf file and write to your alpine.

It would be really cool if someone found a way of making the extended rom writable on the device ... but it's not been done yet.

Bal

pug
17th November 2005, 05:59 PM
This is beyond my ability but is there any way of decompiling Maupgrade.exe to see how that enables the write command, or is it a bootloader firmware thing?

Like I say, beyond my ability but those in the know might be able.

Just a thought.

bal666
24th November 2005, 06:50 PM
Hi Pug,

I don't it works like that (but could be mistaken)!!

From the way the extended roms files are formatted it seems that the upgrade program just dumps the whole file onto the alpine and that's it.

Having said that Buzz has managed to unlock the Universal extended rom, and hopefully we can use this to do the same on the alpine.

Bal

buzz_lightyear
24th November 2005, 11:23 PM
hi bal666,
can you please tell me, which DOC chip is used in Alpine??

Also i'd like to get your registry:

[HKLM\Drivers]
and
[HKLM\System\StorageManager]
please...

THANX
buzz

bal666
25th November 2005, 04:33 AM
Hi Buzz,

I've sent you a pm with registry settings.

Could you tell me how I can find out the DOC chip type? Or perhaps someone who reads this will know?

If you could find a way of unlocking the extended rom that would be so cool!

If you need anything just let me know
Bal

buzz_lightyear
25th November 2005, 07:01 AM
hi bal,
can you please send me VDISK.DLL ??

THANX
buzz

shaice
25th November 2005, 08:25 AM
Thank you buzz, bal666, pug !!!!! :D :D :D

As soon as possible I would cook my own italian rom (founded no one out there with new 1.04 radio stack or other fancy stuff)...

Your work is amazing!

Thank you guys!!!! :D

Excuse my very poor english! :(

Saluddosss

s

bal666
25th November 2005, 12:02 PM
Hi Buzz,

sent vdisk.dll to your pm.

Good luck mate
Bal

shaice
8th December 2005, 05:16 PM
Hi all! Could I put on ext rom programs instead of CABs?
Programs like VLC, PocketPutty, SCUMMV run without any installation. If we could put them directly on the ext_rom more space will be saved from storage.

Is this a good idea?

best regards

s

buzz_lightyear
8th December 2005, 09:41 PM
sure, you can, if the rom is unlocked.

buzz

bal666
8th December 2005, 10:10 PM
Hi Buzz,

have you had any luck with unlocking the alpine extended rom?

It would save so much time to just be able to modify it online ... :wink:

Cheers
Bal

buzz_lightyear
9th December 2005, 08:57 AM
Hi Buzz,

have you had any luck with unlocking the alpine extended rom?

It would save so much time to just be able to modify it online ... :wink:

Cheers
Bal

i had no time to continue with it... :o(
later...

buzz

bal666
9th December 2005, 10:29 AM
Hi Buzz,

not to worry - you must be soooooo busy with your new Universal. Can't say I blame you!

Have fun
Bal

pug
25th January 2006, 04:53 PM
So many people seem to be asking how to cook the rom, I thought I'd bring this thread back into the light.

Bump.