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:Rockchip RKFW update image

From ReverseEngineering.wiki
Format
Magic RKFW (52 4B 46 57)
Extensions .img
Endianness little
License GPL-2.0+ (rkdeveloptool)
On this wiki Facts · Code · Notes · Topics

Rockchip's firmware package (update.img, magic 'RKFW', 0x57464B52 read little-endian): a 102-byte header pointing to a boot loader blob (RKBOOT) and a firmware blob, followed by a 32-byte MD5 and optionally a signature; read by rkdeveloptool and upgrade_tool.

Overview

Rockchip SoC devices (tablets, TV boxes, SBCs) ship update.img files for the Rockchip USB tool (rkdeveloptool, upgrade_tool). The RKFW container wraps two parts: a loader (the boot blob that runs from the SoC's boot ROM, with its own RKBOOT tag) and the firmware (flash content, in a different RKAF container or GPT-based image).

Header (STRUCT_RKIMAGE_HEAD, packed, little-endian)

Offset Field
0 tag u32 = 0x57464B52 (bytes 52 4B 46 57, "RKFW")
4 size u16 (header size)
6 version u32
10 merge version u32
14 release time: year u16, month, day, hour, minute, second (1 byte each)
21 supported chip, enum ENUM_RKDEVICE_TYPE (32 bit)
25 boot offset u32
29 boot size u32
33 firmware offset u32
37 firmware size u32
41 reserved[61]

Offsets are computed from the field order (packed struct); the sum is 102 bytes. If reserved[14..15] (file offsets 55-56) are the ASCII letters HI, the u32 at reserved[16] (file offset 57) is the high 32 bits of the firmware end offset, for images over 4 GiB.

Chip codes in the enum include RK28 0x20, RK29 0x50, RK30 0x60 and RK32 0x80 (others sit between them; read DefineHeader.h).

Trailer

After the firmware part (offset + size) the tool expects a 32-byte MD5 (it reads these 32 bytes as the digest text). If at least 160 bytes remain there, the 32 bytes are followed by a signature block; otherwise the last 32 bytes of the file are the MD5. Unverified: what exactly the MD5 covers (presumably the file before it) and the signature algorithm.

Inner parts

Unverified: the firmware part of many older Rockchip images starts with RKAF (a package header with a list of named partitions: name, path, offset, size) and the loader part begins with BOOT or LDR ; rkdeveloptool does not parse RKAF, so check afptool-style unpackers. Newer images use GPT with a parameter file.

See Technique:Unpacking firmware update containers.

Sources: rockchip-linux/rkdeveloptool RKImage.h and RKImage.cpp, DefineHeader.h.

Code & repositories

  • https://github.com/rockchip-linux/rkdeveloptool @ 304f073752fd25c854e1bcf05d8e7f925b1f4e14 · license: GPL-2.0
    RKImage.h and RKImage.cpp: RKFW header and trailer handling
    Tested on: source read, not run · checked 2026-10-18; last activity 2025-03-07