Sunday, June 3, 2018

Notes on Repairing/Recreate Windows 10 EFI Bootloader without Reinstallation

For whatever reason, my windows installation has its bootloader on a different drive. i.e., say the windows 10 is on disk 1, but its bootloader is on disk 0. The computer has to access disk 0 in order to have disk 1's OS running.

Unfortunately,  my boot drive is finally dead yesterday, so I was unable to boot up despite the OS itself being good.

Here are few steps I did:

  1. remove the dead disk 0. (with disk 0 connect, my BIOS would stuck at POST)
  2. boot into ubuntu live CD, use GParted to move the OS partition and make a room of 500MiB before it
  3. Create the EFI partition. it is just a FAT32 partition with boot label. 
  4. use a windows 10 installation media, hit shift+F10 to enter cmd, then use 
    "bootrec /RebuildBcd"

    to create the bootloader
  5. For whatever reason, now I can see the bootloader, but it somehow won't get me into windows 10. So now I used the windows 10 installation media's repair tool, and it automatically repaired it. (note I tried using this step before everything else, but it won't work until I create the EFI partition manually)
  6. Done


Wednesday, April 19, 2017

Notes on Using the same Bluetooth LE Mouse (Microsoft 3600) with Windows and Linux without Re-paring

This note intends to collect the key steps of my implantation. It is mainly instructed and inspired by this post as well as its comments: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html

The idea generally is to have the mouse working with windows, and then copied its credentials to linux.

My OSs are windows 10 64bit and Ubuntu 16.04 64bit with 4.10 kernel;
Mouse is Microsoft 3600


  1. have bluez and blueman installed in linux (so it works with BLE mouse)
  2. pair the mouse with linux and then windows. (so it is working in windows)
  3. extract credentials from registry. (use "psexec -s -i regedit", find and export as txt:  "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys\<MAC of BT adapter>\<MAC of BT mouse>")
  4. Fill the credentials to Linux ("/var/lib/bluetooth/<MAC of BT adapter>/<MAC of BT mouse>/info")
  5. Restart BT service ("/etc/init.d/bluetooth restart")


Below are detailed mapping and manipulation for step 4 above:
  1.  Make sure the MAC of BT mouse is correct in Linux. If they are different, rename the directory in linux to match the MAC found in Windows.  (Examine it character by character. This file for mine was always off by one bit by default in linux)
  2.  "LTK" -> "Key" under [LongTermKey]. Remove anything other than hex character (e.g. whitespace and dash), and convert to upper case. 
  3.  "ERand" -> "Rand" under [LongTermKey]. Do BYTE-WISE reverse and then convert hex to dec. (e.g., "12 AB" -> "AB 12" -> "43794")
  4.  "EDIV" -> "EDiv" under [LongTermKey]. Convert hex to dec. 
  5.  "IRK" -> "Key" under [IdentityResolvingKey].  Remove anything other than hex character
  6.  "CSRK" -> "Key" under [LocalSignatureKey]. Remove anything other than hex character
  7.  Leave "EncSize" and "Authenticated" unchanged

Tuesday, April 18, 2017

Notes on Pairing a Bluetooth LE Mouse with Linux


Pair in ubuntu setting failed;
With bluez and blueman installed (and bt service restarted), it pairs and works out of box

Ubuntu 16.04 LTS with kernel 4.10 amd64
Microsoft Mouse 3600
Intel 8260 WLAN/BT module
Lenovo P50 laptop

Tuesday, November 29, 2016

AptX (Apt-X) Support Checked for Google Pxiel, Moto X (Gen 1), and Moto E (Gen 2 Verizon LTE)

After checking Bluetooth HCI snoop log with Wireshark, as mentioned here, I checked AptX supportability of few devices: google pixel, moto x (gen 1, 2013), moto e (gen 2 Verizon LTE). All using stock software without root.

Some logs are collected recently, and some are few years ago. I just decided to review these logs and summarize my findings.

My results shows that Pixel does not support AptX; the rests do.

What surprises me a bit is the fact that Moto E Gen 2 Verizon LTE does support AptX, while the AptX official website does not have it as AptX enabled device. (Link here, accessed Nov 29 2016)

Screenshots of Wireshark are shown below.

Moto X Gen 1 2013 (XT1053 GSM unlocked)

Google Pixel (NA model, Verizon)

Moto E 2nd Gen LTE (XT1528 Verizon)