/**
  *
  * Not-so-rudimentary-anymore Android image and partition unpacking tool
  *
  * v0.1 - Support unpacking of BootLoader and Boot images, as well as imgdata
  * v0.2 - Supports offset= (for HTC and other boot.imgs where ANDROID! is wrapped)
  *        Supports cmdline= (to override kernel command line)
  *
  * v0.3 - Integrated mkbootimg functionality, added dt_size and id
  *
  * v0.4 - cmdline, addrs..
  *
  * v0.4.1 - Fix for Edvard Holst on Essential PH1 images.. (who uses Essential nowadays, I wonder?)
  * 
  * v0.5 - Update with LZ4 binaries, fix for extract devicetree even if can't uncompress kernel
  *
  * v0.6 - Samsung images (with DT > 0) - Device Tree now found whereever it may hide
  *
  * v0.7 - system.transfer.list support
  *
  * v0.8 - FBPK (SD845 CrossHatch (Pixel 3 XL) bootloader images) AND Huawei Mate
  *        Also compiles cleanly
  *
  * v0.85 - system.transfer.list support for v4 (MTK 64 bit)
  *
  * v1.0  - EFI. Worthy enough a feature that (after three years) I hit version 1 on it, and - JCOLOR
  *
  * v1.1 - Samsung baseband images ("TOC") - 03/04/2020
  *
  * v1.2 - DTBO, super.img (03/20/2020) and integrated Brötli
  *
  * v1.2.1 - Lots of QCOM EFI GUIDs added. Thanks to anonymous contributor!
  *
  * v1.3 - Can now also pack super.img and boot.img based on existing!
  *
  * v1.4 - uBoot uimage format
  *
  * v1.5 - MTK images!
  *
  * v1.5.1 - Fixes: QCOM FPBK fixed (accidentally removed during refactoring around 1.3.. oops)
  *                 UEFI now unpacks files by UI, if presenr, rather than GUID
  *
  * 1.6 - Peek into images to detect payload format, recognize AVB (vbmeta)
  *
  * 1.7 - boot Img header v2,3 and vendor boot images
  *
  * 1.8 - CrAu
  *
  * 1.9 - LZ4/BZ2 integration, selective extraction (extract ..what.. in commandline for some formats)
  *
  * 1.9.1 - Motorola bootloader images (SnL, thanks to NL), some bugfixes
  *
  * 1.10  - FBPK/FBPTv2 (Pixel 6)  
  *
  * 2.0 (beta) - ZIP (including partial zips), XZ, BZ2 and LZ4 now built in 
  *
  * 2.0 (beta1) - Spreadtrum PAC(ket) format, a few bugfixes.
  *
  * 2.0 (beta2) - fixed LZ4 0.1-0.9
  *
  * --------------------------------------
  *
  * 2 - Time for version 2 - ZIP support, including partial/broken zips! (take that, unzip!)
  *
  * 2 - (still 2.0, beta) PBZX, AA/YAA, LZFSE (BVX2) - even in IMG4 containers (for IPSW unpacking)
  *                       AR (.a) and RTKIT FTAB and AAPL symbolcaches
  *
  * 2 - Finally, 2: Extract by ranges (0x..-.../0x...+....), and find in images (-f)
  *
  * 2.0.1 - AAPL Bundles (exclavecore)
  *
  * 2.0.2 - ZOWIEBOX? whatever that is, I support it now :-)
  *
  * 2.0.3 - Fixes and improvements to LZ4 (Thank you , Ori!) Also put back the x86_64 Linux binaries..
  *
  * Acknowledgements/Notes:
  * -----------------------
  *
  *  platform-innovation-framework-for-uefi-complete-specifications-v0.90-v0.97 from Intel was invaluable
  *  for figuring out EFI
  *
  *  Uses Google's Brotli extraction code (there's a limit to how much I'm willing to re-implement!)
  *  Uses libLZMA and LZ4 (because it's everywhere nowadays)
  *  Uses lzfse from AAPL's GitHub
  *
  *  Both above code bases are free to license and use, so I did. Note credit where credit is due.
  *  All other code is 100% J-Code.
  *
  * This tool is part of the free downloads for the book "Android Internals: A Confectioner's Cookbook"
  * But (as of v1.0) is also quite useful or MacOS T2 firmwares and (as of 2.0) useful for Apple's PBZX
  * (integrated code of my old OTA tool, q.v. http://NewOSXBook.com/articles/ for the nine part saga there)
  *
  * Author: Jonathan Levin, http://NewAndroidBook.com
  *
  * License: Use freely, BUT please please give credit. This way people learn of the website and books.
  *
  *  If you have suggestions for improvement/new image types/etc - let me know and I'll gladly 
  *	     add them in.
  *
  **/


