I believe this question should be closed due to being off topic as it asks to find existing programs to solve the problem, but open bounty prevents close vote. However.
Does such a program exist?
Yes they exist is and are called data carving tools. Some commom ones include scalpel and foremost and PhotoRec
A list of other tools is avaliable here