From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Format:TP-Link firmware header" |
|---|
| claim | "A TP-Link safeloader image has a 0x14-byte preamble: for the default, vendor and cloud types a big-endian size (including the preamble) followed by a 16-byte salted MD5; for the QNEW type the order is reversed (MD5 first, then the size, which does not include the preamble). The type is classified from the 64 bytes after the preamble: 'fw-type:Cloud', '?NEW' (payload at 0x1050), a leading big-endian length <= 0x1000 (vendor type) or default; the payload at 0x1014 begins with an 0x800-byte table of 'fwup-ptn <name> base 0x.. size 0x..' lines." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:TP-Link firmware header" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "read 64 bytes at offset 0x14" |
|---|
| indicator | "fw-type:Cloud / ?NEW / length <= 0x1000; then fwup-ptn lines at the payload offset" |
|---|
| table | | type | "cloud" |
|---|
| payload_offset | "0x1014" |
|---|
| test | "starts with fw-type:Cloud" |
|---|
|
| type | "qnew" |
|---|
| payload_offset | "0x1050" |
|---|
| test | "starts with ?NEW" |
|---|
|
| type | "vendor" |
|---|
| payload_offset | "0x1014" |
|---|
| test | "BE u32 <= 0x1000" |
|---|
|
| type | "default" |
|---|
| payload_offset | "0x1014" |
|---|
| test | "otherwise" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "safeloader_parse_image classification, SAFELOADER_* constants, put_partitions writes fwup-ptn lines, SupportList: texts in boards[]" |
|---|
| repo | "https://github.com/openwrt/firmware-utils" |
|---|
| commit | "0179ab1e367f756ac108a485f26585661d4c528c" |
|---|
| path | "src/tplink-safeloader.c" |
|---|
| lines | "130-180, 3747-3776, 3803-3825, 4215-4253" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Safeloader image variants" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T06:50:47.756Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:41:40.162Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched tplink-safeloader.c at 0179ab1 and read the type comment 126-157, constants 172-180 and safeloader_parse_image 4215-4252: 64 bytes read after the 0x14 preamble, '?NEW' tested first, then 'fw-type:Cloud', then BE u32 <= 0x1000 (vendor), else default; payload offsets 0x1014 and 0x1050; QNEW reversed preamble with size excluding the preamble. Matches the claim." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T10:08:20.935Z" |
|---|
| summary | "tplink-safeloader.c 126-157: the QNEW type has a reversed preamble (MD5 first, then a size that excludes the preamble); the claim gave one preamble layout for all types." |
|---|
| changed | |
|---|
|
|
|---|