10 #include "u8-mbtouc.h"
18 all_ascii(const uint8_t *p, size_t n)
20 for (size_t i = 0; i < n; i++)
21 if (p[i] < 32 || p[i] > 126)
27 try_find(const char *target, size_t target_len)
29 const uint8_t *pos = (const uint8_t *) memmem (data, n, target, target_len);
30 return pos ? pos - data : 0;
34 find(const char *target, size_t target_len)
36 size_t pos = try_find(target, target_len);
39 fprintf (stderr, "not found\n");
48 #define STR(x) XSTR(x)
49 #define WHERE __FILE__":" STR(__LINE__)
61 memcpy(&x, &data[pos], 4);
66 static unsigned long long int
70 memcpy(&x, &data[pos], 8);
79 x = (data[pos] << 24) | (data[pos + 1] << 16) | (data[pos + 2] << 8) | data[pos + 3];
88 memcpy(&x, &data[pos], 2);
97 memcpy(&x, &data[pos], 8);
102 static double __attribute__((unused))
106 memcpy(&x, &data[pos], 4);
112 match_u32(uint32_t x)
121 match_u32_assert(uint32_t x, const char *where)
123 unsigned int y = get_u32();
126 fprintf(stderr, "%s: 0x%x: expected i%u, got i%u\n", where, pos - 4, x, y);
130 #define match_u32_assert(x) match_u32_assert(x, WHERE)
132 static bool __attribute__((unused))
133 match_be32(uint32_t x)
142 match_be32_assert(uint32_t x, const char *where)
144 unsigned int y = get_be32();
147 fprintf(stderr, "%s: 0x%x: expected be%u, got be%u\n", where, pos - 4, x, y);
151 #define match_be32_assert(x) match_be32_assert(x, WHERE)
154 match_byte(uint8_t b)
156 if (pos < n && data[pos] == b)
166 match_byte_assert(uint8_t b, const char *where)
170 fprintf(stderr, "%s: 0x%x: expected %02x, got %02x\n", where, pos, b, data[pos]);
174 #define match_byte_assert(b) match_byte_assert(b, WHERE)
177 newline(FILE *stream, int pos)
179 fprintf(stream, "\n%08x: ", pos);
183 dump_raw(FILE *stream, int start, int end)
185 for (size_t i = start; i < end; )
192 && i + 4 + data[i] + data[i + 1] * 256 <= end
193 && all_ascii(&data[i + 4], data[i] + data[i + 1] * 256))
196 fprintf(stream, "\"");
197 fwrite(&data[i + 4], 1, data[i] + data[i + 1] * 256, stream);
198 fputs("\" ", stream);
200 i += 4 + data[i] + data[i + 1] * 256;
202 else if (i + 12 <= end
209 memcpy (&d, &data[i + 4], 8);
210 fprintf (stream, "F40.%d(%.*f)", data[i], data[i], d);
214 else if (i + 12 <= end
221 memcpy (&d, &data[i + 4], 8);
222 fprintf (stream, "PCT40.%d(%.*f)", data[i], data[i], d);
226 else if (i + 4 <= end
227 && (data[i] && data[i] != 88 && data[i] != 0x41)
232 fprintf (stream, "i%d ", data[i]);
237 fprintf(stream, "%02x ", data[i]);
245 static bool __attribute__((unused))
246 all_utf8(const char *p_)
248 const uint8_t *p = (const uint8_t *) p_;
249 size_t len = strlen ((char *) p);
250 for (size_t ofs = 0, mblen; ofs < len; ofs += mblen)
254 mblen = u8_mbtouc (&uc, p + ofs, len - ofs);
255 if ((uc < 32 && uc != '\n') || uc == 127 || uc == 0xfffd)
262 get_string(const char *where)
265 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
266 /*&& all_ascii(&data[pos + 4], data[pos])*/)
268 int len = data[pos] + data[pos + 1] * 256;
269 char *s = malloc(len + 1);
271 memcpy(s, &data[pos + 4], len);
278 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
282 #define get_string() get_string(WHERE)
285 get_string_be(const char *where)
288 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
289 /*&& all_ascii(&data[pos + 4], data[pos])*/)
291 int len = data[pos + 2] * 256 + data[pos + 3];
292 char *s = malloc(len + 1);
294 memcpy(s, &data[pos + 4], len);
301 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
305 #define get_string_be() get_string_be(WHERE)
314 static void __attribute__((unused))
315 hex_dump(int ofs, int n)
317 for (int i = 0; i < n; i++)
319 int c = data[ofs + i];
322 fprintf(stderr, "-");
324 fprintf(stderr, " ");
326 fprintf(stderr, "%02x", c);
328 for (int i = 0; i < n; i++)
330 int c = data[ofs + i];
331 fprintf(stderr, "%c", c >= 32 && c < 127 ? c : '.');
333 fprintf(stderr, "\n");
337 dump_counted_string(void)
340 int inner_end = get_end();
341 if (pos != inner_end)
346 match_byte_assert(0x58);
350 if (match_byte(0x31))
353 match_byte_assert(0x58);
354 if (pos != inner_end)
356 fprintf(stderr, "inner end discrepancy\n");
364 dump_style(FILE *stream)
370 match_byte_assert(1);
371 char *fg = get_string(); /* foreground */
372 char *bg = get_string(); /* background */
373 char *font = get_string(); /* font */
374 int size = data[pos];
376 match_byte_assert(12); /* size? */
377 fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%d\"",
382 dump_nested_string(FILE *stream)
386 match_byte_assert (0);
387 match_byte_assert (0);
388 int outer_end = get_end();
389 s = dump_counted_string();
391 fprintf(stream, " \"%s\"", s);
392 if (match_byte(0x31))
395 match_byte_assert(0x58);
396 match_byte_assert(0x58);
397 if (pos != outer_end)
399 fprintf(stderr, "outer end discrepancy\n");
407 dump_value_modifier(FILE *stream)
409 if (match_byte (0x31))
413 fprintf(stream, "<special0");
416 /* Corpus frequencies:
421 The given text is appended to the cell in a subscript font.
423 fprintf(stream, " subscript=\"%s\"", get_string());
426 match_u32_assert (0);
430 /* We only have one SPV file for this version (with many
437 if (!match_u32(0) && !match_u32(1) && !match_u32(2) && !match_u32(3) && !match_u32(4) && !match_u32(5) && !match_u32(6) && !match_u32(7) && !match_u32(8) && !match_u32(9))
438 match_u32_assert(10);
441 fprintf(stream, "/>\n");
445 int outer_end = get_end();
447 /* This counted-string appears to be a template string,
448 e.g. "Design\: [:^1:]1 Within Subjects Design\: [:^1:]2". */
449 char *template = dump_counted_string();
451 fprintf(stream, " template=\"%s\"", template);
453 if (match_byte(0x31))
456 match_byte_assert(0x58);
457 if (match_byte(0x31))
459 /* Only two SPV files have anything like this, so it's hard to
465 match_byte_assert(1);
466 match_byte_assert(0);
467 if (!match_byte(8) && !match_byte(1))
468 match_byte_assert(2);
469 match_byte_assert(0);
470 match_byte_assert(8);
471 match_byte_assert(0);
472 match_byte_assert(10);
473 match_byte_assert(0);
476 match_byte_assert(0x58);
477 if (pos != outer_end)
479 fprintf(stderr, "outer end discrepancy\n");
482 fprintf(stream, "/>\n");
486 int count = get_u32();
487 fprintf(stream, "<footnote-ref indexes=\"");
488 for (int i = 0; i < count; i++)
492 fprintf(stream, "%d", get_u16());
495 match_byte_assert(0);
496 match_byte_assert(0);
497 dump_nested_string(stream);
498 fprintf(stream, "/>\n");
502 match_byte_assert (0x58);
506 format_to_string (int type)
512 case 2: return "AHEX";
513 case 3: return "COMMA";
514 case 4: return "DOLLAR";
515 case 5: case 40: return "F";
517 case 7: return "PIBHEX";
519 case 9: return "PIB";
520 case 10: return "PK";
521 case 11: return "RB";
522 case 12: return "RBHEX";
526 case 20: return "DATE";
527 case 21: return "TIME";
528 case 22: return "DATETIME";
529 case 23: return "ADATE";
530 case 24: return "JDATE";
531 case 25: return "DTIME";
532 case 26: return "WKDAY";
533 case 27: return "MONTH";
534 case 28: return "MOYR";
535 case 29: return "QYR";
536 case 30: return "WKYR";
537 case 31: return "PCT";
538 case 32: return "DOT";
539 case 33: return "CCA";
540 case 34: return "CCB";
541 case 35: return "CCC";
542 case 36: return "CCD";
543 case 37: return "CCE";
544 case 38: return "EDATE";
545 case 39: return "SDATE";
548 sprintf(tmp, "<%d>", type);
554 dump_value(FILE *stream, int level)
561 for (int i = 0; i <= level; i++)
562 fprintf (stream, " ");
569 dump_value_modifier(stream);
571 value = get_double ();
572 fprintf (stream, "<number value=\"%.*g\" format=\"%s%d.%d\"/>\n",
573 DBL_DIG, value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
575 else if (match_byte (2))
581 dump_value_modifier (stream);
583 value = get_double ();
585 vallab = get_string ();
586 fprintf (stream, "<numeric-datum value=\"%.*g\" format=\"%s%d.%d\"",
587 DBL_DIG, value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
589 fprintf (stream, " variable=\"%s\"", var);
591 fprintf (stream, " label=\"%s\"", vallab);
592 fprintf (stream, "/>\n");
593 if (!match_byte (1) && !match_byte(2))
594 match_byte_assert (3);
596 else if (match_byte (3))
598 char *text = get_string();
599 dump_value_modifier(stream);
600 char *identifier = get_string();
601 char *text_eng = get_string();
602 fprintf (stream, "<string c=\"%s\"", text_eng);
604 fprintf (stream, " identifier=\"%s\"", identifier);
605 if (strcmp(text_eng, text))
606 fprintf (stream, " local=\"%s\"", text);
607 fprintf (stream, "/>\n");
609 match_byte_assert(1);
611 else if (match_byte (4))
614 char *var, *vallab, *value;
616 dump_value_modifier(stream);
618 vallab = get_string ();
620 if (!match_byte(1) && !match_byte(2))
621 match_byte_assert (3);
622 value = get_string ();
623 fprintf (stream, "<string-datum value=\"%s\" format=\"%s%d.%d\"",
624 value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
626 fprintf (stream, " variable=\"%s\"", var);
628 fprintf (stream, " label=\"%s\"/>\n", vallab);
629 fprintf (stream, "/>\n");
631 else if (match_byte (5))
633 dump_value_modifier(stream);
634 char *name = get_string ();
635 char *label = get_string ();
636 fprintf (stream, "<variable name=\"%s\"", name);
638 fprintf (stream, " label=\"%s\"", label);
639 fprintf (stream, "/>\n");
640 if (!match_byte(1) && !match_byte(2))
641 match_byte_assert(3);
645 dump_value_modifier(stream);
647 char *base = get_string();
649 fprintf (stream, "<template format=\"%s\">\n", base);
650 for (int i = 0; i < x; i++)
657 for (int j = 0; j <= level + 1; j++)
658 fprintf (stream, " ");
659 fprintf (stream, "<substitution index=\"%d\">\n", i + 1);
660 for (int j = 0; j < y; j++)
661 dump_value (stream, level + 2);
662 for (int j = 0; j <= level + 1; j++)
663 fprintf (stream, " ");
664 fprintf (stream, "</substitution>\n");
666 for (int j = 0; j <= level; j++)
667 fprintf (stream, " ");
668 fprintf (stream, "</template>\n");
673 compare_int(const void *a_, const void *b_)
677 return *a < *b ? -1 : *a > *b;
681 check_permutation(int *a, int n, const char *name)
684 memcpy(b, a, n * sizeof *a);
685 qsort(b, n, sizeof *b, compare_int);
686 for (int i = 0; i < n; i++)
689 fprintf(stderr, "bad %s permutation:", name);
690 for (int i = 0; i < n; i++)
691 fprintf(stderr, " %d", a[i]);
698 dump_category(FILE *stream, int level, int **indexes, int *allocated_indexes,
701 for (int i = 0; i <= level; i++)
702 fprintf (stream, " ");
703 printf ("<category>\n");
704 dump_value (stream, level + 1);
706 int merge = data[pos];
708 match_byte_assert (1);
710 match_byte_assert (0);
712 int unindexed = data[pos];
714 match_byte_assert (1);
719 match_u32_assert (2);
721 int indx = get_u32();
722 int n_categories = get_u32();
727 for (int i = 0; i <= level + 1; i++)
728 fprintf (stream, " ");
729 fprintf (stream, "<merge/>\n");
736 fprintf(stderr, "index not -1 but merged\n");
741 fprintf(stderr, "index not -1 but x != 2\n");
744 if (n_categories != 0)
746 fprintf(stderr, "index not -1 but subcategories\n");
749 if (*n_indexes >= *allocated_indexes)
751 *allocated_indexes = *allocated_indexes ? 2 * *allocated_indexes : 16;
752 *indexes = realloc(*indexes, *allocated_indexes * sizeof **indexes);
754 (*indexes)[(*n_indexes)++] = indx;
757 int expected_unindexed = indx == -1;
758 if (unindexed != expected_unindexed)
760 fprintf(stderr, "unindexed (%d) mismatch with indx (%d)\n",
765 if (n_categories == 0)
767 for (int i = 0; i <= level + 1; i++)
768 fprintf (stream, " ");
769 fprintf (stream, "<category-index>%d</category-index>\n", indx);
771 for (int i = 0; i < n_categories; i++)
772 dump_category (stream, level + 1, indexes, allocated_indexes, n_indexes);
773 for (int i = 0; i <= level; i++)
774 fprintf (stream, " ");
775 printf ("</category>\n");
783 printf ("<dimension index=\"%d\">\n", indx);
784 dump_value (stdout, 0);
786 /* This byte is usually 0 but many other values have been spotted. */
789 if (!match_byte(0) && !match_byte(1))
790 match_byte_assert(2);
794 match_byte_assert(1);
796 match_byte_assert(1);
797 match_byte_assert(1);
798 if (!match_u32(UINT32_MAX))
799 match_u32_assert(indx);
800 n_categories = get_u32();
804 int allocated_indexes = 0;
805 for (int i = 0; i < n_categories; i++)
806 dump_category (stdout, 0, &indexes, &allocated_indexes, &n_indexes);
807 check_permutation(indexes, n_indexes, "categories");
809 fprintf (stdout, "</dimension>\n");
814 static int dim_n_cats[64];
815 #define MAX_DIMS (sizeof dim_n_cats / sizeof *dim_n_cats)
821 assert(n_dims < MAX_DIMS);
822 for (int i = 0; i < n_dims; i++)
823 dim_n_cats[i] = dump_dim (i);
829 /* The first three numbers add to the number of dimensions. */
832 int c = n_dims - l - r;
835 /* The next n_dims numbers are a permutation of the dimension numbers. */
837 for (int i = 0; i < n_dims; i++)
842 const char *name = i < l ? "layer" : i < l + r ? "row" : "column";
843 printf ("<%s dimension=\"%d\"/>\n", name, dim);
845 check_permutation(a, n_dims, "dimensions");
849 for (int i = 0; i < x; i++)
851 unsigned int indx = get_u32();
852 printf (" <datum index=\"%d\" coords=", indx);
854 int coords[MAX_DIMS];
855 for (int i = n_dims; i-- > 0; )
857 coords[i] = indx % dim_n_cats[i];
858 indx /= dim_n_cats[i];
860 for (int i = 0; i < n_dims; i++)
861 printf("%c%d", i ? ',' : '"', coords[i]);
867 dump_value(stdout, 1);
868 fprintf (stdout, " </datum>\n");
870 printf ("</data>\n");
876 printf ("<title-local>\n");
877 dump_value(stdout, 0);
879 printf ("</title-local>\n");
881 printf ("<subtype>\n");
882 dump_value(stdout, 0);
884 printf ("</subtype>\n");
886 match_byte_assert(0x31);
888 printf ("<title-c>\n");
889 dump_value(stdout, 0);
891 printf ("</title-c>\n");
893 if (match_byte(0x31))
895 printf ("<user-caption>\n");
896 dump_value(stdout, 0);
897 printf ("</user-caption>\n");
900 match_byte_assert(0x58);
901 if (match_byte(0x31))
903 printf ("<caption>\n");
904 dump_value(stdout, 0);
905 printf ("</caption>\n");
908 match_byte_assert(0x58);
910 int n_footnotes = get_u32();
911 for (int i = 0; i < n_footnotes; i++)
913 printf ("<footnote index=\"%d\">\n", i);
914 dump_value(stdout, 0);
915 /* Custom footnote marker string. */
916 if (match_byte (0x31))
917 dump_value(stdout, 0);
919 match_byte_assert (0x58);
921 printf ("</footnote>\n");
929 for (int i = 1; i <= 8; i++)
931 printf ("<style index=\"%d\"", i);
932 match_byte_assert(i);
933 match_byte_assert(0x31);
934 printf(" font=\"%s\"", get_string());
936 printf(" size=\"%gpt\"", get_float());
938 int style = get_u32();
940 printf(" bold=\"true\"");
942 printf(" italic=\"true\"");
944 bool underline = data[pos++];
946 printf(" underline=\"true\"");
948 int halign = get_u32();
949 printf("\nhalign=%d\n", halign);
951 int valign = get_u32();
952 printf("\nvalign=%d\n", valign);
954 printf (" fgcolor=\"%s\"", get_string());
955 printf (" bgcolor=\"%s\"", get_string());
958 match_byte_assert(1);
960 char *othercolor = get_string();
962 printf(" othercolor=\"%s\"", othercolor);
967 for (int i = 0; i < 4; i++)
968 printf(" %2d", get_u32());
976 int x1_end = pos + x1;
977 printf("<borders>\n");
978 match_be32_assert(1);
979 int n_borders = get_be32();
980 for (int i = 0; i < n_borders; i++)
982 int type = get_be32();
983 int stroke = get_be32();
984 int color = get_be32();
985 printf(" <border type=\"%d\" stroke=\"%s\" color=\"#%06x\"/>\n",
987 (stroke == 0 ? "none"
988 : stroke == 1 ? "solid"
989 : stroke == 2 ? "dashed"
990 : stroke == 3 ? "thick"
991 : stroke == 4 ? "thin"
992 : stroke == 5 ? "double"
996 bool grid = get_byte();
998 printf(" <grid show=\"%s\">\n", grid ? "yes" : "no");
999 printf("</borders>\n");
1000 assert(pos == x1_end);
1002 int skip = get_u32();
1003 assert(skip == 18 || skip == 25);
1007 int x3_end = pos + x3;
1010 match_be32_assert(1);
1012 printf("<settings layer=\"%d\"", get_be32());
1014 printf(" skipempty=\"false\"");
1016 printf(" showdimensionincorner=\"false\"");
1018 printf(" markers=\"numeric\"");
1020 printf(" footnoteposition=\"subscript\"");
1024 char *look = get_string_be();
1026 printf(" look=\"%s\"", look);
1031 int count = get_u32();
1034 const char *locale = get_string();
1035 printf ("<locale>%s</locale>\n", locale);
1037 get_u32(); /* Seen: 0, UINT32_MAX, 2, 3, 4, 5, 6, 8, 9, 21, 24. */
1039 match_byte_assert(1);
1040 match_byte_assert(0);
1042 match_byte_assert(1);
1043 printf("<epoch>%d</epoch>\n", get_u32());
1045 int decimal = data[pos];
1046 int grouping = data[pos + 1];
1047 if (match_byte('.'))
1049 if (!match_byte(',') && !match_byte('\''))
1050 match_byte_assert(' ');
1054 match_byte_assert(',');
1055 if (!match_byte('.') && !match_byte(' ') && !match_byte(','))
1056 match_byte_assert(0);
1058 printf("<format decimal=\"%c\" grouping=\"", decimal);
1064 for (int i = 0; i < 5; i++)
1065 printf("<CC%c>%s</CC%c>\n", 'A' + i, get_string(), 'A' + i);
1068 match_u32_assert(0);
1070 /* The last chunk is an outer envelope that contains two inner envelopes.
1071 The second inner envelope has some interesting data like the encoding and
1075 int outer_end = get_end();
1077 /* First inner envelope: byte*33 int[n] int*[n]. */
1080 /* Second inner envelope. */
1081 assert(get_end() == outer_end);
1083 match_byte_assert(1);
1084 match_byte_assert(0);
1085 if (!match_byte(3) && !match_byte(4))
1086 match_byte_assert(5);
1087 match_byte_assert(0);
1088 match_byte_assert(0);
1089 match_byte_assert(0);
1091 printf("<command>%s</command>\n", get_string());
1092 printf("<subcommand>%s</subcommand>\n", get_string());
1093 printf("<language>%s</language>\n", get_string());
1094 printf("<charset>%s</charset>\n", get_string());
1095 printf("<locale>%s</locale>\n", get_string());
1098 match_byte_assert(1);
1099 match_byte_assert(0);
1101 match_byte_assert(1);
1103 match_byte_assert(1);
1105 printf("<epoch2>%d</epoch2>\n", get_u32());
1107 if (match_byte('.'))
1109 if (!match_byte(',') && !match_byte('\''))
1110 match_byte_assert(' ');
1114 match_byte_assert(',');
1115 if (!match_byte('.') && !match_byte(' ') && !match_byte(','))
1116 match_byte_assert(0);
1120 match_byte_assert(1);
1122 if (outer_end - pos > 6)
1124 /* There might be a pair of strings representing a dataset and
1125 datafile name, or there might be a set of custom currency strings.
1126 The custom currency strings start with a pair of integers, so we
1127 can distinguish these from a string by checking for a null byte; a
1128 small 32-bit integer will always contain a null and a text string
1131 int len = get_u32();
1132 bool has_dataset = !memchr(&data[pos], '\0', len);
1137 printf("<dataset>%s</dataset>\n", get_string());
1138 printf("<datafile>%s</datafile>\n", get_string());
1140 match_u32_assert(0);
1142 match_u32_assert(0);
1148 for (int i = 0; i < 5; i++)
1149 printf("<CC%c>%s</CC%c>\n", 'A' + i, get_string(), 'A' + i);
1152 match_u32_assert(0);
1154 match_byte_assert(0x2e);
1156 match_byte_assert(1);
1158 if (pos < outer_end)
1160 printf("<seed>%d</seed>\n", get_u32());
1161 match_u32_assert(0);
1163 assert(pos == outer_end);
1174 main(int argc, char *argv[])
1179 if (isatty(STDIN_FILENO))
1181 fprintf(stderr, "redirect stdin from a .bin file\n");
1184 if (fstat(STDIN_FILENO, &s))
1196 if (read(STDIN_FILENO, data, n) != n)
1204 fprintf (stderr, "usage: %s TYPE < .bin", argv[0]);
1208 if (!strcmp(argv[1], "title0"))
1211 if (match_byte (0x03)
1212 || (match_byte (0x05) && match_byte (0x58)))
1213 printf ("%s\n", get_string());
1215 printf ("<unknown>\n");
1218 else if (!strcmp(argv[1], "title"))
1224 else if (!strcmp(argv[1], "titleraw"))
1226 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1228 n = find(fonts, sizeof fonts - 1);
1230 else if (!strcmp(argv[1], "fonts"))
1232 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1233 const char styles[] = "\xf0\0\0\0";
1234 start = find(fonts, sizeof fonts - 1);
1235 n = find(styles, sizeof styles - 1);
1237 else if (!strcmp(argv[1], "styles"))
1239 const char styles[] = "\xf0\0\0\0";
1240 const char dimensions[] = "-,,,.\0";
1241 start = find(styles, sizeof styles - 1);
1242 n = find(dimensions, sizeof dimensions - 1) + sizeof dimensions - 1;
1244 else if (!strcmp(argv[1], "dimensions") || !strcmp(argv[1], "all"))
1247 match_byte_assert(1);
1248 match_byte_assert(0);
1250 /* This might be a version number of some kind, because value 1 seems
1251 to only appear in an SPV file that also required its own weird
1252 special cases in dump_value_modifier(). */
1253 version = get_u32();
1256 match_u32_assert(3);
1258 match_byte_assert(1);
1260 match_byte_assert(1);
1263 match_byte_assert(0);
1265 match_byte_assert(1);
1267 match_byte_assert(1);
1271 match_byte_assert(0);
1272 match_byte_assert(0);
1273 match_byte_assert(0);
1278 match_byte_assert(1);
1279 match_byte_assert(0);
1280 match_byte_assert(0);
1285 match_byte_assert(1);
1286 match_byte_assert(0);
1287 match_byte_assert(0);
1292 match_byte_assert(1);
1293 match_byte_assert(0);
1294 match_byte_assert(0);
1303 printf("<tableid>%lld</tableid>", get_u64());
1312 fprintf (stderr, "%x / %x\n", pos, n);
1317 else if (!strcmp(argv[1], "raw"))
1321 dump_raw(stdout, start, n);
1325 fprintf (stderr, "unknown section %s\n", argv[1]);