Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored Jul 9, 2019
1 parent c1c4be4 commit 76871f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ A `qdtar` archive is a slightly modified `tar` archive, used to pack the root fi

***

The file format is simple: a header of 978 bytes whose contents are completely ignored, prepended to a normal `tar` archive.
This kind of file is formed by a header of 978 bytes, whose contents are completely ignored, prepended to a normal `tar` archive.

The [executable found on the firmware](busybox) zero-fills the header when creating a new archive. However, the archives found in official firmware upgrade packages used a different approach:

* The first 970 bytes of the header were filled with a copy of the first 970 bytes of the `tar` file.
* The next 8 bytes were used to store the magic number (`QDTAR1.0`).

I suspect that the filling of the header with a copy of the first bytes of the `tar` file is a mistake made by the developer of the packer app. Probably the original code shifts the data on a buffer by copying it to the new offset without taking care of zeroing the contents of the header. The other possibility (more conspiranoid) is that copying the first bytes of the `tar` archive will fool a normal decompression utility.
I suspect that filling of the header with a copy of the first bytes of the `tar` file was only a mistake made by the developer of the packer application. Probably the original code shifts the data on a buffer by copying it to the new offset without taking care of zeroing the contents of the header. There is, however, anoher credible explanation: copying the first bytes of the `tar` archive will fool a normal decompression utility.

0 comments on commit 76871f7

Please sign in to comment.