unsigned int y = get_u32();
if (x != y)
{
- fprintf(stderr, "%s: 0x%x: expected i%u, got i%u\n", where, pos - 4, x, y);
+ fprintf(stderr, "%s: 0x%x: expected i%u, got i%u: ", where, pos - 4, x, y);
+ hex_dump(stderr, pos - 4, 64);
exit(1);
}
}
match_byte_assert(1);
get_u32();
match_zeros_assert(12);
- match_byte_assert(0x90);
- match_byte_assert(1);
+ pos++; /* 90 or BC */
+ if (!match_byte(2))
+ match_byte_assert(1);
match_zeros_assert(5);
pos++;
match_zeros_assert(3);
match_byte_assert(1);
match_zeros_assert(10);
match_byte_assert(1);
- match_zeros_assert(6);
+ match_zeros_assert(5);
+ get_string1();
match_byte_assert(1);
parse_weirdness();
match_byte_assert(0);
match_byte_assert(0);
}
+static void
+match_NavOleItem(void)
+{ /* 0e 80 */
+ match_byte_assert(0x0e);
+ match_byte_assert(0x80);
+ parse_NavOleItem();
+}
+
static void
parse_NavTitle(void)
{
match_u32_assert(24);
get_u32();
pos++;
- match_byte_assert(4);
+ if (!match_byte(3))
+ match_byte_assert(4);
match_zeros_assert(2);
get_u32();
match_u32_assert(2);
+ if (!match_u32(2))
+ match_u32_assert(1);
+}
+
+static void
+parse_NavNote(void)
+{
+ match_byte_assert(2);
+ match_zeros_assert(8);
+ match_u32_assert(24);
+ if (!match_u32(0))
+ match_u32_assert(-40);
+ pos += 8;
+ match_u32_assert(2);
match_u32_assert(1);
}
parse_NavOleItem();
else if (!strcmp(heading, "NavTitle"))
parse_NavTitle();
+ else if (!strcmp(heading, "NavNote"))
+ parse_NavNote();
else
{
fprintf(stderr, "don't know %s at offset 0x%x: ", heading, start);
{
match_NavLog();
}
+ else if (data[pos] == 0xe)
+ match_NavOleItem();
else
{
- fprintf (stderr, "bad record 0x%02x at offset %x\n",
+ fprintf (stderr, "bad record 0x%02x at offset %x: ",
data[pos], pos);
hex_dump (stderr, pos, 64);
assert(0);
parse_flexible();
parse_flexible();
parse_flexible();
+ parse_flexible();
+ parse_flexible();
+ parse_flexible();
+ parse_flexible();
exit(0);
puts(get_padded_string(32));
if (!match_u32(80))