|Portada|Blog|Space|

[ Go back to WG-S20 index page. ]

====== Container ======

The container is just an outer header followed by a broken "tar" maybe made
with this library: SharpZipLib_0860_SourceSamples.zip.

With the following errors:

  * The filenames on the tar file were separated using a backslash.

  * There's no forward slash at the end of directory names.

  * GNU tar throws the following errors (with the zero block position changing,
    and easily ignorable with the -i flag):
    * tar: A lone zero block at (variable number)
    * tar: Exiting with failure status due to previous errors

    probably related to the padding after the backup. In any case this is no
    issue.

So creating back that kind of tar files is not an easy task, for once to remove
the trailing forward slash from directories, I had to modify GNU tar's create.c
moving ensure_slash before dump_dir0, and the call:
ensure_slash (&st->file_name); from dump_file0 to dump_dir0 after the
point when recursion_option is checked.  But once you do that modification is
just a matter of skipping the header while opening the backup, and prepending
it before the tar when creating it.

=== Outer header ===

This header is just a block of 512bytes with some fields, repeated twice. So to
open the backup it's enough to just ignore the first kilobyte, for instance:

% dd if=/media/fran/3C01-A401/BACKUP/enote.bkup bs=1 skip=1024 | tar -ix

TODO: Do a reasonable interpretation for the non-obvious fields in the header.

Here's a (non-duplicated) dump of such backup for my device:

0000000: 2b2c 3b3d 4a52 3137 0000 0000 0000 0000  +,;=JR17........
0000010: 0000 0000 0000 0000 0000 0000 5332 3000  ............S20.
0000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 312e 3030 0000 0000 0000 0000  ....1.00........
0000040: 0000 0000 0000 0000 0000 0000 5645 5231  ............VER1
0000050: 2e30 3000 0000 0000 0000 0000 0000 0000  .00.............
0000060: 0000 0000 332e 3000 0000 0000 0000 0000  ....3.0.........
0000070: 0000 0000 0000 0000 0000 0000 3030 3030  ............0000
0000080: 3030 3032 3030 3000 0000 0000 0000 0000  0002000.........
0000090: 72bc 0000 3030 3437 3034 0020 0000 0000  r...004704. ....
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000100: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................