Information of the SPI flash
Dump the SPI flash by using the linux command line tool dd
.
Command: dd if=/dev/mtd0 of=mtd0
This will dump the SPI flash to the file mtd0.
This is what the SPI flash device tree entry looks like.
The first 6128 bytes are the BCT, encrypted with your platform key. The loader for UEFI is located at 0x0100000.
To check it yourself,
To encrypt the BCT you got form nvflash use the following script, and replace <platform key> with your platform key.
Example usage: ./encrypt.sh surfacert.bct surfacert-encrypted.bct
To check if it is really the same, create a hexdump of your SPI flash dump and encrypted BCT. Your encrypted BCT should match the first 6128 bytes of the SPI flash dump.
The files are encrypted and board specific. You cant use them on your Surface RT
A dump from @Leander's Surface RT. Here is the platform key of the used Surface RT: 28a5d126adf421e6a39bfc8f7ff32308
The following script processes a SPI dump. It extracts and decrypts the BCT & Bootloader
The Boot rom starts and loads the firmware from a SPI-Flash.
Replay Protected Memory Block partition on the internal emmc
This part of the emmc is meant to be only read and written by trusted software.
As it turns out you can read this partition on some devices. It is possible if you have a "CMD12" emmc. If it is a "CMD13" emmc it doesn't work. Read operations happen from within linux, also information about the emmc is gathered there, use the following commands:
The extcsd.txt file will contain extcsd information of your emmc, the rpmb.img file will contain the RPMB dump, if dumping works.
If you happen to do this process contact @utf-4096 on our discord server, as he is interested in this information (if dumping worked and in the extcsd info).
Boot Configuration Table
To decompile your BCT into a configuration file, use the tool bct_dump.
Usage: bct_dump <your-bct-file>
Tip you can add > <output-file>
to reroute the output to a file.
You can compile your bct.cfg file by using the tool cbootimage.
Usage: cbootimage -s tegra30 -t 30 -gbct <input-bct-configuration-file> <output-bct-file>
Example: cbootimage -s tegra30 -t 30 -gbct surfacert-custom.bct.cfg surfacert-custom.bct
To generate a image file with your BCT and provided bootloader, again use cbootimage.
Usage: cbootimage -d -s tegra30 -t 30 <input-config-file> <output-image-file>
Example: cbootimage -d -s tegra30 -t 30 surfacert.config surfacert.output
<input-config-file> is a file controlling how the .img file should be created. It has the following structure:
Example:
Doing this will create a image file of your BCT and the bootloader you provided. The BCT will automatically updated with the correct sizes and hashes.
The boot configuration table contains information about which bootloader to boot. On the Surface RT it is stored on the SPI flash. Go to , to dump it directly from SPI. Or do it with nvflash (recommended): sudo ./utils/nvflash_v1.13.87205 --getbct --bct surfacert.bin --configfile ./utils/flash.cfg