Title: Removing the "Unlocked bootloader" message from the Moto G (falcon)
Date: 2017-03-12 16:30

If you're using a [custom rom]( http://lineageos.org/ ) on your
[Moto G](https://en.wikipedia.org/wiki/Moto_G_(1st_generation)),
odds are that you've unlocked your bootloader,
and that you now have this ugly screen on the device when you're booting it:

![ugly motorola "bootloader unlocked" message]({static}/images/moto_g_bootloader.png)

Fortunately, you can revert this: pop a root shell on your phone and
dump the partition containing the logo directive:

```
$ adb shell
falcon:/ $ su
falcon:/ # ls -al /dev/block/platform/msm_sdcc.1/by-name | grep logo
falcon:/ # dd if=/dev/block/mmcblk0p27 of=/sdcard/logo-copy.bin
8192+0 records in
8192+0 records out
4194304 bytes transferred in 0.242 secs (17331834 bytes/sec)
falcon:/ # exit
$ exit
$ adb reboot bootloader
```

Now we're going to edit the data after `logo_unlocked` to make it the same
than the one behind `logo_boot`. With [radare2](http://rada.re),
you just have to open the file with `radare2 -w ./logo-copy.bin`,
get into `V`isual mode, adjust the size of
the columns at your convenience with `[` and `]`, move around in `c`ursor mode,
and (like in vim), go into `i`nsertion mode, and edit the data.

Here is a (ra)diff of my partition after the operation:

```diff
jvoisin@kaa 16:18 ~ radiff2 logo-copy.bin logo-copy.bin.bak -x 
  offset     0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF    0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x00000000  4d6f746f4c6f676f006d0000006c6f67 MotoLogo.m...log   4d6f746f4c6f676f006d0000006c6f67 MotoLogo.m...log
0x00000010  6f5f626f6f7400000000000000000000 o_boot..........   6f5f626f6f7400000000000000000000 o_boot..........
...
0x00000060! 000000000000020000a5200700ffffff .......... .....   00000000000058070032560200ffffff ......X..2V.....
0x00000070  ffffffffffffffffffffffffffffffff ................   ffffffffffffffffffffffffffffffff ................
0x00000080  ffffffffffffffffffffffffffffffff ................   ffffffffffffffffffffffffffffffff ................
...
jvoisin@kaa 16:18 ~ 
```

The final step is to flash the new partition with `fastboot flash logo
logo-copy.bin`, reboot your phone, and enjoy the original boot logo :

![nice original motorola bootloader message]({static}/images/moto_g_bootloader_orig.png)

Tadaaaa.

