fat_unformat_aux_for_Datarec
2017-03-18 16:59:54 0 举报
`fat_unformat_aux_for_Datarec` 是一个函数,主要用于处理数据记录的格式化操作。该函数的主要功能是解压缩和还原经过特定格式处理的数据记录,使其恢复到原始状态。在实际应用中,它可以帮助用户快速恢复丢失或损坏的数据记录,提高数据的可用性和可靠性。此外,该函数还具有高效、安全、易用等特点,适用于各种场景和需求。总之,`fat_unformat_aux_for_Datarec` 函数为数据记录的格式化提供了一种简便、可靠的解决方案,有助于提高工作效率和保障数据安全。
作者其他创作
大纲/内容
chr!=NULL
否
是
is_get_inode
取簇del_offset=cluster_array[i];
记录读取字节readSize+=disk-sector_size;
初始化
获取该文件起始偏移newoffset = start_offset + (uint64_t)(current_file-st_inode - 2) * blocksize
next_clusterno_of_cluster
path[0] == NULL
current_file=dir_list;
parentinode = 0;\tfree(path[pathdeep]);\tpath[pathdeep] = NULL;pathdeep -=1;
tempDirName!=NULL
属性不为0F或者不是卷标且firstentryfound = true;
查找被删除的目录或卷标,具有相关属性
dirInode==0
否则
释放free(path[pathdeep]);path[pathdeep]=NULL;pathdeep--;
current_file=current_file-next;
该簇被使用del_offset
删除链表delete_list_file(dir_list);
保存读取字节大小
当前目录项为“.”目录项且不是目录项列表起始
parentinode = current_file-st_inode;
entry%disk-sector_size!=0
new_file_end=new_file_start+blocksize - 1;
current_file = current_file-next;
file_end part_offset + partition-part_size
firstentryfound = true;
为文件目录项
free(buffer_start);
获取该目录起始偏移newoffset = start_offset + (uint64_t)(current_file-st_inode - 2) * blocksize
current_search_space-data++;
查看是否以前有记录
释放free (path[0]);path[0] = NULL;
pathdeep!=0
如果是没有被删除的目录项
2
!isDeletedDir
current_search_space = current_space;
current_search_space-data = 0;
属性位为0
current_search_space!=list_search_space
当前搜索空间不等于列表空间
获取该簇起始偏移newoffset = start_offset + (uint64_t)(current_file-st_inode - 2) * blocksize
将offset保存
fat_header-fats1
发现目录的簇founddirsector
NEXT_BLOCK
skipdirsize
若是,获取下一搜索空间
偏移是存在
从offset开始读取放进buffer
current_space!=NULL&&pathdeep0
ind_stop !=0
dir_list的节点!=parentinode
start
计算文件结束偏移file_end=file_start+(current_file-stat.st_size+blocksize-1)/blocksize*blocksize - 1;
被删除的
firstentryfound = false;
记录目录的簇号dirInode = current_file-st_inode;preDirInode =dirInode;
foundinode == offset
end
reset_file_recovery
判断获取的搜索空间是否与列表起始搜索空间相等
current_space == NULL
preoffset = offset
founddirsector = true;
foundinode == current_file-st_inode
获取该簇结束偏移
path[0]!=NULL
oundvalidfile = true;
isLostDirEntry = true;
存在FAT表fat_header-fats0
verbose0
空目录\t\t\t3dot = \"...\
pathdeep0
skipdirsize = false;
info_list_search_space
founddirsector = false;
记录读取簇数readdirsize += (blocksize - readdirsize%blocksize);\tskipdirsize = true;
file_size = current_file-stat.st_size;cluster = current_file-st_inode;file_clusters = (file_end - file_start)/blocksize;
isValidShortFATDirectoryCharacter(buffer[i])
偏移一个簇大小buffer+=((readdirsize-1)/disk-sector_size)*disk-sector_size+disk-sector_size;offset+=((readdirsize-1)/disk-sector_size)*disk-sector_size+disk-sector_size;
如果偏移为数据区起始offset==start_offset
删除目录列表delete_list_file(dir_list);
foundvalidfile = true;
当前目录项存在current_file != NULL
prediroffset!=offset
是否存在spacefound
offset_end = current_search_space-end;offset=pathdeep0?newoffset:current_search_space-start;
一般应为2dirInode=(offset-start_offset)/blocksize+2;
const struct msdos_dir_entry *de=(const struct msdos_dir_entry*)buffer;
偏移一个扇区大小buffer+=disk-sector_size;offset+=disk-sector_size;
offset_end = current_search_space-end;offset = current_search_space-start;buffer=buffer_start;
文件名数目filenbr++;
newcluster!=0 && newclusternext_cluster || next_cluster == 0xFFFFFFF
pre=path_temp;length=0;i = 0;
offset end||pathdeep0
pathdeep == 0 && path[0] != NULL
tart_fat1 = 8;
存在foundvalidfile
entry小于块大小-0x20
current_search_space==list_search_space
确认是否存在spacefound = newoffset(partition-part_offset+partition-part_size-READ_SIZE)?false:true;
获取列表前一个搜索空间
从0x01到0x0B
记录
当前目录项存在current_file!=NULL
是“..”目录项
计算簇数cluster_num = (readdirsize-1)/blocksize;
buffer+read_sizebuffer_start+READ_SIZE && offset disk_real_size
partition-upart_type == UP_FAT16
ActReadSize = (offset +READ_SIZE disk-disk_real_size)?(disk-disk_real_size-offset+1)/disk-sector_size*disk-sector_size:READ_SIZE;buffer=buffer_start;
free(path[0]);path[pathdeep]=NULL;is_get_inode=false;
如果目录列表开始为“.”目录项且parentinode!=0
partition-status == STATUS_DELETED && partition-upart_type != UP_FAT12
存在目录列表dir_list!=NULL
获取该目录项*de=(const struct msdos_dir_entry*)&buffer[entry];
\tcurrent_search_space-data = 0;cluster=next_cluster;newcluster = 0;
founddirsector = true;isLostDirEntry = false;
遍历所有簇
获取当前搜索空间的start和end
path[0]=strdup(\"\");
i++
判断是否存在该文件
发现根目录项firstentryfound
被删除的目录项
释放该目录项current_file=NULL;
is_get_inode=true;tempdirsize=readdirsize;
具有相关属性且大小为0或者被删除或者存档属性且不是卷标
i=pathdeep
current_search_space-data0
取当前偏移prediroffset = offset;
是“.”目录项
是目录的目录项但非“.”和“..”目录项
移除具有相同簇节点的目录项dir_list = dir_fat_remove_duplicate(dir_list);
readSizeoffset
entry = 0x20;
foundvalidfile = false;
前面两项的目录项分别为“.”和“..”目录项或者具有相关属性且文件大小为0或被删除的
否
current_search_space != list_search_space
preoffsetoffset
readdirsize=tempdirsize;
收藏
收藏
0 条评论
下一页