FORUMS
Remove All Ads from XDA

Build your own WP7 CAB update packages

985 posts
Thanks Meter: 1,988
 
By xboxmod, Senior Recognized Developer on 29th August 2011, 08:45 PM
Post Reply Email Thread
WP7 Update Cab Sender:
with this tool you can install cab to all WP7 device (HTC,Samsung,Dell,Nokia).
Official rom can receive only official cabs...
Copy cab/s in "WP7 Update Cab Sender" folder then run the bat.




Heathcliff74 as release this lang in one cab version
use those now.
http://forum.xda-developers.com/show....php?t=1306415


__________________________________________________ _________

Build your own WP7 update packages.

Update Cab Building Process
An update cab is a container for 3 different types of packages.
with ability to replace any files in all part of the rom.(sldr,nk,imgfs)
never need to create a new rom, you can create a cab for what you want (logo,radio & more)

Canonical
contains the entire contents of the package. It is used for a first-time package install, and if there are any major updates to be issued that would require the complete package.
The file extension is .cab.pkg
Update
contains a binary delta between a package already on the device, and the updated version of that package. if a package change was a simple registry entry - no need to replace all .dll and .exe in that package, just alter the .rgu with a Diff/Patch.
The file extension is .cab.pku
Delete
contain a .dsm file already on the device , and remove all files inside the corresponding package.
The file extension is .cab.pkr

At the root of a package, the .dsm defines the Package structure (all files, registry entries, etc.)
There is a "shadow order" defined in the .dsm as well
- this controls what "priority" .rgu's are compiled together into the device HV.
- a package that shadows another package will override any .rgu entries that shadowed package may contain.
This is important to consider when utilizing .cab.pkgs to obtain your desired end registry.
This shadow order also applies to provxmls inside the package
- a package that shadows another package will override its provxml settings as well.
You can found more technical information in Da_G thread

Beside canonical/update and remove there is other flags in WP7
So use a program which can preserve the flag, dsm builder for ex change them to a bad one
You can find flags for regular(NK/IMGFS) ULDR(SLDR) and Reserved too
If you have no program to make a remove here is a methode:
- Use the default dsm of your package
- Change the version to 0.0.0.0 (but let OS version)
- Remove all files / certificates / dependencies and shadows
- Save the file as that and open it in a hex editor:



- Save you've got it

The delete 40 00 flag is for Regular, 60 ULDR, 70 Reserved
21 00/21 04 For update ULDR, 22 00/22 04 Canonical ULDR
01 00/01 04 For Update regular, 02 00/02 04 canonical regular
.


You can use the tool DSM Flag Editor to do this.(thx Ruzzichella)



Updates packages need diff files and we need tools for that
You can Build your own cab package with WP7 Update Cab Builder
(this tools need wp update tool & zune.)
Cab building process need your personal certificate (.pfx) in tools folder.
you can create your certificate with signcode & convert it to pfx with pvk2pfx.
download link:certificate-tools
and you need to build a rom with this certificate cooked in.(DefaultCerts.dat & MsDefaultCerts.dat )





Special thanks to YukiXDA for all research he as done & Da_G for is very usefull thread.
Original hd2 thread here
Attached Files
File Type: zip WP7-Update-Cab-Sender.zip - [Click for QR Code] (3.47 MB, 7116 views)
File Type: zip WP7-Update-Cab-Builder.zip - [Click for QR Code] (1.80 MB, 2675 views)
The Following 21 Users Say Thank You to xboxmod For This Useful Post: [ View ]
 
 
29th August 2011, 11:27 PM |#2  
Heathcliff74's Avatar
Inactive Recognized Developer
Thanks Meter: 2,473
 
Donate to Me
More
HMMMM!!!! So, In combination with WP7 Root Tools, which allows us to install certificates in any store, including CA, it should be possible to patch system files in ROM!??!?!!

That would be awesome!!

XboxMod, can you confirm this is possible??

Ciao,
Heathcliff74
30th August 2011, 12:34 AM |#3  
xboxmod's Avatar
OP Senior Recognized Developer
Flag Gap
Thanks Meter: 1,988
 
Donate to Me
More
Quote:
Originally Posted by Heathcliff74

HMMMM!!!! So, In combination with WP7 Root Tools, which allows us to install certificates in any store, including CA, it should be possible to patch system files in ROM!??!?!!

That would be awesome!!

XboxMod, can you confirm this is possible??

Ciao,
Heathcliff74

Hi Heathcliff74.
if your tool can replace or edit those files DefaultCerts.dat & MsDefaultCerts.dat
yes you can install your cab.
The Following User Says Thank You to xboxmod For This Useful Post: [ View ]
30th August 2011, 01:01 AM |#4  
voluptuary's Avatar
Senior Member
Flag Mukwonago
Thanks Meter: 756
 
Donate to Me
More
Will I have to roll back to a pre-mango build to do any of this or is this a way we can make changes to say something like the registry to enable wifi tethering buy "updating" the phone with the needed patched files and registry keys?
30th August 2011, 01:18 AM |#5  
derausgewanderte's Avatar
Senior Member
Thanks Meter: 432
 
More
wow, this is epic
YukiXDA
30th August 2011, 02:19 AM |#6  
Guest
Thanks Meter: 0
 
More
Quote:
Originally Posted by Heathcliff74

HMMMM!!!! So, In combination with WP7 Root Tools, which allows us to install certificates in any store, including CA, it should be possible to patch system files in ROM!??!?!!

That would be awesome!!

XboxMod, can you confirm this is possible??

Ciao,
Heathcliff74

Hehe my friend
Sorry this time it's not in the same place, stores deserves another purpose
Quote:
Originally Posted by voluptuary

Will I have to roll back to a pre-mango build to do any of this or is this a way we can make changes to say something like the registry to enable wifi tethering buy "updating" the phone with the needed patched files and registry keys?

The rom has to be cooked before to allow this, will put the procedure in the same thread linked by xboxmod
But it can be an already NoDo or Mango etc rom
Except if someone make the tool
After that packages can be shared by all the comunity, just each packages have to be signed by the cooker to let you use in your rom.
Or you can cook your own...
The Following 2 Users Say Thank You to For This Useful Post: [ View ] Gift Ad-Free
30th August 2011, 12:15 PM |#7  
Heathcliff74's Avatar
Inactive Recognized Developer
Thanks Meter: 2,473
 
Donate to Me
More
Quote:
Originally Posted by xboxmod

Hi Heathcliff74.
if your tool can replace or edit those files DefaultCerts.dat & MsDefaultCerts.dat
yes you can install your cab.

Ok. I did a little test. I looked in the Windows folder of my Samsung Omnia7. It contains the file DefaultCerts.dat, but not MsDefaultCerts.dat (maybe in a subfolder?). It dumped the file DefaultCerts.dat. It looks like it is one single certificate. I renamed it to DefaultCerts.cer. I double-clicked it and it shows a certificate called "Microsoft Windows Mobile Firmware Installation PCA". I looked at the thumbprint and looked in the certificate stores. As YukiXDA said, this certificate is indeed not in one of the certificate stores.

Samsung does not have unlocked bootloaders like HTC has the HSPL now. So it is not possible (yet) to cook a ROM with a different DefaultCerts.dat and MsDefaultCerts.dat. I'm not sure where MsDefaultCerts.dat is supposed to be, but it is possible to write a new file with this name in the Windows folder.

Which DefaultCerts.dat and MsDefaultCerts.dat do you use in your ROM? Did you create a cert yourself? And if you overwrite it, are the legit Microsoft updates still accepted (since you've overwritten the Mobile Firmware Installation certificate from Microsoft)?

Thanks for this research!
Heathcliff74
30th August 2011, 12:28 PM |#8  
xboxmod's Avatar
OP Senior Recognized Developer
Flag Gap
Thanks Meter: 1,988
 
Donate to Me
More
Hi
if you don't found MsDefaultCerts.dat it depend on your build.
old build only have DefaultCerts.dat .
In our rom we use a DefaultCerts.dat & MsDefaultCerts.dat edited.
we have just added more certificate but keep original Mobile Firmware Installation cert to have official update working.
30th August 2011, 12:57 PM |#9  
Heathcliff74's Avatar
Inactive Recognized Developer
Thanks Meter: 2,473
 
Donate to Me
More
Quote:
Originally Posted by xboxmod

Hi
if you don't found MsDefaultCerts.dat it depend on your build.
old build only have DefaultCerts.dat .
In our rom we use a DefaultCerts.dat & MsDefaultCerts.dat edited.
we have just added more certificate but keep original Mobile Firmware Installation cert to have official update working.

I'm on NoDo 7.0.7392.0.
Only DefaultCerts.dat seems to be checked.

Some strings extracted from UpdateValidator.dll:

Code:
\\imgfs\\defaultcerts.dat

ERROR: E_NO_CERT_IN_BASE_PKG : The Package : %s is trying to update a package that has no Certificate in it. Signatures cannot be verified without a Certificate in base package.\n

VerifySignatures failed for graph with base name of %s. Trying to find another path.\n

ERROR: E_MISSING_DEFAULT_CERT_STORE : Could not find default cert store on the device. Error while opening file %s. (Error: 0x%08x)\n

ERROR: E_INVALID_SIGNATURE: Signature validation failed for following Delete Package node after trying to verify against devicenode as well as defaultcerts.dat file.\n

ERROR:E_MISSING_CERTIFICATE: Following Package does not contain a public key (that is certificate file): \n

ERROR: E_MISSING_CERTIFICATE: Following Package does not contain a public key (that is certificate file):\n

ERROR: E_INVALID_SIGNATURE:\n

MESSAGE: There is no need for Signature validation for the following Delete Package node because the DELETE_AUTHORITY of the base package is set to Anyone.\n

MESSAGE: Signature validation was successful using  Defaultcerts for following Delete Package.\n

MESSAGE: Signature validation was successful for following Delete Package node.\n
The one in red is remarkable. It tells me that it is not only possible to verify against defaultcerts.dat, but also against devicenode. In the MY store of the device are not only certs, but also private keys that can be used to sign things. I also know how to extract one (they are unique for every device). Could it be possible to extract a devices Private Device Key and use it to sign an update package specifically for that device?

I don't understand what you say about ADDING your own certificate. It looks to me, that DefaultCerts.dat is one single certificate. How do you ADD a certificate to it?

Ciao,
Heathcliff74
30th August 2011, 02:18 PM |#10  
snickler's Avatar
Forum Moderator / Recognized Developer
Flag Dub V
Thanks Meter: 1,122
 
Donate to Me
More
Again! Thanks to all of you developers for this progress. I get more excited everyday I come to look at this thread.
30th August 2011, 02:20 PM |#11  
xboxmod's Avatar
OP Senior Recognized Developer
Flag Gap
Thanks Meter: 1,988
 
Donate to Me
More
Re
defaultcerts.dat contain multiple certificate,when you rename it to .cer you see only one certificate.
open it with an hex editor to see the other.
the .dat is only multiple .cer merged.
you can paste your own .cer at the end of it.

i don't think it's possible to sign a cab with the Private Device Key.
we need a .pvk with the associated .cer or a .pfx
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes