12-03-2020, 11:05 PM
This is a step by step guide showing how to verify the contents of a vbmeta image. This will come handy if you need certain information from your original vbmeta such as partition names, algorithm e.t.c.
Important Notice
Requirements
- Your VBmeta image (extract from the firmware of your device)
- Download & install Python 2.x @ https://www.python.org/downloads/ (For windows, i'm using python v2.7.10 and during installation, ensure to add python to Path)
- Download avbtool.py @ https://mega.nz/#!s7JEGCbA!9H2KJkppDGYbU...w7yLOHL9KA
Steps on how to verify the contents of a vbmeta image
Follow the steps below to verify the contents of a vbmeta image
- Copy your vbmeta.img and the avbtool.py into the same folder location
- If you're using a windows PC, right click on any empty space in the folder then click Open CMD or Powershell window here
- When the command window opens, type and input the command below then press Enter key
Code:python avbtool.py info_image --image vbmeta-sign.img
- The info contained within the vbmeta image will be displayed. This includes useful information such as algorithm, partition names, partition roll back index location, public key hashes
Here's a sample of the content of the vbmeta image used in this guide
Note that the same contents has been confirmed on 3 different SPD / Unisoc phones, all from different non-related OEMs. Therefore, the chances are that your device will have the same vbmeta contents
Code:
Minimum libavb version: 1.0
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 13504 bytes
Algorithm: SHA256_RSA4096
Rollback Index: 0
Flags: 0
Release String: 'avbtool 1.1.0'
Descriptors:
Chain Partition descriptor:
Partition Name: boot
Rollback Index Location: 1
Public key (sha1): ea410c1b46cdb2e40e526880ff383f083bd615d5
Chain Partition descriptor:
Partition Name: system
Rollback Index Location: 3
Public key (sha1): e2c66ff8a1d787d7bf898711187bff150f691d27
Chain Partition descriptor:
Partition Name: vendor
Rollback Index Location: 4
Public key (sha1): 9885bf5bf909e5208dfd42abaf51ad9b104ee117
Chain Partition descriptor:
Partition Name: product
Rollback Index Location: 10
Public key (sha1): 766a95798206f6e980e42414e3cb658617c27daf
Chain Partition descriptor:
Partition Name: dtbo
Rollback Index Location: 9
Public key (sha1): ea410c1b46cdb2e40e526880ff383f083bd615d5
Chain Partition descriptor:
Partition Name: recovery
Rollback Index Location: 2
Public key (sha1): d9093b9a181bdb5731b44d60a9f850dc724e2874
Chain Partition descriptor:
Partition Name: l_modem
Rollback Index Location: 5
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_ldsp
Rollback Index Location: 6
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_gdsp
Rollback Index Location: 7
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: pm_sys
Rollback Index Location: 8
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: dtb
Rollback Index Location: 11
Public key (sha1): ea410c1b46cdb2e40e526880ff383f083bd615d5
Important Notice
- If you encounter the error "Given image does not look like a vbmeta image" then see this post
- If you encounter any errors while trying to use avbtool.py on windows, then install and add openssl into PATH if the problem persists then you might want to consider using a linux OS instead. See this guide for how to live boot a linux OS on a windows PC
- If you verified the contents of your vbmeta and it matches with the contents of the one we used for this guide, and you intend to extract public keys from your vbmeta, then you can simply download the public keys @ https://mega.nz/#!uCwHyAYA!FLiwcSaSLpAl6...Gtgpe28kEA . It'll be the same as what you'll get if you manually extract the public keys yourself
- Credits goes to Petercxy