-
Notifications
You must be signed in to change notification settings - Fork 205
/
README_dev_photorec.txt
58 lines (44 loc) · 2.2 KB
/
README_dev_photorec.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
PhotoRec - Theory of operation:
Carvers are plugable. Each carver consists of:
struct file_hint_t - describes extension, name, max size, enable by default, etc.
file_enable_t array_file_enable[] - array with all file hints and whether enabled or not.
phmain.c - Contains the main() and driver logic for photorec.
main():
- reads parameters
- scans for available devices
- parses the HD (or image)
- resets the list of which file carvers are enabled
- Initializes ncurses
- Calls do_curses_photorec() (in pdisksel.c)
- shuts down ncurses
pdiskseln.c -
int do_curses_photorec(struct ph_param *params, struct ph_options *options, const list_disk_t *list_disk)
- Implements Disk selection
- May call photorec_disk_selection_ncurses()
- Eventually call menu_photorec() in ppartseln.c
ppartseln.c -
void menu_photorec(struct ph_param *params, struct ph_options *options, alloc_data_t*list_search_space)
- Implements Partition selection and Search/Options/File Opt/Geometry/Quit menu
- Search Option call photorec()
phrecn.c -
int photorec(struct ph_param *params, const struct ph_options *options, alloc_data_t *list_search_space)
- runs multiple passes until status==STATUS_QUIT
- calls photorec_mkdir() to actually make the output directory
- calls photorec_find_blocksize() to find the block size
- calls photorec_aux() to do the recovery
- may call photorec_bf() to recover more files by brute-force method
src/psearchn.c -
pstatus_t photorec_aux(struct ph_param *params, const struct ph_options *options, alloc_data_t *list_search_space)
- calls file_finish2() when recovery of a file is finished (ie. a new file has been found)
- calls file_recovery_aborted() if the user stops the recovery or there is not enough space on the destination
photorec.c: -
int file_finish_bf(file_recovery_t *file_recovery, struct ph_param *params, alloc_data_t *list_search_space)
- called when recovery of a file is done by
- photorec_bf()
- photorec_bf_pad()
- photorec_bf_frag()
- photorec_bf_aux()
photorec.c
pfstatus_t file_finish2(file_recovery_t *file_recovery, struct ph_param *params, const int paranoid, alloc_data_t *list_search_space)
- called when a file is done by
- photorec_aux() (in three places)