Deleted file recovery program using C C++

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
lisaly90
Posts: 2
Joined: 16 Jul 2019, 06:03

Deleted file recovery program using C C++

#1 Post by lisaly90 »

I want to write a program that can recover deleted files from hard drive ( FAT32/NTFS partition Windows).

I don't know where to start from. What should be the starting point of this? What should i read to pursue this?

Help is required.

Which system level structs should i study?

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Deleted file recovery program using C C++

#2 Post by cgrenier »

PhotoRec is using file header to identify the beginning of files and recover them.
TestDisk knows about the filesystems internal to recover files from exFAT, FAT32, NTFS... to recover them with their original filenames.
You can learn about the two method by reading the source code.
As TestDisk and PhotoRec are under GNU GPL 2 or later license, if you "borrow" source code from one of the programs, your program need to be under the same license.

recuperation
Posts: 2721
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Deleted file recovery program using C C++

#3 Post by recuperation »

Start with FAT(32) because it is the easiest one.

Search for:

Microsoft Extensible Firmware Initiative FAT32 File System Specification
FAT: General Overview of On-Disk Format

Version 1.03, December 6, 2000
Microsoft Corporation

My personal favorite is an old article in German language from the German computer magazine labeled "c't".
You an buy the article here:
https://shop.heise.de/katalog/datenpuzzle-1

It covers the old MBR-style partitioning scheme as well.
There is another article that applies to ext2-structures in this issue of the magazine - has to be purchased separately.

Locked