# HG changeset patch # User Michael Spacefalcon # Date 1368911373 0 # Node ID 9f3a7b014e6312a734eba895166f88acd7cee8cd # Parent 671db68916c7bdae3b54b4df3e72e80fec0336eb MysteryFFS dump2: dumping all file fragments diff -r 671db68916c7 -r 9f3a7b014e63 mysteryffs/dump2.c --- a/mysteryffs/dump2.c Sat May 18 19:48:07 2013 +0000 +++ b/mysteryffs/dump2.c Sat May 18 21:09:33 2013 +0000 @@ -206,6 +206,31 @@ return(0); } +dump_file_chain(firstent) +{ + struct index_entry rec; + int ent; + + for (ent = firstent; ent != 0xFFFF; ent = rec.descend) { + get_index_entry(ent, &rec); + if (rec.type == 0xF4) { + printf("\nfile continuation (entry #%x)\n", ent); + printf("len=%x, unknown fields: %02X %04X %04X\n", + rec.len, rec.unknown_b1, + rec.unknown_w1, rec.unknown_w2); + dump_data_frag(ent, &rec); + } else { + printf("\ncontinuation entry at %x: type %02X != F4\n", + ent, rec.type); + printf("len=%x, unknown fields: %02X %04X %04X\n", + rec.len, rec.unknown_b1, + rec.unknown_w1, rec.unknown_w2); + } + if (rec.sibling != 0xFFFF) + printf("warning: non-nil sibling pointer\n"); + } +} + dump_dir(firstent, path_prefix) { struct index_entry rec; @@ -227,13 +252,17 @@ continue; case 0xF1: /* regular file */ - dump_common(ent, &rec, path_prefix, "file", 0); + if (dump_common(ent, &rec, path_prefix, "file", 0) < 0) + continue; dump_data_frag(ent, &rec); + dump_file_chain(rec.descend); continue; case 0xE1: /* special .journal file */ - dump_common(ent, &rec, path_prefix, "E1 file", 0); + if (dump_common(ent, &rec, path_prefix, "E1 file", 0)<0) + continue; dump_data_frag(ent, &rec); + dump_file_chain(rec.descend); continue; default: printf("entry #%x: unexpected type %02X\n", ent,