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);
70 x = (data[pos] << 24) | (data[pos + 1] << 16) | (data[pos + 2] << 8) | data[pos + 3];
79 memcpy(&x, &data[pos], 2);
88 memcpy(&x, &data[pos], 8);
93 static double __attribute__((unused))
97 memcpy(&x, &data[pos], 4);
103 match_u32(uint32_t x)
112 match_u32_assert(uint32_t x, const char *where)
114 unsigned int y = get_u32();
117 fprintf(stderr, "%s: 0x%x: expected i%u, got i%u\n", where, pos - 4, x, y);
121 #define match_u32_assert(x) match_u32_assert(x, WHERE)
123 static bool __attribute__((unused))
124 match_be32(uint32_t x)
133 match_be32_assert(uint32_t x, const char *where)
135 unsigned int y = get_be32();
138 fprintf(stderr, "%s: 0x%x: expected be%u, got be%u\n", where, pos - 4, x, y);
142 #define match_be32_assert(x) match_be32_assert(x, WHERE)
145 match_byte(uint8_t b)
147 if (pos < n && data[pos] == b)
157 match_byte_assert(uint8_t b, const char *where)
161 fprintf(stderr, "%s: 0x%x: expected %02x, got %02x\n", where, pos, b, data[pos]);
165 #define match_byte_assert(b) match_byte_assert(b, WHERE)
168 newline(FILE *stream, int pos)
170 fprintf(stream, "\n%08x: ", pos);
174 dump_raw(FILE *stream, int start, int end)
176 for (size_t i = start; i < end; )
183 && i + 4 + data[i] + data[i + 1] * 256 <= end
184 && all_ascii(&data[i + 4], data[i] + data[i + 1] * 256))
187 fprintf(stream, "\"");
188 fwrite(&data[i + 4], 1, data[i] + data[i + 1] * 256, stream);
189 fputs("\" ", stream);
191 i += 4 + data[i] + data[i + 1] * 256;
193 else if (i + 12 <= end
200 memcpy (&d, &data[i + 4], 8);
201 fprintf (stream, "F40.%d(%.*f)", data[i], data[i], d);
205 else if (i + 12 <= end
212 memcpy (&d, &data[i + 4], 8);
213 fprintf (stream, "PCT40.%d(%.*f)", data[i], data[i], d);
217 else if (i + 4 <= end
218 && (data[i] && data[i] != 88 && data[i] != 0x41)
223 fprintf (stream, "i%d ", data[i]);
228 fprintf(stream, "%02x ", data[i]);
236 static bool __attribute__((unused))
237 all_utf8(const char *p_)
239 const uint8_t *p = (const uint8_t *) p_;
240 size_t len = strlen ((char *) p);
241 for (size_t ofs = 0, mblen; ofs < len; ofs += mblen)
245 mblen = u8_mbtouc (&uc, p + ofs, len - ofs);
246 if ((uc < 32 && uc != '\n') || uc == 127 || uc == 0xfffd)
253 get_string(const char *where)
256 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
257 /*&& all_ascii(&data[pos + 4], data[pos])*/)
259 int len = data[pos] + data[pos + 1] * 256;
260 char *s = malloc(len + 1);
262 memcpy(s, &data[pos + 4], len);
269 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
273 #define get_string() get_string(WHERE)
276 get_string_be(const char *where)
279 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
280 /*&& all_ascii(&data[pos + 4], data[pos])*/)
282 int len = data[pos + 2] * 256 + data[pos + 3];
283 char *s = malloc(len + 1);
285 memcpy(s, &data[pos + 4], len);
292 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
296 #define get_string_be() get_string_be(WHERE)
305 static void __attribute__((unused))
306 hex_dump(int ofs, int n)
308 for (int i = 0; i < n; i++)
310 int c = data[ofs + i];
313 fprintf(stderr, "-");
315 fprintf(stderr, " ");
317 fprintf(stderr, "%02x", c);
319 for (int i = 0; i < n; i++)
321 int c = data[ofs + i];
322 fprintf(stderr, "%c", c >= 32 && c < 127 ? c : '.');
324 fprintf(stderr, "\n");
328 dump_counted_string(void)
331 int inner_end = get_end();
332 if (pos != inner_end)
337 match_byte_assert(0x58);
341 if (match_byte(0x31))
344 match_byte_assert(0x58);
345 if (pos != inner_end)
347 fprintf(stderr, "inner end discrepancy\n");
355 dump_style(FILE *stream)
361 match_byte_assert(1);
362 char *fg = get_string(); /* foreground */
363 char *bg = get_string(); /* background */
364 char *font = get_string(); /* font */
365 int size = data[pos];
367 match_byte_assert(12); /* size? */
368 fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%d\"",
373 dump_nested_string(FILE *stream)
377 match_byte_assert (0);
378 match_byte_assert (0);
379 int outer_end = get_end();
380 s = dump_counted_string();
382 fprintf(stream, " \"%s\"", s);
383 if (match_byte(0x31))
386 match_byte_assert(0x58);
387 match_byte_assert(0x58);
388 if (pos != outer_end)
390 fprintf(stderr, "outer end discrepancy\n");
398 dump_value_modifier(FILE *stream)
400 if (match_byte (0x31))
404 fprintf(stream, "<special0");
407 /* Corpus frequencies:
412 The given text is appended to the cell in a subscript font.
414 fprintf(stream, " subscript=\"%s\"", get_string());
417 match_u32_assert (0);
421 /* We only have one SPV file for this version (with many
428 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))
429 match_u32_assert(10);
432 fprintf(stream, "/>\n");
436 int outer_end = get_end();
438 /* This counted-string appears to be a template string,
439 e.g. "Design\: [:^1:]1 Within Subjects Design\: [:^1:]2". */
440 char *template = dump_counted_string();
442 fprintf(stream, " template=\"%s\"", template);
444 if (match_byte(0x31))
447 match_byte_assert(0x58);
448 if (match_byte(0x31))
450 /* Only two SPV files have anything like this, so it's hard to
456 match_byte_assert(1);
457 match_byte_assert(0);
458 if (!match_byte(8) && !match_byte(1))
459 match_byte_assert(2);
460 match_byte_assert(0);
461 match_byte_assert(8);
462 match_byte_assert(0);
463 match_byte_assert(10);
464 match_byte_assert(0);
467 match_byte_assert(0x58);
468 if (pos != outer_end)
470 fprintf(stderr, "outer end discrepancy\n");
473 fprintf(stream, "/>\n");
477 int count = get_u32();
478 fprintf(stream, "<footnote-ref indexes=\"");
479 for (int i = 0; i < count; i++)
483 fprintf(stream, "%d", get_u16());
486 match_byte_assert(0);
487 match_byte_assert(0);
488 dump_nested_string(stream);
489 fprintf(stream, "/>\n");
493 match_byte_assert (0x58);
497 format_to_string (int type)
503 case 2: return "AHEX";
504 case 3: return "COMMA";
505 case 4: return "DOLLAR";
506 case 5: case 40: return "F";
508 case 7: return "PIBHEX";
510 case 9: return "PIB";
511 case 10: return "PK";
512 case 11: return "RB";
513 case 12: return "RBHEX";
517 case 20: return "DATE";
518 case 21: return "TIME";
519 case 22: return "DATETIME";
520 case 23: return "ADATE";
521 case 24: return "JDATE";
522 case 25: return "DTIME";
523 case 26: return "WKDAY";
524 case 27: return "MONTH";
525 case 28: return "MOYR";
526 case 29: return "QYR";
527 case 30: return "WKYR";
528 case 31: return "PCT";
529 case 32: return "DOT";
530 case 33: return "CCA";
531 case 34: return "CCB";
532 case 35: return "CCC";
533 case 36: return "CCD";
534 case 37: return "CCE";
535 case 38: return "EDATE";
536 case 39: return "SDATE";
539 sprintf(tmp, "<%d>", type);
545 dump_value(FILE *stream, int level)
552 for (int i = 0; i <= level; i++)
553 fprintf (stream, " ");
560 dump_value_modifier(stream);
562 value = get_double ();
563 fprintf (stream, "<number value=\"%.*g\" format=\"%s%d.%d\"/>\n",
564 DBL_DIG, value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
566 else if (match_byte (2))
572 dump_value_modifier (stream);
574 value = get_double ();
576 vallab = get_string ();
577 fprintf (stream, "<numeric-datum value=\"%.*g\" format=\"%s%d.%d\"",
578 DBL_DIG, value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
580 fprintf (stream, " variable=\"%s\"", var);
582 fprintf (stream, " label=\"%s\"", vallab);
583 fprintf (stream, "/>\n");
584 if (!match_byte (1) && !match_byte(2))
585 match_byte_assert (3);
587 else if (match_byte (3))
589 char *text = get_string();
590 dump_value_modifier(stream);
591 char *identifier = get_string();
592 char *text_eng = get_string();
593 fprintf (stream, "<string c=\"%s\"", text_eng);
595 fprintf (stream, " identifier=\"%s\"", identifier);
596 if (strcmp(text_eng, text))
597 fprintf (stream, " local=\"%s\"", text);
598 fprintf (stream, "/>\n");
600 match_byte_assert(1);
602 else if (match_byte (4))
605 char *var, *vallab, *value;
607 dump_value_modifier(stream);
609 vallab = get_string ();
611 if (!match_byte(1) && !match_byte(2))
612 match_byte_assert (3);
613 value = get_string ();
614 fprintf (stream, "<string-datum value=\"%s\" format=\"%s%d.%d\"",
615 value, format_to_string(format >> 16), (format >> 8) & 0xff, format & 0xff);
617 fprintf (stream, " variable=\"%s\"", var);
619 fprintf (stream, " label=\"%s\"/>\n", vallab);
620 fprintf (stream, "/>\n");
622 else if (match_byte (5))
624 dump_value_modifier(stream);
625 char *name = get_string ();
626 char *label = get_string ();
627 fprintf (stream, "<variable name=\"%s\"", name);
629 fprintf (stream, " label=\"%s\"", label);
630 fprintf (stream, "/>\n");
631 if (!match_byte(1) && !match_byte(2))
632 match_byte_assert(3);
636 dump_value_modifier(stream);
638 char *base = get_string();
640 fprintf (stream, "<template format=\"%s\">\n", base);
641 for (int i = 0; i < x; i++)
648 for (int j = 0; j <= level + 1; j++)
649 fprintf (stream, " ");
650 fprintf (stream, "<substitution index=\"%d\">\n", i + 1);
651 for (int j = 0; j < y; j++)
652 dump_value (stream, level + 2);
653 for (int j = 0; j <= level + 1; j++)
654 fprintf (stream, " ");
655 fprintf (stream, "</substitution>\n");
657 for (int j = 0; j <= level; j++)
658 fprintf (stream, " ");
659 fprintf (stream, "</template>\n");
664 compare_int(const void *a_, const void *b_)
668 return *a < *b ? -1 : *a > *b;
672 check_permutation(int *a, int n, const char *name)
675 memcpy(b, a, n * sizeof *a);
676 qsort(b, n, sizeof *b, compare_int);
677 for (int i = 0; i < n; i++)
680 fprintf(stderr, "bad %s permutation:", name);
681 for (int i = 0; i < n; i++)
682 fprintf(stderr, " %d", a[i]);
689 dump_category(FILE *stream, int level, int **indexes, int *allocated_indexes,
692 for (int i = 0; i <= level; i++)
693 fprintf (stream, " ");
694 printf ("<category>\n");
695 dump_value (stream, level + 1);
697 int merge = data[pos];
699 match_byte_assert (1);
701 match_byte_assert (0);
703 int unindexed = data[pos];
705 match_byte_assert (1);
710 match_u32_assert (2);
712 int indx = get_u32();
713 int n_categories = get_u32();
718 for (int i = 0; i <= level + 1; i++)
719 fprintf (stream, " ");
720 fprintf (stream, "<merge/>\n");
727 fprintf(stderr, "index not -1 but merged\n");
732 fprintf(stderr, "index not -1 but x != 2\n");
735 if (n_categories != 0)
737 fprintf(stderr, "index not -1 but subcategories\n");
740 if (*n_indexes >= *allocated_indexes)
742 *allocated_indexes = *allocated_indexes ? 2 * *allocated_indexes : 16;
743 *indexes = realloc(*indexes, *allocated_indexes * sizeof **indexes);
745 (*indexes)[(*n_indexes)++] = indx;
748 int expected_unindexed = indx == -1;
749 if (unindexed != expected_unindexed)
751 fprintf(stderr, "unindexed (%d) mismatch with indx (%d)\n",
756 if (n_categories == 0)
758 for (int i = 0; i <= level + 1; i++)
759 fprintf (stream, " ");
760 fprintf (stream, "<category-index>%d</category-index>\n", indx);
762 for (int i = 0; i < n_categories; i++)
763 dump_category (stream, level + 1, indexes, allocated_indexes, n_indexes);
764 for (int i = 0; i <= level; i++)
765 fprintf (stream, " ");
766 printf ("</category>\n");
774 printf ("<dimension index=\"%d\">\n", indx);
775 dump_value (stdout, 0);
777 /* This byte is usually 0 but many other values have been spotted. */
780 if (!match_byte(0) && !match_byte(1))
781 match_byte_assert(2);
785 match_byte_assert(1);
787 match_byte_assert(1);
788 match_byte_assert(1);
789 if (!match_u32(UINT32_MAX))
790 match_u32_assert(indx);
791 n_categories = get_u32();
795 int allocated_indexes = 0;
796 for (int i = 0; i < n_categories; i++)
797 dump_category (stdout, 0, &indexes, &allocated_indexes, &n_indexes);
798 check_permutation(indexes, n_indexes, "categories");
800 fprintf (stdout, "</dimension>\n");
805 static int dim_n_cats[64];
806 #define MAX_DIMS (sizeof dim_n_cats / sizeof *dim_n_cats)
812 assert(n_dims < MAX_DIMS);
813 for (int i = 0; i < n_dims; i++)
814 dim_n_cats[i] = dump_dim (i);
820 /* The first three numbers add to the number of dimensions. */
823 int c = n_dims - l - r;
826 /* The next n_dims numbers are a permutation of the dimension numbers. */
828 for (int i = 0; i < n_dims; i++)
833 const char *name = i < l ? "layer" : i < l + r ? "row" : "column";
834 printf ("<%s dimension=\"%d\"/>\n", name, dim);
836 check_permutation(a, n_dims, "dimensions");
840 for (int i = 0; i < x; i++)
842 unsigned int indx = get_u32();
843 printf (" <datum index=\"%d\" coords=", indx);
845 int coords[MAX_DIMS];
846 for (int i = n_dims; i-- > 0; )
848 coords[i] = indx % dim_n_cats[i];
849 indx /= dim_n_cats[i];
851 for (int i = 0; i < n_dims; i++)
852 printf("%c%d", i ? ',' : '"', coords[i]);
858 dump_value(stdout, 1);
859 fprintf (stdout, " </datum>\n");
861 printf ("</data>\n");
867 printf ("<title-local>\n");
868 dump_value(stdout, 0);
870 printf ("</title-local>\n");
872 printf ("<subtype>\n");
873 dump_value(stdout, 0);
875 printf ("</subtype>\n");
877 match_byte_assert(0x31);
879 printf ("<title-c>\n");
880 dump_value(stdout, 0);
882 printf ("</title-c>\n");
884 if (match_byte(0x31))
886 printf ("<user-caption>\n");
887 dump_value(stdout, 0);
888 printf ("</user-caption>\n");
891 match_byte_assert(0x58);
892 if (match_byte(0x31))
894 printf ("<caption>\n");
895 dump_value(stdout, 0);
896 printf ("</caption>\n");
899 match_byte_assert(0x58);
901 int n_footnotes = get_u32();
902 for (int i = 0; i < n_footnotes; i++)
904 printf ("<footnote index=\"%d\">\n", i);
905 dump_value(stdout, 0);
906 /* Custom footnote marker string. */
907 if (match_byte (0x31))
908 dump_value(stdout, 0);
910 match_byte_assert (0x58);
912 printf ("</footnote>\n");
920 for (int i = 1; i <= 8; i++)
922 printf ("<style index=\"%d\"", i);
923 match_byte_assert(i);
924 match_byte_assert(0x31);
925 printf(" font=\"%s\"", get_string());
927 printf(" size=\"%gpt\"", get_float());
929 int style = get_u32();
931 printf(" bold=\"true\"");
933 printf(" italic=\"true\"");
935 bool underline = data[pos++];
937 printf(" underline=\"true\"");
939 int halign = get_u32();
940 printf("\nhalign=%d\n", halign);
942 int valign = get_u32();
943 printf("\nvalign=%d\n", valign);
945 printf (" fgcolor=\"%s\"", get_string());
946 printf (" bgcolor=\"%s\"", get_string());
949 match_byte_assert(1);
951 char *othercolor = get_string();
953 printf(" othercolor=\"%s\"", othercolor);
958 for (int i = 0; i < 4; i++)
959 printf(" %2d", get_u32());
967 int x1_end = pos + x1;
968 printf("<borders>\n");
969 match_be32_assert(1);
970 int n_borders = get_be32();
971 for (int i = 0; i < n_borders; i++)
973 int type = get_be32();
974 int stroke = get_be32();
975 int color = get_be32();
976 printf(" <border type=\"%d\" stroke=\"%s\" color=\"#%06x\"/>\n",
978 (stroke == 0 ? "none"
979 : stroke == 1 ? "solid"
980 : stroke == 2 ? "dashed"
981 : stroke == 3 ? "thick"
982 : stroke == 4 ? "thin"
983 : stroke == 5 ? "double"
987 bool grid = get_byte();
989 printf(" <grid show=\"%s\">\n", grid ? "yes" : "no");
990 printf("</borders>\n");
991 assert(pos == x1_end);
993 int skip = get_u32();
994 assert(skip == 18 || skip == 25);
998 int x3_end = pos + x3;
1001 match_be32_assert(1);
1003 printf("<settings layer=\"%d\"", get_be32());
1005 printf(" skipempty=\"false\"");
1007 printf(" showdimensionincorner=\"false\"");
1009 printf(" markers=\"numeric\"");
1011 printf(" footnoteposition=\"subscript\"");
1015 char *look = get_string_be();
1017 printf(" look=\"%s\"", look);
1022 int count = get_u32();
1025 const char *locale = get_string();
1026 printf ("<locale>%s</locale>\n", locale);
1028 get_u32(); /* Seen: 0, UINT32_MAX, 2, 3, 4, 5, 6, 8, 9, 21, 24. */
1030 match_byte_assert(1);
1031 match_byte_assert(0);
1033 match_byte_assert(1);
1034 printf("<epoch>%d</epoch>\n", get_u32());
1036 int decimal = data[pos];
1037 int grouping = data[pos + 1];
1038 if (match_byte('.'))
1040 if (!match_byte(',') && !match_byte('\''))
1041 match_byte_assert(' ');
1045 match_byte_assert(',');
1046 if (!match_byte('.') && !match_byte(' ') && !match_byte(','))
1047 match_byte_assert(0);
1049 printf("<format decimal=\"%c\" grouping=\"", decimal);
1055 for (int i = 0; i < 5; i++)
1056 printf("<CC%c>%s</CC%c>\n", 'A' + i, get_string(), 'A' + i);
1059 match_u32_assert(0);
1061 /* The last chunk is an outer envelope that contains two inner envelopes.
1062 The second inner envelope has some interesting data like the encoding and
1066 int outer_end = get_end();
1068 /* First inner envelope: byte*33 int[n] int*[n]. */
1071 /* Second inner envelope. */
1072 assert(get_end() == outer_end);
1074 match_byte_assert(1);
1075 match_byte_assert(0);
1076 if (!match_byte(3) && !match_byte(4))
1077 match_byte_assert(5);
1078 match_byte_assert(0);
1079 match_byte_assert(0);
1080 match_byte_assert(0);
1082 printf("<command>%s</command>\n", get_string());
1083 printf("<subcommand>%s</subcommand>\n", get_string());
1084 printf("<language>%s</language>\n", get_string());
1085 printf("<charset>%s</charset>\n", get_string());
1086 printf("<locale>%s</locale>\n", get_string());
1089 match_byte_assert(1);
1090 match_byte_assert(0);
1092 match_byte_assert(1);
1094 match_byte_assert(1);
1096 printf("<epoch2>%d</epoch2>\n", get_u32());
1098 if (match_byte('.'))
1100 if (!match_byte(',') && !match_byte('\''))
1101 match_byte_assert(' ');
1105 match_byte_assert(',');
1106 if (!match_byte('.') && !match_byte(' ') && !match_byte(','))
1107 match_byte_assert(0);
1111 match_byte_assert(1);
1113 if (outer_end - pos > 6)
1115 /* There might be a pair of strings representing a dataset and
1116 datafile name, or there might be a set of custom currency strings.
1117 The custom currency strings start with a pair of integers, so we
1118 can distinguish these from a string by checking for a null byte; a
1119 small 32-bit integer will always contain a null and a text string
1122 int len = get_u32();
1123 bool has_dataset = !memchr(&data[pos], '\0', len);
1128 printf("<dataset>%s</dataset>\n", get_string());
1129 printf("<datafile>%s</datafile>\n", get_string());
1131 match_u32_assert(0);
1133 match_u32_assert(0);
1139 for (int i = 0; i < 5; i++)
1140 printf("<CC%c>%s</CC%c>\n", 'A' + i, get_string(), 'A' + i);
1143 match_u32_assert(0);
1145 match_byte_assert(0x2e);
1147 match_byte_assert(1);
1149 if (pos < outer_end)
1151 printf("<seed>%d</seed>\n", get_u32());
1152 match_u32_assert(0);
1154 assert(pos == outer_end);
1165 main(int argc, char *argv[])
1170 if (isatty(STDIN_FILENO))
1172 fprintf(stderr, "redirect stdin from a .bin file\n");
1175 if (fstat(STDIN_FILENO, &s))
1187 if (read(STDIN_FILENO, data, n) != n)
1195 fprintf (stderr, "usage: %s TYPE < .bin", argv[0]);
1199 if (!strcmp(argv[1], "title0"))
1202 if (match_byte (0x03)
1203 || (match_byte (0x05) && match_byte (0x58)))
1204 printf ("%s\n", get_string());
1206 printf ("<unknown>\n");
1209 else if (!strcmp(argv[1], "title"))
1215 else if (!strcmp(argv[1], "titleraw"))
1217 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1219 n = find(fonts, sizeof fonts - 1);
1221 else if (!strcmp(argv[1], "fonts"))
1223 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1224 const char styles[] = "\xf0\0\0\0";
1225 start = find(fonts, sizeof fonts - 1);
1226 n = find(styles, sizeof styles - 1);
1228 else if (!strcmp(argv[1], "styles"))
1230 const char styles[] = "\xf0\0\0\0";
1231 const char dimensions[] = "-,,,.\0";
1232 start = find(styles, sizeof styles - 1);
1233 n = find(dimensions, sizeof dimensions - 1) + sizeof dimensions - 1;
1235 else if (!strcmp(argv[1], "dimensions") || !strcmp(argv[1], "all"))
1238 match_byte_assert(1);
1239 match_byte_assert(0);
1241 /* This might be a version number of some kind, because value 1 seems
1242 to only appear in an SPV file that also required its own weird
1243 special cases in dump_value_modifier(). */
1244 version = get_u32();
1247 match_u32_assert(3);
1249 match_byte_assert(1);
1251 match_byte_assert(1);
1254 match_byte_assert(0);
1256 match_byte_assert(1);
1258 match_byte_assert(1);
1262 match_byte_assert(0);
1263 match_byte_assert(0);
1264 match_byte_assert(0);
1269 match_byte_assert(1);
1270 match_byte_assert(0);
1271 match_byte_assert(0);
1276 match_byte_assert(1);
1277 match_byte_assert(0);
1278 match_byte_assert(0);
1283 match_byte_assert(1);
1284 match_byte_assert(0);
1285 match_byte_assert(0);
1295 This is the tableId, e.g. -4154297861994971133 would be 0xdca00003.
1296 We don't have enough context to validate it. */
1309 fprintf (stderr, "%x / %x\n", pos, n);
1314 else if (!strcmp(argv[1], "raw"))
1318 dump_raw(stdout, start, n);
1322 fprintf (stderr, "unknown section %s\n", argv[1]);