Skip to content

Commit

Permalink
add a specification for the bootloader used on several ASUS Android d…
Browse files Browse the repository at this point in the history
…evices (#472)

* add a specification for the bootloader used on several ASUS Android
devices.

* android_asus_bootldr: add info about test file

* android_asus_bootldr: rename `len_image` to  `len_body`

* android_asus_bootldr: add `valid` checks

* android_asus_bootldr: add a value instance `image_name`

... resolving the image file name based on known `magic`
strings

* android_asus_bootldr: change key order (`size` above `type`)

* android_asus_bootldr: rename `magic` to `chunk_id`

Co-authored-by: Petr Pucil <[email protected]>
  • Loading branch information
armijnhemel and generalmimon authored Jul 5, 2021
1 parent 610b7a8 commit 82d9493
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions archive/android_asus_bootldr.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
meta:
id: android_asus_bootldr
title: ASUS Fugu bootloader.img format (version 2 and later)
file-extension: img
tags:
- archive
- android
license: CC0-1.0
ks-version: 0.9
encoding: ASCII
endian: le
doc: |
A bootloader image which only seems to have been used on a few ASUS
devices. The encoding is ASCII, because the `releasetools.py` script
is written using Python 2, where the default encoding is ASCII.
A test file can be found in the firmware files for the "fugu" device,
which can be downloaded from <https://developers.google.com/android/images>
doc-ref: https://android.googlesource.com/device/asus/fugu/+/android-8.1.0_r5/releasetools.py
seq:
- id: magic
contents: BOOTLDR!
- id: revision
type: u2
valid:
min: 2
- id: reserved1
type: u2
- id: reserved2
type: u4
- id: images
type: image
repeat: expr
repeat-expr: 3
doc: |
Only three images are included: `ifwi.bin`, `droidboot.img`
and `splashscreen.img`
types:
image:
-webide-representation: '{file_name}'
seq:
- id: chunk_id
size: 8
type: str
valid:
any-of:
- '"IFWI!!!!"'
- '"DROIDBT!"'
- '"SPLASHS!"'
- id: len_body
type: u4
- id: flags
type: u1
valid:
expr: _ & 1 != 0
- id: reserved1
type: u1
- id: reserved2
type: u1
- id: reserved3
type: u1
- id: body
size: len_body
instances:
file_name:
value: |
chunk_id == "IFWI!!!!" ? "ifwi.bin" :
chunk_id == "DROIDBT!" ? "droidboot.img" :
chunk_id == "SPLASHS!" ? "splashscreen.img" :
""

0 comments on commit 82d9493

Please sign in to comment.