Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Linux arm64 Image

From ReverseEngineering.wiki
Format
Vendor Linux kernel (GPL-2.0)
Magic 41 52 4D 64 at offset 0x38
Extensions Image, Image.gz, Image.lz4, Image.zst
Endianness little endian (header fields); flags bit 0 = big-endian kernel
On this wiki Facts · Code · Notes · Topics

The uncompressed AArch64 Linux kernel image: a 64-byte header whose last words hold the magic 0x644d5241 (bytes 41 52 4D 64, "ARM\x64") at offset 0x38, with text_offset, image_size and flags at 0x08, 0x10 and 0x18.

Identification

The AArch64 kernel build target Image starts with a 64-byte header documented in Documentation/arch/arm64/booting.rst section 4. Check the 4 bytes at file offset 0x38: 41 52 4D 64 (u32 0x644d5241, "ARM\x64"). Fields are little endian (since v3.17) whatever the kernel endianness.

Fact:Linux arm64 Image/struct/Image header has the layout: code0, code1 (branch to stext), text_offset (u64, 0x08), image_size (u64, 0x10), flags (u64, 0x18), three reserved u64 and then magic (0x38) and res5 (0x3C, the offset of the PE header when the image is also an EFI application).

Flags

Bit 0: kernel endianness (1 = big endian). Bits 1-2: page size (0 unspecified, 1 4K, 2 16K, 3 64K). Bit 3: physical placement (0: 2 MB aligned base as close to DRAM base as possible; 1: base chosen so image_size bytes lie within 48-bit physical range). Bits 4-63 reserved.

Before v3.17 text_offset had unspecified endianness; then image_size is zero and text_offset can be assumed to be 0x80000.

Reversing tips

  • There is no decompressor in the AArch64 kernel: Image.gz (or lz4/zst) is decompressed by the boot loader, so the payload is a plain gzip/lz4/zstd stream of this Image; see Platform:Linux kernel for the container zoo (Android boot.img, U-Boot uImage).
  • Because the file is a flat binary, not an ELF, load it at (a 2 MB aligned base) + text_offset and recover names with Format:Kallsyms / Tool:vmlinux-to-elf.
  • With EFI stub enabled the file starts with MZ (4D 5A) and a PE header at res5 while the magic at 0x38 still reads ARM\x64: Unverified for the exact byte layout; read booting.rst and the arm64 head.S.

Code & repositories

  • https://github.com/torvalds/linux @ f909e534f5e34feb2ea2701d54df63e21aa506fc · license: GPL-2.0 WITH Linux-syscall-note (declared by the contributor for the files used; GitHub reports GPL-2.0 WITH Linux-syscall-note (read from COPYING; GitHub's detector did not classify it) for the repository)
    Linux kernel (GPL-2.0): Documentation/arch/arm64/booting.rst, include/uapi/linux/module_signature.h, kernel/module/signing.c, kernel/module/decompress.c, init/version-timestamp.c, kernel/kallsyms.c
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18

See also

Format:Linux x86 boot image (bzImage), Platform:Linux kernel.