unpackbootimg: not working on Asus ZenFone 2 boot.img
When I run unpackbootimg on a boot.img for Asus ZenFone 2, it ouputs garbage.
pmbootstrap chroot
[11:40:05] (native) % sh -i
[11:40:05] Update package index for armhf, aarch64, x86_64, x86 (16 file(s))
[11:40:11] (native) install alpine-base
/ # cd tmp/
/tmp # ls
boot.img
/tmp # apk add mkbootimg-osm0sis
(1/1) Installing mkbootimg-osm0sis (2018.05.10-r0)
Executing busybox-1.28.4-r2.trigger
OK: 7 MiB in 19 packages
/tmp # unpackbootimg -i boot.img -o out
Android magic found at: 9430
BOARD_KERNEL_CMDLINE MMAP to e820 table
BOARD_KERNEL_BASE 7464e420
BOARD_NAME d
BOARD_PAGE_SIZE 1146244352
BOARD_HASH_TYPE sha256
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET ce9b2644
BOARD_SECOND_OFFSET ef009045
BOARD_TAGS_OFFSET 95ff8154
BOARD_OS_VERSION 50.93.12
BOARD_OS_PATCH_LEVEL 2054-05
BOARD_DT_SIZE 1952801824
cmdline is certainly wrong, should be init=/init pci=noearly console=ttyS0 console=logk0 earlyprintk=nologger bootup.uart=0 loglevel=8 kmemleak=off androidboot.bootmedia=sdcard androidboot.hardware=redhookbay watchdog.watchdog_thresh=60 androidboot.spid=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx androidboot.serialno=01234567890123456789 ip=50.0.0.2:50.0.0.1::255.255.255.0::usb0:on vmalloc=172M buildvariant=userdebug
, NMAP to e820 table
seems to be a part of a debug? message at 2724: Bootstub: map SFI MMAP to e820 table
Page size is also obviously wrong, the offsets, board name, kernel base and sizes look suspicious to me. Maybe it's detecting android magic in the wrong place?