[Dev Notes] Locked Bootloader 101

Search This thread

EvilTim

Senior Member
Jul 29, 2011
454
67
I'm hoping if/when the Google/Moto merger occurs, that maybe Google will force Moto's hand to unlock it.

We can only hope.

If you read some news articles, Google is going to operate Motorola mobility as a separate company. They are not acquiring it for us, they are only doing it so they can go to war with Microsoft in court. Don't expect anything to change.

Sent from my DROID X2 using XDA App
 
  • Like
Reactions: iBolski

iBolski

Senior Member
If you read some news articles, Google is going to operate Motorola mobility as a separate company. They are not acquiring it for us, they are only doing it so they can go to war with Microsoft in court. Don't expect anything to change.

Sent from my DROID X2 using XDA App

I know. I'm trying to be one of the more optimistic people here as opposed to realistic. ;)
 

Peperm1nt

Senior Member
Jul 6, 2011
591
188
Matewan
Dump question here but I'm just wondering, Why not rewrite the whole partition?

Assuming the similarities, couldn't we port over the Atrix bootloader partition/file and edit it to meet what our phone needs? If anything about a signature check, we could remove the "checking" and force a go ahead couldnt we?
 

mastafunk

Senior Member
Aug 31, 2011
406
450
Undisclosed Swamp Location, FL
LOL chicken and egg here.. we cant successfully rewrite anything without the proper signature.

Dump question here but I'm just wondering, Why not rewrite the whole partition?

Assuming the similarities, couldn't we port over the Atrix bootloader partition/file and edit it to meet what our phone needs? If anything about a signature check, we could remove the "checking" and force a go ahead couldnt we?
 

IDMA.DROID.X2

Senior Member
Jun 7, 2011
610
38
Almost off topic, but could we take a SBF and switch stuff out to give us a custom kernel and stuff? My thought was if the signature check is at the beginning of an SBF then it would work, unless it checks everything for a signature.

Sent from my DROID X2 using XDA App
 

Staggo

Member
May 12, 2009
23
2
Almost off topic, but could we take a SBF and switch stuff out to give us a custom kernel and stuff? My thought was if the signature check is at the beginning of an SBF then it would work, unless it checks everything for a signature.

Sent from my DROID X2 using XDA App

I remember reading about this somewhere- probably in the Atrix or D2G forums. We need to actually be able to edit the SBF and preserve the signature check. As far as I know, we cannot do that.
 

the2dcour

Senior Member
Mar 17, 2011
464
587
Boston
Guiz, cant we switch our phones over to the Atrix and then have the authentication from Verizon activate tehre then we can have atrixes and unlocked bootloaders on verizon. If not than can wii port the verizon qwebtop and make scrambled eggs that taste like bacon? I think that this weel werk of we can get the night devs and post a bounty.
 
  • Like
Reactions: skwoodwiva

donlad

Senior Member
Sep 23, 2010
248
34
Guiz, cant we switch our phones over to the Atrix and then have the authentication from Verizon activate tehre then we can have atrixes and unlocked bootloaders on verizon. If not than can wii port the verizon qwebtop and make scrambled eggs that taste like bacon? I think that this weel werk of we can get the night devs and post a bounty.

You just made my day. Bwahahaha.
 

booked

Senior Member
Nov 20, 2010
533
111
LA
Guiz, cant we switch our phones over to the Atrix and then have the authentication from Verizon activate tehre then we can have atrixes and unlocked bootloaders on verizon. If not than can wii port the verizon qwebtop and make scrambled eggs that taste like bacon? I think that this weel werk of we can get the night devs and post a bounty.

Someone try this ASAP
 

IDMA.DROID.X2

Senior Member
Jun 7, 2011
610
38
I'd be funny if this worked and every one switched to ATRIX stuff on their DX2 :)))))

Sent from my DROID X2 using XDA App
 

Zues532

Senior Member
Feb 4, 2011
187
43
does that mean your gonna try it? lol


...
JerrySeinfeld.gif
 
  • Like
Reactions: mistawolfe

soocold

Senior Member
Jun 29, 2010
86
17
A stupid question bit it hasn't been asked yet, why can't we modify the SBF to allow kelxec. If we know where the signatures are, what's to stop us from comparing every known SBF, IE what are the differences in the data, and how does that make the hash key different


Tapped from my tweaked out DX2
 

Peperm1nt

Senior Member
Jul 6, 2011
591
188
Matewan
A stupid question bit it hasn't been asked yet, why can't we modify the SBF to allow kelxec. If we know where the signatures are, what's to stop us from comparing every known SBF, IE what are the differences in the data, and how does that make the hash key different


Tapped from my tweaked out DX2

I like this idea...I have a spare x2 that I wouldn't mind doing this too, but here's the thing...

If we were to do this, the device would probably not boot because of driver issues within the kernel...

Next to that,

We would then have an attix bootloader and not a x2 bootloader. We would need the kernel source just to have our device "back to normal" with unlock bl.

So in the end, we wouldn't be able to make it because we would bee on gsm and not cdma... The drivers would never be the same without serious mods. Tbh, we have a group of dedicated devs, but that idea is too out there with out 4 to 5 months of constant work... but hey, anything is possible, that would probably be easier than trying to reverse engineer the thing.

Tapin' the Talk on the xSquared
 

xawen

Senior Member
Nov 12, 2008
445
68
Annapolis
We may not need to modify anything...

If anyone has any knowledge of how Moto signs the partitions (specifically where the bootloader gets the existing signature for comparison) please PM me. I have something worth trying out, but I don't have the know how when it comes to sbf files and moto's bootloader.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    I think now that everyone seems to be empowered about the phone, I've been seeing some posts about thoughts to unlock the bootloader. But I'm finding some ideas have misunderstandings of what the phone is doing.

    So I decided to make this post to clear up alot of confusion about the locked bootloader. It's literally most of my notes on the subject. It's almost enough to teach a class on it.

    Phone Basics
    - The phone's flashable memory space is broken into data sets called partitions
    - Each partition is used for a different function on the phone
    - Access to the partitions is found in /dev/block/
    - The main partitions are mmcblk0 and mmcblk1
    - mmcblk0 is the main internal flash memory
    - mmcblk0 is broken into parts (e.g. mmcblk0p1, mmcblk0p2, etc...)
    - mmcblk1 is the internal sd card
    - Notable partitions:
    --- Bootloader and Microboot - mmcblk0p1
    --- CDT Table - mmcblk0p2
    --- Recovery - mmcblk0p10
    --- Boot (kernel and ramdisk) - mmcblk0p11
    --- System - mmcblk0p12
    --- Userdata - mmcblk0p16
    - Certain partitions are file system mountable (e.g. System and Userdata)
    - Mountable partitions are defined in /proc/mount
    - Partitions can be flashed in a number of ways:
    --- SBF files via RSD
    --- Direct byte-by-byte (e.g. dd if=/scdard/boot.img of=/dev/block/mmcblk0p11)
    --- Some partitions via fastboot (e.g. fastboot flash recovery recovery.img)
    - SBF files contain data sets known as code groups
    - SBF files can be unpacked with MotoAndroid Depacker (http://modmymobile.com/forums/402-general-motorola-android/530781-sbf-depacker-1-3-03-22-2011-a.html)
    - When an SBF is flashed with RSD, the code groups flash onto the assigned partitions in flash memory
    - Notable code group to partition mappings:
    --- Bootloader - CG42 -> mmcblk0p1
    --- Microboot - CG47 -> mmcblk0p1
    --- CDT Table - CG3 -> mmcblk0p2
    --- Recovery - CG58 -> mmcblk0p10
    --- Boot (kernel and ramdisk) - CG59 -> mmcblk0p11
    --- System - CG60 -> mmcblk0p12
    - A "full" SBF does NOT include all CG groups. Not all partitions will be flashed with an SBF.

    Digital Signing Basics
    - The goal of digital signing is to assert that a set of data is generated by one authorized source
    - A digital signature is:
    --- An encrypted data string that expresses that a set of data is from one source
    --- Comprised of a representation of the data (hash) and a cryptographic component of the signer (private key)
    - A digital certificate is a data package that contains the signature of the data set and other cryptographic information that verifies the signature
    - A signature verification algorithm verifies that the signed data has not been tampered with:
    --- A hash is performed on the data set
    --- Using the public key provided from the certificate, a hash is generated from signature
    --- If the two hashes match, the signature check passes
    - You fail a signature check if:
    --- The hashes don't match meaning either the data or the signature has been tampered with
    --- The certificate is tampered with via cryptographic checks on the certificate (unknown to us on this phone)

    Locked Bootloader
    - A bootloader is said to be "locked" when a regular user does not have the complete authority to change all of the phone's flash memory
    - In the case of Motorola Tegra-based phones, digital signature (NOT encryption) is used on some partitions. (In some Motorola OMAP phones, some partitions are encrypted. Blah).
    - The digital certificate asserts to the phone that the partition is "From Motorola"
    - A signed partition has an attached digital certificate near the end of the data
    - A signature check algorithm is run at phone startup to check the signed partitions
    - In most cases (so far), a failed signature check at bootup leads to a soft brick with the ability to use RSD to SBF
    - Notable signed partitions:
    --- Bootloader and Microboot - mmcblk0p1
    --- CDT Table - mmcblk0p2
    --- Recovery - mmcblk0p10
    --- Boot (kernel and ramdisk) - mmcblk0p11

    Atrix Notes that should apply the DX2
    - Unlock-capable bootloaders were found through development leaks. Thus, the bootloaders are signed by Motorola which allows them to be run before the fastboot oem unlock command is issued. To my knowledge, no unlock method for a Motorola phone has been found without a development leak.
    - The fastboot oem unlock command issues something in a phone to "burn" a fuse on the board which indicates that the phone is unlocked. The "burn" process is said to be irreversible.
    - You can check for the unlock fuse by reviewing /sys/firmware/fuse/ReservedOdm
    - Atrix has the same partition map (including signed partitions) as the DX2
    - Atrix has the same SBF flashing map (CDT) for the most part with the DX2 (sometimes different CG number but the same map)

    Some Notable Results
    - A signature failure on the CDT Table partition produces a "Failed to boot 1" error
    - A signature failure on the Recovery partition produces a "Failed to boot 2" error
    - Locked bootloader prevents flashing of an unsigned partition via fastboot. However, flashing a signed partition with a tampered signature is allowed through fastboot but will fail the signature check upon phone startup.
    - Despite having the same partition and certificate format, flashing the Photon 4G boot image causes a signature failure. Certificate must have some kind of identification to determine the uniqueness of the phone (model/carrier).

    Potential Unlock/Trick/Bypass Approaches
    - Find the command force unlock fuse to be set (unlock command outside of the bootloader fastboot)
    - Trick the phone to not check the unlock fuse and always report the phone as unlocked
    - Trick the phone never to run the signature checking code
    - Trick the phone to assume that the boot and recovery partitions are "regular" partitions and not signed ones
    - Find a flaw in the signature such that you can sign the partition as if you are Moto
    - Get kexec to work so that a new custom kernel can be loaded after kernel is first loaded (kinda like 2nd-init)

    Currently at the end of the day
    Bootloader unlocks for Motorola phones have been through development leaks. Motorola's bootloader locking system is quite complicated (and surprisingly well thought out). No Motorola unlock has been achieved solely through the external development community. The best possible chance for an unlock today is through supporting Project Pudding or Project Cheesecake for a development leak. I'm not saying you shouldn't try to work on a locked bootloader workaround. The technical expertise necessary is quite advanced for most people and if you don't understand half the stuff I mentioned, I think your help is best served through something like Project Cheesecake.

    For some light reading
    Digital Signature on Wikipedia - http://en.wikipedia.org/wiki/Digital_signature
    kexec on Wikipedia - http://en.wikipedia.org/wiki/Kexec
    EternityProject Kexec method for Motorola Olympus (Atrix 4G) - http://xdaforums.com/showthread.php?t=1079097
    Project Pudding: http://xdaforums.com/showthread.php?t=1225072
    Project Cheesecake: http://xdaforums.com/showthread.php?t=1226664
    1
    Just wanted to add:

    • mmcblk0p13 - osh
    • mmcblk0p15 - cache
    • mmcblk0p17 - preinstall
    1
    I got it from /proc/config.gz and yes its what is running its actually a .gz if you want your kernels .config run
    cp /proc/config.gz /sdcard/
    I tried to echo c to /proc/sysrq-trigger which you force a kexec but all it did was reboot
    Sent from my DROID X2 using XDA App
    1
    Strange because it works for me, I will see if I can link to full site not mobile site. That's probably the problem

    Edit: try this

    http://www.cnn.com/2011/09/19/tech/mobile/verizon-att-innovation/index.html

    Sent from my DROID X2 using XDA App
    1
    I'm hoping if/when the Google/Moto merger occurs, that maybe Google will force Moto's hand to unlock it.

    We can only hope.

    If you read some news articles, Google is going to operate Motorola mobility as a separate company. They are not acquiring it for us, they are only doing it so they can go to war with Microsoft in court. Don't expect anything to change.

    Sent from my DROID X2 using XDA App