From f6e8a85c7fe86e957adffc4e05bf10e8f3ae8ae2 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 8 Jun 2020 00:02:59 +0200
Subject: Added some extra documentation for Android boot images.

---
 plugins/bootimg/python/format.c | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/plugins/bootimg/python/format.c b/plugins/bootimg/python/format.c
index a5dd3bc..2f66046 100644
--- a/plugins/bootimg/python/format.c
+++ b/plugins/bootimg/python/format.c
@@ -125,10 +125,30 @@ static PyObject *py_bootimg_format_get_header(PyObject *self, void *closure)
     GBootImgFormat *format;                 /* Version GLib du format      */
     const boot_img_hdr *header;             /* Entête à transcrire         */
 
-#define BOOTING_FORMAT_HEADER_ATTRIB PYTHON_GET_DEF_FULL    \
-(                                                           \
-    header, py_bootimg_format,                              \
-    "Header of the boot image."                             \
+#define BOOTING_FORMAT_HEADER_ATTRIB PYTHON_GET_DEF_FULL                        \
+(                                                                               \
+    header, py_bootimg_format,                                                  \
+    "Header of the boot image, as a pychrysalide.StructObject instance.\n"      \
+    "\n"                                                                        \
+    "All the fields are extracted from the Android *boot_img_hdr* structure:\n" \
+    "* magic: the string 'ANDROID!';\n"                                         \
+    "* kernel_size: size of the embedded kernel, in bytes;\n"                   \
+    "* kernel_addr: physical load address of the kernel;\n"                     \
+    "* ramdisk_size: size of the embedded ramdisk, in bytes;\n"                 \
+    "* ramdisk_addr: physical load address of the ramdisk;\n"                   \
+    "* second_size: size of the second stage bootloader, in bytes;\n"           \
+    "* second_addr: physical load address of the second stage bootloader;\n"    \
+    "* tags_addr: physical address for kernel tags;\n"                          \
+    "* page_size: assumed flash page size;\n"                                   \
+    "* header_version: boot image header version;\n"                            \
+    "* os_version: OS version;\n"                                               \
+    "* name: asciiz product name;\n"                                            \
+    "* cmdline: kernel command line parameters;\n"                              \
+    "* id: timestamp / checksum / sha1 / etc;\n"                                \
+    "* extra_cmdline: extra kernel command line parameters;\n"                  \
+    "* recovery_dtbo_size: size of the included recovery DTBO, in bytes;\n"     \
+    "* recovery_dtbo_offset: offset in boot image;\n"                           \
+    "* header_size: size of boot image header, in bytes.\n"                     \
 )
 
     format = G_BOOTIMG_FORMAT(pygobject_get(self));
@@ -161,10 +181,11 @@ static PyObject *py_bootimg_format_get_kernel(PyObject *self, void *closure)
     GBootImgFormat *format;                 /* Version GLib du format      */
     GBinContent *content;                   /* Contenu à transmettre       */
 
-#define BOOTING_FORMAT_KERNEL_ATTRIB PYTHON_GET_DEF_FULL                            \
-(                                                                                   \
-    kernel, py_bootimg_format,                                                      \
-    "Binary content for the (Linux) kernel contained in the boot image, or None."   \
+#define BOOTING_FORMAT_KERNEL_ATTRIB PYTHON_GET_DEF_FULL                    \
+(                                                                           \
+    kernel, py_bootimg_format,                                              \
+    "Binary content for the (Linux) kernel contained in the boot image,"    \
+    "  provided as a pychrysalide.analysis.BinContent instance, or None."   \
 )
 
     format = G_BOOTIMG_FORMAT(pygobject_get(self));
@@ -211,7 +232,8 @@ static PyObject *py_bootimg_format_get_ramdisk(PyObject *self, void *closure)
 #define BOOTING_FORMAT_RAMDISK_ATTRIB PYTHON_GET_DEF_FULL                   \
 (                                                                           \
     ramdisk, py_bootimg_format,                                             \
-    "Binary content for the ramdisk contained in the boot image, or None."  \
+    "Binary content for the ramdisk contained in the boot image,"           \
+    "  provided as a pychrysalide.analysis.BinContent instance, or None."   \
 )
 
     format = G_BOOTIMG_FORMAT(pygobject_get(self));
-- 
cgit v0.11.2-87-g4458