On Sunday 27 March 2011 06:17:40 Serguei Miridonov wrote: > Hello, > > Probably this question has been answered somewhere but, unfortunately, > I could not find a simple solution with a working C source... > > The situation: I have a dump from a MTD partition which contains a > YAFFS2 filesystem. Assuming I have no knowledge of neither data block > size, nor chunk size, how can I scan the dump file to find a full data > directory? Is there a C source doing that? > > I could find various versions of unyaffs program but it seems they > have hardcoded page and spare sizes. None of them could autodetect > YAFFS2 filesystem properties, retrieve files/directories from some > images of YAFFS2 filesystem, etc. > > Any idea? > > Thanks in advance. Hello Serguei If you know what device you have you should be able to get the mtd code for that device (it should be available under GPL) and be able to see what the parameters are. If you do a hex dump of the dump file you should be able to determine the page size and binary layout that way too. With that knowledge you should be able to tweak something like unyaffs until it understands your binary layout. -- Charles