unyaffs

Unyaffs (http://code.google.com/p/unyaffs/) is a nice little program for extracting files from a yaffs image.

Current limitations

Modifications

Restoring the symlink dates is a bit difficult as the needed lutimes system call is only supported for Linux, FreeBSD, NetBSD and Mac OS X (as far as I know). So I did some #if trickery to use lutimes for these OS and utime (without support for restoring symlink dates) for the rest.

Another interesting part is the restoration of the directory dates. Changing the directory dates is quite simple, but any subsequent modification in this directory (e.g. adding files) will change the date. So changing the directory dates has to be defered until all files are restored.

Restoring the ownership is quite simple (chown system call), but requires root priviledges. Without root priviledges the current owner will be used.

Caution: Running unyaffs as root might result in security issues. I closed some potential buffer overflows, but I can't guarantee that the application is 100% safe. Using chroot or fakeroot guards against a lot of problems.

Most of the remaining changes deal with some boring checks against invalid indexes.

I tested the modified unyaffs with Debian linux and Mac OS X.

Downloads