[HD2 Windows Phone 7 Development] YukiXDA:
How to cook the rom

The principe:

In the section "Create your own WP7 update packages" you have made a pfx file with your own certificate and private key, now the goal is to insert this certificate in rom to let you send/remove/modify packages and give you the possibility to do the same on some already inrom packages.

We have to see what have to been respected in the cooking, a quick view of the D000FF and I'll finish by the specific case of the Leo.

Where to place your certificates:

You can find the file Certificates.zip here: tools

These are already made certificates and .bat for what you need.

For each you can replace our cert XBmod-Yuki.cer by yours or you can add it and modify each .bat for that if you want to use our already made cabs without having to redo them.

DefaultCerts.dat is the most important file (before Mango) but stay important after that, I've added in the folder all certificated from all devices, this what allows packages to be inrom and before Mango what let you send packages. So just make the file and replace it in metadata package. You can do the same in sldr but it's not necessary, we've done it in case of futur updates which could change it.

MsCerts package in Mango Microsoft added this package, so we already included it under 7004 with our certificate. There is the new (in term of validity) Microsoft Windows Mobile Firmware Installation PCA and the old. Without changing it you can't send packages anymore in Mango. Exactly like the precedent it is not necessary in sldr but could be later. The join.bat will give you the file MsDefaultCerts.dat and the certificate for dsm too, this to be able to modify this package after having flashed the device.

OEM packages This is to change the certificate in OEM dsm, the first OEM_168_UpdateCert.cer is for schubert, for another device take the file it need from DefaultCerts.dat folder. When adding your certificate to these packages you will able to modify them after flash. you could do the same with SYS packages but it's not necessary at all since SYS packages don't have to be changed to avoid the break of system update.

CSConn_DB is the same but the OEM certificate is different.

What has to be repected:

there is surely two or three things to check i just don't remember now but these are the most importants and really can make the difference

.cif and .sof : these files are important, .cif determine the order of relocs during an update and .sof the order the .rgu, provxml etc are parsed at first flash and after each update. So better let the order predefined in the original rom. If you want to add a package inrom put it at the end of the .sof and in the .cif only if it conatin some dll.

SYS packages : never modify a file of a package or the system update will break because the most of them use diff files in pku so the diff won't work, for a pku the old version should correspond or it will break too. To avoid a package to been updated (like MsCerts package) just change the OS version of the package in this case it won't break but just skip it since it's detected as more recent. You can do the same for OEM packages if you don't want them to be updated but controlled by you.

Registry : it's useless to modify registry since after each update it will be overwriten. You have to think packages, rgu and provxml now. if you want to modify something better let the rom as it should be by default and make packages after for these modifications, by this way too they can be modified if they don't stand a new update. Anyway if you wan't abolutely something in rom make a package which shadow the SYS or OEM package which contain this entries and a .rgu/provxml for this. And add these entries in .hv files for first boot.

Relocs: if you have to mix some OEM and SYS packages try to make relocs in the order of the .cif and avoid to place two files of the same package at different places. Anyway the system will work even if takes more time to move modules and will probably have to reboot twice or three times after sldr operation. But be sure of what you do with relocs or the update could simply crash when moving the module and make the device unbootable.

D000FF:

Beside the zip for cerificates you can find WP7hash.zip, it's a simple tool I have maid which can give you informations there is in partition table, calculate the hash if you modify something, calculate the total number of blocks you have to put in header and show you all the blocks a rom have. You'll find the sources for that too, modify them as you want.

And it avoid me to explain partition table, you just have to reverse engeniering :)

Won't explain all, some can do that but the important for this type of rom is to have space in IMGFS NK and SLDR for updates. If you build a rom from NoDo you have to increase the imgfs size or take a rom with already suffisient space for futur updates. And you have to think that parts need space not only for content but working space too when updating. So the most you can, the better it is but let a minimal space for user part. be carrefull the total count of logical blocks feet your NAND. You don't need to move and rebuild the user part, just remove it from the rom it will be rebuild at first boot.

Too much things to say about D000FF so I stop here, this is only what concern system update.
​

HTC HD2:

For HD2 I took the decision to lock the sldr to been updated to avoid some problems, it could be changed in futur, so each dsm has the OS version 900.

I done the same with OEM packages in SLDR and NK to avoid a possible HTC update (we never know).

The most tricky was to made the rom structure, if you want to modify the rom and have no tool which let you boot after, just make a copy of your part04.bin and change imgfs with htcrie. After that copy all from the begining of imgfs signature (not the imgfs part which begins before or it will not work) and replace it in your intitial file. So it will let the structure intact. With some scripts it's better ^^

Leo_sdmemory was the file which was given the possibility of let the card unlocked but after mango the dll was not compatible since the file sdmemory it was replacing changed. Before I added it in SLDR to let system update working without locking the card like it was the case in 7592 with some registry entries too. But after seeing the problems I totally removed it from SLDR and NK since a fix could not be the solution in long term, problems like that could happens after another update, better use the default system file.

There is a last thing I've done, I changed the system of backups from AES 256bytes to RC2 1byte so the backups could be decrypted in futur if you search for that and so the rom could be a kitchen. The base rom has to be cooked well but for the rest it's Microsoft who do the job^^ more time for more interestant developement.
​

Time to say goodbye

Was talking there is a month ago that I was about to quit xda and developpement, it's time now. I let all in the hands of xboxmod, he's the man who

taught me everything ;) Possible I was just the hand of DFT, you'll never know ^^

Just put back the cover of my battery, think I didn't do that since two month to reboot faster it's just too strange :confused:^^

All this was a great experience, didn't found what I was coming to but a lot of other, thanks all for your support and hope you'll enjoy the rom and the new system of cabs to peronalize your rom. :)
​