14 #include "u8-mbtouc.h"
16 static const char *filename;
25 #define STR(x) XSTR(x)
26 #define WHERE __FILE__":" STR(__LINE__)
28 static void __attribute__((unused))
29 hex_dump(FILE *stream, int ofs, int n);
41 memcpy(&x, &data[pos], 4);
46 static unsigned long long int
50 memcpy(&x, &data[pos], 8);
59 x = (data[pos] << 24) | (data[pos + 1] << 16) | (data[pos + 2] << 8) | data[pos + 3];
68 memcpy(&x, &data[pos], 2);
77 memcpy(&x, &data[pos], 8);
82 static double __attribute__((unused))
86 memcpy(&x, &data[pos], 4);
101 match_u16(uint16_t x)
110 match_u32_assert(uint32_t x, const char *where)
112 unsigned int y = get_u32();
115 fprintf(stderr, "%s: 0x%x: expected i%u, got i%u: ", where, pos - 4, x, y);
116 hex_dump(stderr, pos - 4, 64);
120 #define match_u32_assert(x) match_u32_assert(x, WHERE)
123 match_u16_assert(uint16_t x, const char *where)
125 unsigned int y = get_u16();
128 fprintf(stderr, "%s: 0x%x: expected u16:%u, got u16:%u: ", where, pos - 2, x, y);
129 hex_dump(stderr, pos - 2, 64);
133 #define match_u16_assert(x) match_u16_assert(x, WHERE)
135 static bool __attribute__((unused))
136 match_u64(uint64_t x)
144 static void __attribute__((unused))
145 match_u64_assert(uint64_t x, const char *where)
147 unsigned long long int y = get_u64();
150 fprintf(stderr, "%s: 0x%x: expected u64:%lu, got u64:%llu\n", where, pos - 8, x, y);
154 #define match_u64_assert(x) match_u64_assert(x, WHERE)
156 static bool __attribute__((unused))
157 match_be32(uint32_t x)
166 match_be32_assert(uint32_t x, const char *where)
168 unsigned int y = get_be32();
171 fprintf(stderr, "%s: 0x%x: expected be%u, got be%u\n", where, pos - 4, x, y);
175 #define match_be32_assert(x) match_be32_assert(x, WHERE)
178 match_byte(uint8_t b)
180 if (pos < n && data[pos] == b)
190 match_byte_assert(uint8_t b, const char *where)
194 fprintf(stderr, "%s: 0x%x: expected %02x, got %02x: ", where, pos, b, data[pos]);
195 hex_dump(stderr, pos, 64);
199 #define match_byte_assert(b) match_byte_assert(b, WHERE)
202 match_bytes(int start, const int *bytes, size_t n_bytes)
204 for (size_t i = 0; i < n_bytes; i++)
205 if (bytes[i] >= 0 && data[start + i] != bytes[i])
211 xmemdup0(const void *p, size_t n)
213 char *s = malloc(n + 1);
224 match_byte_assert(1);
228 static bool __attribute__((unused))
231 return (p >= ' ' && p < 127) || p == '\r' || p == '\n' || p == '\t';
235 count_zeros(const uint8_t *p)
243 static bool __attribute__((unused))
244 all_utf8(const char *p_, size_t len)
246 const uint8_t *p = (const uint8_t *) p_;
247 for (size_t ofs = 0, mblen; ofs < len; ofs += mblen)
251 mblen = u8_mbtouc (&uc, p + ofs, len - ofs);
252 if ((uc < 32 && uc != '\n') || uc == 127 || uc == 0xfffd)
259 pull_string(int len, const char *where)
262 for (int i = 0; i < len - 1; i++)
265 fprintf(stderr, "%s: %d-byte string starting at 0x%x has null byte "
266 "at offset %d: ", where, len, pos, i);
267 hex_dump(stderr, pos, len + 64);
271 char *s = xmemdup0(&data[pos], len);
277 get_string2(const char *where)
279 return pull_string(get_u16(), where);
281 #define get_string2() get_string2(WHERE)
284 get_string1(const char *where)
286 int len = data[pos++];
287 return len == 0xff ? (get_string2)(where) : pull_string(len, where);
289 #define get_string1() get_string1(WHERE)
292 match_string1_assert(const char *exp, const char *where)
295 char *act = (get_string1)(where);
296 if (strcmp(act, exp))
298 fprintf(stderr, "%s: 0x%x: expected \"%s\", got \"%s\"\n",
299 where, start, exp, act);
303 #define match_string1_assert(x) match_string1_assert(x, WHERE)
306 match_string2_assert(const char *exp, const char *where)
309 char *act = (get_string2)(where);
310 if (strcmp(act, exp))
312 fprintf(stderr, "%s: 0x%x: expected \"%s\", got \"%s\"\n",
313 where, start, exp, act);
317 #define match_string2_assert(x) match_string2_assert(x, WHERE)
320 get_string4(const char *where)
322 assert(data[pos + 3] == 0);
323 return pull_string(get_u32(), where);
325 #define get_string4() get_string4(WHERE)
328 get_padded_string(int len)
330 char *s = xmemdup0(&data[pos], len);
336 get_string_be(const char *where)
339 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
340 /*&& all_ascii(&data[pos + 4], data[pos])*/)
342 int len = data[pos + 2] * 256 + data[pos + 3];
343 char *s = malloc(len + 1);
345 memcpy(s, &data[pos + 4], len);
352 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
356 #define get_string_be() get_string_be(WHERE)
365 static void __attribute__((unused))
366 hex_dump(FILE *stream, int ofs, int n)
369 for (int i = 0; i < n; i++)
371 int c = data[ofs + i];
372 n_ascii += is_ascii(c);
373 fprintf(stream, " %02x", c);
378 for (int i = 0; i < n; i++)
380 int c = data[ofs + i];
381 putc(c >= 32 && c < 127 ? c : '.', stream);
387 static void __attribute__((unused))
388 char_dump(FILE *stream, int ofs, int n)
390 for (int i = 0; i < n; i++)
392 int c = data[ofs + i];
393 putc(c >= 32 && c < 127 ? c : '.', stream);
400 compare_int(const void *a_, const void *b_)
404 return *a < *b ? -1 : *a > *b;
409 format_name (int format, char *buf)
414 case 2: return "AHEX";
415 case 3: return "COMMA";
416 case 4: return "DOLLAR";
417 case 5: case 40: return "F";
419 case 7: return "PIBHEX";
421 case 9: return "PIB";
422 case 10: return "PK";
423 case 11: return "RB";
424 case 12: return "RBHEX";
428 case 20: return "DATE";
429 case 21: return "TIME";
430 case 22: return "DATETIME";
431 case 23: return "ADATE";
432 case 24: return "JDATE";
433 case 25: return "DTIME";
434 case 26: return "WKDAY";
435 case 27: return "MONTH";
436 case 28: return "MOYR";
437 case 29: return "QYR";
438 case 30: return "WKYR";
439 case 31: return "PCT";
440 case 32: return "DOT";
441 case 33: return "CCA";
442 case 34: return "CCB";
443 case 35: return "CCC";
444 case 36: return "CCD";
445 case 37: return "CCE";
446 case 38: return "EDATE";
447 case 39: return "SDATE";
448 default: sprintf(buf, "(%d)", format); return buf;
457 int fmt = data[pos++];
459 printf ("%s%d.%d", format_name(fmt, buf), w, d);
463 parse_heading(const char *name)
465 match_u16_assert(0xffff);
467 match_string2_assert(name);
471 match_zeros_assert(int count, const char *where)
473 for (int i = 0; i < count; i++)
477 "%s: %#x: expected %d zeros here but offset %d is %#"PRIx8": ",
478 where, pos, count, i, data[pos + i]);
479 hex_dump (stderr, pos, 64);
484 #define match_zeros_assert(count) match_zeros_assert(count, WHERE)
487 put_safe(const char *s)
495 else if (*s < 0x20 || *s > 0x7e)
496 printf ("\\x%02"PRIx8, (uint8_t) *s);
503 static void parse_flexible(void);
506 parse_DspString(void)
508 printf("%#x: DspString(", pos);
511 printf("%f, \"", get_double());
512 printf("%s\")\n", get_string1());
516 match_byte_assert(1);
519 match_byte_assert(0);
520 match_byte_assert(1);
521 put_safe(get_string1());
527 match_DspString(void)
529 match_byte_assert(5);
530 match_byte_assert(0x80);
535 match_DspSimpleText(void)
537 match_byte_assert(3);
538 match_byte_assert(0x80);
539 match_byte_assert(0);
542 match_zeros_assert(3);
543 if (!match_byte(0x10))
544 match_byte_assert(0);
545 match_zeros_assert(4);
550 parse_weirdness(void)
552 match_byte_assert(1);
554 match_zeros_assert(12);
555 pos++; /* 90 or BC */
557 match_byte_assert(1);
558 match_zeros_assert(5);
560 match_zeros_assert(3);
561 puts(get_padded_string(32));
565 match_NavTreeViewItem(void)
567 match_byte_assert(7);
568 match_byte_assert(0x80);
569 match_zeros_assert(1);
570 if (!match_byte(0) && !match_byte(7) && !match_byte(2))
571 match_byte_assert(8);
572 match_zeros_assert(3);
574 match_byte_assert(0);
575 match_byte_assert(1);
576 match_byte_assert(0);
579 match_byte_assert(0);
581 match_byte_assert(0);
582 match_zeros_assert(5);
584 match_byte_assert(1);
585 match_zeros_assert(5);
592 match_byte_assert(0);
594 match_zeros_assert(11);
595 match_byte_assert(1);
596 match_zeros_assert(3);
598 match_byte_assert(0);
601 match_zeros_assert(2);
603 match_u32_assert(11000);
606 match_u32_assert(11000);
607 match_u32_assert(8500);
612 match_byte_assert(1);
617 get_string4(); /* page title */
618 match_byte_assert(1);
619 match_byte_assert(1);
620 match_zeros_assert(3);
621 get_string4(); /* page number */
622 match_byte_assert(0);
630 match_zeros_assert(3);
632 //fprintf(stderr, "%#x ", pos - 16);
636 parse_DspNumber(void)
638 match_byte_assert(1);
639 printf("DspNumber(");
641 match_byte_assert(0x80);
643 printf (" %f", get_double());
644 printf (" \"%s\")\n", get_string1());
648 match_DspNumber(void)
650 match_byte_assert(0x2a);
651 match_byte_assert(0x80);
658 match_byte_assert(0);
659 match_DspSimpleText();
660 parse_flexible(); /* DspString or DspNumber. */
666 match_byte_assert(0x27);
667 match_byte_assert(0x80);
674 match_byte_assert(2);
681 match_byte_assert(9);
682 match_byte_assert(0x80);
687 parse_PMModelItemInfo(void)
689 match_byte_assert(0);
690 pos += 1; /* Counter */
691 match_zeros_assert(7);
694 match_byte_assert(0xe);
695 match_byte_assert(0);
699 match_PMModelItemInfo(void)
701 match_byte_assert(0x54);
702 match_byte_assert(0x80);
703 parse_PMModelItemInfo();
704 match_DspSimpleText();
709 match_PMPivotItemTree(void)
711 match_byte_assert(0x52);
712 match_byte_assert(0x80);
713 match_byte_assert(0);
714 match_PMModelItemInfo();
720 match_byte_assert(2);
721 match_zeros_assert(24);
722 match_byte_assert(1);
723 match_zeros_assert(3);
725 match_byte_assert(0);
726 match_zeros_assert(3);
727 match_DspSimpleText();
732 parse_NavOleItem(void)
734 match_byte_assert(0);
735 match_byte_assert(1);
736 match_zeros_assert(2);
738 match_zeros_assert(9);
739 match_byte_assert(1);
740 match_zeros_assert(10);
741 match_byte_assert(1);
742 match_zeros_assert(5);
744 match_byte_assert(1);
746 match_byte_assert(0);
748 match_zeros_assert(11);
749 match_byte_assert(1);
750 match_zeros_assert(3);
752 match_byte_assert(0);
756 match_NavOleItem(void)
757 { /* 0e 80 or 12 80*/
758 if (!match_byte(0x12))
759 match_byte_assert(0x0e);
760 match_byte_assert(0x80);
767 match_byte_assert(2);
768 match_zeros_assert(8);
769 match_u32_assert(24);
773 match_byte_assert(4);
774 match_zeros_assert(2);
784 match_byte_assert(2);
785 match_zeros_assert(8);
786 match_u32_assert(24);
787 if (!match_u32(0) && !match_u32(0xffffff4b))
788 match_u32_assert(-40);
796 parse_PTPivotController(void)
798 match_byte_assert(2);
800 match_u32_assert(100);
801 match_u32_assert(100);
802 match_u32_assert(100);
803 match_u32_assert(100);
807 parse_PVPivotView(void)
809 match_byte_assert(5);
810 match_zeros_assert(4);
814 parse_NDimensional__DspCell(void)
816 match_byte_assert(0);
821 parse_IndexedCollection(void)
823 match_byte_assert(0);
826 match_zeros_assert(12);
836 parse_PTTableLook(void)
838 match_byte_assert(2);
839 match_byte_assert(2);
840 match_zeros_assert(7);
841 match_u32_assert(0x36);
842 match_u32_assert(0x12);
846 parse_PVViewDimension(void)
848 while (data[pos + 1] != 0x80
849 && (data[pos] != 0xff || data[pos + 1] != 0xff))
857 parse_PVSeparatorStyle(void)
859 match_byte_assert(0);
860 match_byte_assert(1);
861 match_zeros_assert(15);
863 match_byte_assert(0x80);
864 match_byte_assert(0);
866 match_byte_assert(1);
867 match_zeros_assert(9);
868 while (data[pos + 1] != 0x80
869 && (data[pos] != 0xff || data[pos + 1] != 0xff))
877 parse_PVCellStyle(void)
879 match_byte_assert(0);
880 match_byte_assert(1);
881 match_zeros_assert(5);
882 match_u32_assert(0xffffff);
883 match_zeros_assert(2);
890 if (match_u16(0xffff))
893 char *heading = get_string2();
894 if (!strcmp(heading, "DspCell"))
896 else if (!strcmp(heading, "DspNumber"))
898 else if (!strcmp(heading, "DspString"))
900 else if (!strcmp(heading, "NavHead"))
902 else if (!strcmp(heading, "IndexedCollection"))
903 parse_IndexedCollection();
904 else if (!strcmp(heading, "NavOleItem"))
906 else if (!strcmp(heading, "NavTitle"))
908 else if (!strcmp(heading, "NavNote"))
910 else if (!strcmp(heading, "PTPivotController"))
911 parse_PTPivotController();
912 else if (!strcmp(heading, "PVPivotView"))
914 else if (!strcmp(heading, "PMPivotModel"))
915 match_byte_assert(3);
916 else if (!strcmp(heading, "NDimensional__DspCell"))
917 parse_NDimensional__DspCell();
918 else if (!strcmp(heading, "PMPivotItemTree"))
919 match_byte_assert(0);
920 else if (!strcmp(heading, "PMModelItemInfo"))
921 parse_PMModelItemInfo();
922 else if (!strcmp(heading, "AbstractTreeBranch"))
923 match_byte_assert(0);
924 else if (!strcmp(heading, "PTTableLook"))
926 else if (!strcmp(heading, "PVViewDimension"))
927 parse_PVViewDimension();
928 else if (!strcmp(heading, "PVSeparatorStyle"))
929 parse_PVSeparatorStyle();
930 else if (!strcmp(heading, "PVCellStyle"))
934 fprintf(stderr, "don't know %s at offset 0x%x: ", heading, start);
935 hex_dump(stderr, pos, 128);
939 else if (data[pos + 1] == 0x80)
941 if (data[pos] == 0x2a && data[pos + 1] == 0x80)
943 else if (data[pos] == 0x27 && data[pos + 1] == 0x80)
945 else if (data[pos] == 0x5 && data[pos + 1] == 0x80)
947 else if (data[pos] == 0x7 && data[pos + 1] == 0x80)
948 match_NavTreeViewItem();
949 else if (data[pos] == 0x3 && data[pos + 1] == 0x80)
950 match_DspSimpleText();
951 else if ((data[pos] == 0x3c || data[pos] == 0x39)
952 && data[pos + 1] == 0x80)
958 /* match_byte_assert(0x01);
959 match_byte_assert(0x02);
960 match_byte_assert(0x0d); */
962 else if (data[pos] == 0x15 && data[pos + 1] == 0x80)
968 printf ("15 80(%f", get_double());
969 printf (" %s)\n", get_string1());
972 match_byte_assert(0);
974 if (!match_byte(2) && !match_byte(3))
975 match_byte_assert(0);
976 match_zeros_assert(3);
978 match_byte_assert(0);
979 match_byte_assert(1);
980 match_zeros_assert(3);
981 match_byte_assert(1);
982 match_byte_assert(0);
987 match_byte_assert(0);
991 match_zeros_assert(13);
994 else if (data[pos] == 0x9 && data[pos + 1] == 0x80)
998 else if (data[pos] == 0xe || data[pos] == 0x12)
1000 else if (data[pos] == 0x11 || data[pos] == 0x13)
1003 match_byte_assert(0);
1004 if (match_u32(0xc) || match_u32(0xd))
1005 match_u16_assert(1);
1007 match_zeros_assert(13);
1009 else if (data[pos] == 0x29 ||
1010 data[pos] == 0x2b ||
1011 data[pos] == 0x2d ||
1012 data[pos] == 0x31 ||
1013 data[pos] == 0x32 ||
1014 data[pos] == 0x4a ||
1015 data[pos] == 0x4c ||
1016 data[pos] == 0x4f ||
1017 data[pos] == 0x4d ||
1018 data[pos] == 0x50 ||
1019 data[pos] == 0x36 ||
1020 data[pos] == 0x52 ||
1021 data[pos] == 0x53 ||
1022 data[pos] == 0x54 ||
1023 data[pos] == 0x55 ||
1024 data[pos] == 0x57 ||
1025 data[pos] == 0x56 ||
1026 data[pos] == 0x58 ||
1027 data[pos] == 0x5c ||
1028 data[pos] == 0x5b ||
1029 data[pos] == 0x5e ||
1030 data[pos] == 0x62 ||
1031 data[pos] == 0x64 ||
1032 data[pos] == 0x4e ||
1033 data[pos] == 0x51 ||
1034 data[pos] == 0x59 ||
1035 data[pos] == 0x5a ||
1036 data[pos] == 0x5d ||
1037 data[pos] == 0x66 ||
1038 data[pos] == 0x60 ||
1039 data[pos] == 0x68 ||
1040 data[pos] == 0x48 ||
1041 data[pos] == 0x6a ||
1045 match_byte_assert(0);
1047 else if (data[pos] == 0x2c ||
1048 data[pos] == 0x2e ||
1049 data[pos] == 0x30 ||
1050 data[pos] == 0x34 ||
1051 data[pos] == 0x3d ||
1052 data[pos] == 0x40 ||
1053 data[pos] == 0x3f ||
1054 data[pos] == 0x42 ||
1055 data[pos] == 0x43 ||
1056 data[pos] == 0x44 ||
1057 data[pos] == 0x49 ||
1058 data[pos] == 0x3e ||
1067 fprintf (stderr, "bad record 0x%02x at offset %x: ",
1070 hex_dump (stderr, pos, 64);
1074 else if (match_byte(0xa))
1077 match_byte_assert(0);
1078 if (match_u16(0x0e74))
1079 match_byte_assert(0);
1082 match_zeros_assert(4);
1085 match_zeros_assert (2);
1089 else if (match_byte(1))
1091 match_byte_assert(0);
1094 match_byte_assert(0);
1097 match_zeros_assert(2);
1099 if (match_byte(0x08))
1101 match_byte_assert(0);
1102 match_u16_assert(0x0e74);
1103 match_byte_assert(0);
1105 else if (match_byte(3))
1107 match_byte_assert(0);
1108 if (match_u16(0x0e74))
1109 match_byte_assert(0);
1112 match_zeros_assert(6);
1113 if (!match_byte(0xe) && !match_byte(0x11))
1114 match_byte_assert(0);
1115 match_byte_assert(0);
1116 if (!match_u16(0x0e74))
1117 match_u16_assert(0);
1118 match_byte_assert(0);
1123 match_byte_assert(0);
1124 match_byte_assert(1);
1125 match_zeros_assert(3);
1126 match_byte_assert(1);
1127 match_byte_assert(0);
1132 else //if (match_u16(2) || match_u16(3) || match_u16(4) || match_u16(5) || match_u16(6) || match_u16(7) || match_u16(8) || match_u16(9))
1134 while (data[pos + 1] != 0x80
1135 && (data[pos] != 0xff || data[pos + 1] != 0xff))
1142 else if (match_byte(7) || match_byte(4) || match_byte(5) || match_byte(6) || match_byte(8) || match_byte(9) || match_byte(0xb) || match_byte(0xc) || match_byte(0x15) || match_byte(0x16) || match_byte(0x17) || match_byte(0x18) || match_byte(0x1e) || match_byte(0x1a))
1145 match_byte_assert(0);
1146 if (!match_u16(0x0e74))
1147 match_byte_assert(0);
1148 match_byte_assert(0);
1150 else if (match_byte(2) || match_byte(3))
1152 match_byte_assert(0);
1153 if (!match_u16(0x0e74))
1155 match_zeros_assert(2);
1158 match_zeros_assert(3);
1160 match_zeros_assert(4);
1165 match_u16_assert(0x0e74);
1169 //match_byte_assert(0);
1171 else if (match_byte(0xd) || match_byte(0xe) || match_byte(0xf)
1172 || match_byte(0x11) || match_byte(0x12) || match_byte(0x13)
1173 || match_byte(0x14) || match_byte(0x1b))
1175 if (!match_byte(0x07))
1176 match_byte_assert(0);
1177 if (!match_u16(0x0e74))
1178 match_zeros_assert(11);
1180 match_byte_assert(0);
1182 else if (match_byte(0xe3) || match_byte(0xdb) || match_byte(0xd8) || match_byte(0xe9) || match_byte(0xf3))
1184 match_byte_assert(0x0e);
1185 match_byte_assert(0x74);
1186 match_byte_assert(0x0e);
1187 match_byte_assert(0);
1189 else if (match_byte(0x9d) || match_byte(0x9e) || match_byte(0x9c))
1190 match_u32_assert(0x000e741a);
1191 else if (match_byte(0x10))
1193 match_byte_assert(0);
1195 match_zeros_assert(10);
1198 match_u16_assert(0x0e74);
1199 match_byte_assert(0);
1202 else if (match_byte(0x39) || match_byte(0x3a) || match_byte(0x3b))
1203 match_u32_assert(0x000e7409);
1206 //fprintf (stderr, "bad record start at offset %x: ", pos);
1207 hex_dump (stderr, pos, 64);
1216 main(int argc, char *argv[])
1218 bool print_offsets = false;
1221 int c = getopt (argc, argv, "o");
1228 print_offsets = true;
1235 if (argc - optind != 1)
1237 fprintf (stderr, "usage: %s FILE.bin", argv[0]);
1241 const char *filename = argv[optind];
1242 int fd = open(filename, O_RDONLY);
1245 fprintf (stderr, "%s: open failed (%s)", filename, strerror (errno));
1256 data = malloc(n + 256);
1262 if (read(fd, data, n) != n)
1267 for (int i = 0; i < 256; i++)
1268 data[n + i] = i % 2 ? 0xaa : 0x55;
1271 setvbuf (stdout, NULL, _IOLBF, 0);
1273 match_byte_assert(4);
1274 match_u32_assert(0);
1275 match_string1_assert("SPSS Output Document");
1276 match_u32_assert(1);
1277 match_byte_assert(0x63);
1279 parse_heading("NavRoot");
1280 match_byte_assert(2);
1281 match_zeros_assert(32);
1283 parse_heading("DspSimpleText");
1284 match_zeros_assert(10);
1286 parse_heading("DspString");
1289 parse_heading("NavTreeViewItem");
1290 match_byte_assert(0);
1292 match_u32_assert(0);
1293 match_byte_assert(2);
1294 match_byte_assert(0);
1295 match_byte_assert(1);
1296 match_zeros_assert(9);
1297 match_u32_assert(1);
1299 match_u32_assert(0);
1300 match_u32_assert(0x18);
1302 match_u32_assert(0xffffffd8);
1303 match_u32_assert(0xffffffde);
1304 match_u32_assert(0x18);
1306 match_u32_assert(0xffffffd8);
1307 match_u32_assert(0x28);
1308 match_u32_assert(0x28);
1312 match_zeros_assert(5);
1314 if (match_u32(8500))
1315 match_u32_assert(11000);
1318 match_u32_assert(11000);
1319 match_u32_assert(8500);
1324 match_byte_assert(1);
1329 get_string4(); /* page title */
1330 match_byte_assert(1);
1331 match_byte_assert(1);
1332 match_zeros_assert(3);
1333 get_string4(); /* page number */
1334 match_byte_assert(0);
1336 match_u16_assert(2);
1339 if (data[pos + 9] != 'L')
1341 parse_heading("NavLog");
1351 puts(get_padded_string(32));
1353 match_u32_assert(132);
1354 match_zeros_assert(8);
1355 match_u32_assert(1);
1356 printf ("0x%x\n", pos);
1358 match_byte_assert(0);
1360 parse_heading("NavHead");
1362 match_NavTreeViewItem();
1363 match_zeros_assert(3);
1365 parse_heading("NavTitle");
1367 match_DspSimpleText();
1369 match_NavTreeViewItem();
1371 match_byte_assert(1);
1372 match_byte_assert(1);
1373 match_u32_assert(-19);
1374 match_zeros_assert(12);
1375 match_byte_assert(0xbc);
1376 match_byte_assert(2);
1377 match_zeros_assert(9);
1378 match_byte_assert(0x22);
1379 puts(get_padded_string(32));
1380 match_u32_assert(80);
1381 match_zeros_assert(8);
1382 match_u32_assert(1);
1384 match_byte_assert(0);
1386 parse_heading("NavNote");
1387 match_byte_assert(2);
1388 match_zeros_assert(8);
1389 match_u32_assert(24);
1391 match_u32_assert(-40);
1393 match_u32_assert(2);
1394 match_u32_assert(1);
1395 match_DspSimpleText();
1397 match_NavTreeViewItem();
1398 match_byte_assert(1);
1400 parse_heading("PTPivotController");
1401 match_byte_assert(2);
1403 match_u32_assert(100);
1404 match_u32_assert(100);
1405 match_u32_assert(100);
1406 match_u32_assert(100);
1408 parse_heading("PVPivotView");
1409 match_u32_assert(5);
1410 match_byte_assert(0);
1412 parse_heading("PMPivotModel");
1413 match_byte_assert(3);
1415 parse_heading("NDimensional__DspCell");
1416 match_byte_assert(0);
1417 match_u32_assert(1);
1419 parse_heading("IndexedCollection");
1420 match_byte_assert(0);
1422 match_zeros_assert(3);
1423 match_byte_assert(1);
1424 match_byte_assert(0);
1425 match_zeros_assert(7);
1427 while (data[pos] != 1)
1435 match_byte_assert(1);
1436 match_byte_assert(0);
1437 puts(get_string1());
1439 match_u32_assert(2);
1440 puts(get_string1());
1442 match_byte_assert(0);
1443 match_byte_assert(1);
1444 match_byte_assert(0);
1445 match_byte_assert(0);
1446 match_byte_assert(0);
1447 match_byte_assert(1);
1448 match_byte_assert(0);
1452 parse_heading("PMPivotItemTree");
1453 match_byte_assert(0);
1455 parse_heading("AbstractTreeBranch");
1456 match_byte_assert(0);
1458 parse_heading("PMModelItemInfo");
1459 parse_PMModelItemInfo();
1460 match_DspSimpleText();
1463 match_u32_assert(7);
1464 match_PMPivotItemTree();
1466 match_u32_assert(0);
1467 match_PMPivotItemTree();
1469 match_u32_assert(0);
1470 match_PMPivotItemTree();
1472 match_u32_assert(6);
1473 match_PMPivotItemTree();
1475 match_u32_assert(0);
1476 match_PMPivotItemTree();
1478 match_u32_assert(0);
1479 match_PMPivotItemTree();
1481 match_u32_assert(0);
1482 match_PMPivotItemTree();
1484 match_u32_assert(0);
1485 match_PMPivotItemTree();
1487 match_u32_assert(0);
1488 match_PMPivotItemTree();
1490 match_u32_assert(0);
1491 match_PMPivotItemTree();
1493 match_u32_assert(2);
1494 match_PMPivotItemTree();
1496 match_u32_assert(0);
1497 match_PMPivotItemTree();
1499 match_u32_assert(0);
1500 match_PMPivotItemTree();
1502 match_u32_assert(0);
1503 match_PMPivotItemTree();
1505 match_u32_assert(0);
1506 match_PMPivotItemTree();
1508 match_u32_assert(2);
1509 match_PMPivotItemTree();
1511 match_u32_assert(0);
1512 match_PMPivotItemTree();
1514 match_u32_assert(0);
1518 while (data[pos] != 0xff || data[pos + 1] != 0xff)
1520 parse_heading("PVViewDimension");
1523 for (i = 0; data[pos + i] != 0xff || data[pos + i + 1] != 0xff; i++)
1525 hex_dump(stdout, pos, i);
1527 printf ("%#x: end of successful parse\n", pos);