DEV IN PROGRESS

Module pychrysalide.format.bootimg

Documentation

The boot image is part of the Android boot process.

It mostly contains the Linux kernel and the early startup tools, and the recovery helpers as well.

Its whole content is documented at: https://source.android.com/devices/bootloader/boot-image-header

Classes

Class BootImgFormat

BootImgFormat provides support for Android boot images.

Instances can be created using the following constructor:

    BootImgFormat(content)

Where content is the binary content of a file usually named 'boot.img', provided as a BinContent instance.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.format.KnownFormat
           ╰── pychrysalide.format.bootimg.BootImgFormat

Implements: pychrysalide.analysis.storage.SerializableObject

Attributes

header

Header of the boot image, as a StructObject instance.

All the fields are extracted from the Android boot_img_hdr structure:

  • magic: the string 'ANDROID!';
  • kernel_size: size of the embedded kernel, in bytes;
  • kernel_addr: physical load address of the kernel;
  • ramdisk_size: size of the embedded ramdisk, in bytes;
  • ramdisk_addr: physical load address of the ramdisk;
  • second_size: size of the second stage bootloader, in bytes;
  • second_addr: physical load address of the second stage bootloader;
  • tags_addr: physical address for kernel tags;
  • page_size: assumed flash page size;
  • header_version: boot image header version;
  • os_version: OS version;
  • name: asciiz product name;
  • cmdline: kernel command line parameters;
  • id: timestamp / checksum / sha1 / etc;
  • extra_cmdline: extra kernel command line parameters;
  • recovery_dtbo_size: size of the included recovery DTBO, in bytes;
  • recovery_dtbo_offset: offset in boot image;
  • header_size: size of boot image header, in bytes.

kernel

Binary content for the (Linux) kernel contained in the boot image, provided as a BinContent instance, or None.

ramdisk

Binary content for the ramdisk contained in the boot image, provided as a BinContent instance, or None.