How can I write a program that can recover files in FAT32?
This is pretty complex, but FAT32 is very good documented:
I wrote a tool for direct FAT32 access once using only those ressources:
But I've never actually tried to recover files. If you will successfully recover a file depends on several factors: