首页 > 其他分享 >File Recovery FAT32 dominantin SD

File Recovery FAT32 dominantin SD

时间:2024-11-19 10:56:24浏览次数:1  
标签:le Recovery FAT32 dominantin Milestone fi recover your points

Lab 4: File Recovery

Introduction

FAT has been around for nearly 50 years. Because of its simplicity, it is themost widely compatible fi le system. Although recent computers have

adopted newer fi le systems, FAT32 (and its variant, exFAT) is still dominantin SD cards and USB fl ash drives due to its compatibility.Have you ever accidentally deleted a fi le? Do you know that it could berecovered?In this lab, you will build a FAT32 fi le recovery tool called Need You to Undelete my FILE, ornyufilefor short.ObjectivesThrough this lab, you will:Learn the internals of the FAT32 fi le system.Learn how to access and recover fi les from araw disk.

Get a better understanding of key fi le system concepts.Be a better C programmer. Learn how to write code that manipulatesdata at the byte level and understand the alignment issue.OverviewIn this lab, you will work on the data stored in the FAT32 fi le system

directly, without the OS fi le system support. You will implement a tool thatrecovers a deleted file specifi ed by the user.For simplicity, you can assume thatthe deleted fi le is in the root directory.

Therefore, you don’t need to search subdirectories.command performs low-level copying of raw data.Therefore, you can use it to generate an arbitrary-size fi le full of zeros.program is invoked with option-l, it should list all valid

entries in the root directory with the following information:Filename. Similar to/bin/ls -p, if the entry is a directory, you shouldappend a / indicator.File size if the entry is a fi le (not a directory).Starting cluster if the entry is not an empty fi le.You should also print the total number of entries at the end. Your outputshould be in the following format:[root@... cs202]# ./nyufile fat32.disk -lHELLO.TXT (size = 14, starting cluster = 3)

/ (starting cluster = 4)EMPTY (size = 0)Total number of entries = 3Here are a few assumptions:Lab 4: File Recovery7/18You should not list entries marked as deleted.You don’t need to print the details inside subdirectories.For all milestones, there will be no long fi lename (LFN) entries. (If youhave accidentally created LFN entries when you test your program,don’t worry. You can just skip the LFN entries and print only the 8.3

fi lename entries.)Any fi le or directory, including the root directory, may span more than

one cluster.There may be empty fi les.Milestone 4: recover a small fileEMPTY (size = 0)Total number of entries = 3[root@... cs202]# mount fat32.disk /mnt/disk[root@... cs202]# ls -p /mnt/diskDIR/ EMPTY HELLO.TXT[root@... cs202]# cat /mnt/disk/HELLO.TXTHello, world.For all milestones, you only need to recover regular fi les (including emptfi les, but not directory fi les) in the root directory. When the fi le is

Lab 4: File Recovery9/18Here are a few assumptions specifi cally for Milestone 4:should printfilename: file not foundreplacefilenamewith the actual fi le name).Milestone 5: recover a large contiguously-allocated fileNow,代写File Recovery  FAT32   dominantin SD   you will recover a fi le that is larger than one cluster. Nevertheless, forMilestone 5, you can assume that such a fi le is allocated contiguously. Youcan continue toassume that at most one deleted directory entry matchesthe given fi lename. If no such entry exists, your program should printfilename: file not found(replacefilenamewith the actual fi le name).Milestone 6: detect ambiguous file recovery requestsIn Milestones 4 and 5, you assumed that at most one deleted directory

entry matches the given fi lename. However, multiple fi les whose names

differ only in the fi rst character would end up having the same name when

deleted. Therefore, you may encounter more than one deleted directoryentry matching the given fi lename. When that happens, your programshould printfilename: multiple candidates found.If no such fi le matches the given SHA-1 hash, your program should printfilename: file not found(replacefilenamewith the actual fi le name). Forexample:[root@... cs202]# ./nyufile fat32.disk -r TANG.TXT -s 0123456789abcdef01234567TANG.TXT: file not foundThe OpenSSL library provides a functionSHA1(), which computes the SHA-1 hash ofd[0...n-1]and stores the result inmd[0...SHA_DIGEST_LENGTH-1]:#include<openssl/sha.h>#define SHA_DIGEST_LENGTH 20 unsignedchar *SHA1(const unsigned char *d, size_t n, unsigned char *md);

You need to add the linker option-lcryptoto link with the OpenSSL library.Milestone 8: recover a non-contiguously allocated fileFinally, the clusters of a fi le are no longer assumed to be contiguous. Youhave to tryevery permutation of unallocated clusters on the fi le system inorder to fi nd the one that matches the SHA-1 hash.The command-line option isR filename -s sha1. The SHA-1 hash must begiven.Note that it is possible that the fi le is empty or occupies only one cluster. Ifso,-Rbehaves the same as-r, as described in Milestone 7.Lab 4:File Recovery12/18For Milestone 8, you can assume that the entire fi le is within the fi rst 20clusters, and the fi le content occupies no more than 5 clusters, so a bruteorce search is feasible. you cannot fi nd a fi le that matches the given SHA-1 hash, your programEMPTY.TXT– an empty fi le.CONT.TXT– a large contiguously-allocated file.NON_CONT.TXT– a large non-contiguously allocated file.You should make your own test cases and test your program thoroughly.Make sure to test your program with disksformatted with differentparametersThe autograderWe are providing a sample autograder with a few test cases. Please extractthem in your Docker container and follow the instructions intheREADME

fi le. (Refer to Lab 1 for how to extract a .xz  le.) Note that the test cases are not exhaustive. The numbered test cases onGradescope are the same as those in the sample autograder, while thelettered test cases are “hidden” test cases that will not be disclosed. If yourprogram passed the former but failed the latter, please double-check if it handle all corner cases correctly. Do not try to hack or exploit theautograder.Submissionmust submit a.ziparchive containing all fi les needed to compilenyufile$ zip nyufile.zip Makefile *.h *.c that other fi le formats (e.g.,rar will not be accepted.Lab 4: File Recovery

/18You need to upload the .zip  to Gradescope. If you need toacknowledge any infl uences per our academic integrity policy, write themas comments in your source code.RubricThe total of this lab is 100 points, mapped to 15% of your fi nal grade of thiscourse.

Milestone 1: validate usage. (40 points)Milestone 2: print the fi le system information. (5 points)Milestone 3: list the root directory. (10 points)Milestone 4: recover a small fi le. (15 points)Milestone 5: recover a large contiguously-allocated file. (10 points)Milestone 6: detect ambiguous fi le recovery requests. (5 points)Milestone 7a: recover a small fi le with SHA-1 hash. (5 points)Milestone 7b: recover a large contiguously-allocated file with SHA-1

hash. (5 points)Milestone 8: recover a non-contiguously allocated file. (5 points)TipDon’t procrastinateThis lab requires signifi cant programming effort. Therefore, start asearly MAP_SHAREDin order to update the fi le. Once you have mapped your disk image, you can cast anyaddress to the FAT32 data structure type, such as(DirEntry *)(mapped_address + 0x5000). You can also cast the FAT to[]for easy access.The milestones have diminishing returns. Easier milestones are worthmore points. Make sure you get them right before trying to tackle thharder ones.Thislab has borrowed some ideasfrom Dr. T. Y. Wong. Lab 4: File Recovery18/18

 

标签:le,Recovery,FAT32,dominantin,Milestone,fi,recover,your,points
From: https://www.cnblogs.com/comp9021T2/p/18550225

相关文章

  • U盘突然变成FAT32格式?
    目录备份数据!备份数据!备份数据!超级兔子u盘恢复的方法操作:命令行转换NTFS格式备份数据!备份数据!备份数据!重要的事情说三遍!数据对于一个研究生来说有多重要,我想大家心里都有数吧。昨天在用U盘做数据处理的时候,突然报错,一看,U盘的格式出错了,点开属性,显示FAT32但是U盘还......
  • iFind Data Recovery Enterprise 中文授权版
    这是一款数据恢复工具。无论是硬盘、U盘、SD卡,还是已删除分区或无法识别的USB闪存驱动器,iFindDataRecovery都能应对自如。它支持超过2000种文件格式和文件系统,包括NTFS、FAT、FAT16、FAT32、EXFAT、HFS+和APFS,几乎涵盖了所有主流设备。该版本已授权,可以使用全部功能......
  • EasyRecovery15破解补丁器+永久免费安装包下载
    数据丢失?别急!EasyRecovery15来救你!大家好,我是你们的数据恢复小能手!今天要给大家安利一个超级好用的软件——EasyRecovery15。这款软件可是数据恢复界的“大佬”,有了它,再也不用担心重要文件丢失的问题啦!「EasyRecovery免费无需激活版绿色版」最新版夸克网盘获取链接:先保存以......
  • Rockchip RK3588 - Rockchip Linux Recovery recovery源码分析
    ----------------------------------------------------------------------------------------------------------------------------开发板:ArmSoM-Sige7开发板eMMC:64GBLPDDR4:8GB显示屏:15.6英寸HDMI接口显示屏u-boot:2017.09linux:5.10-------------------------------......
  • Android 14.0 recovery竖屏界面旋转为横屏
    1.概述在14.0系统rom项目定制化开发中,由于平板固定横屏显示,而如果recovery界面竖屏显示就觉得怪怪的,所以需要recovery页面横屏显示的功能,所以今天就来解决这个问题2.实现功能相关分析Android的Recovery中,利用bootable\recovery下的minui库作为基础,采用的是直接存取framebu......
  • HANA backup and recovery
    HANA数据库要恢复备份,首先得有备份,这不是一句废话,因为HANA数据库默认是没有开启备份机制的。<br>下面提供两种备份方式——一、data+log增量备份hdbsql-i$sid-uSYSTEM-p$sysPassword"BACKUPDATAusingfile('$backupDir/$dbName_$dateStr')";命令中的sid为实例......
  • 【FAT32文件系统详细分析 (格式化SD nandSD卡)】
    ......
  • 推荐一款强大的数据恢复软件:Rcysoft Data Recovery Ultimate
    RcysoftDataRecoveryUltimate是一款强大的数据恢复软件,能够帮助您轻松快速地从PC、笔记本电脑、损坏或格式化的硬盘驱动器或可移动设备中恢复已删除、格式化或丢失的数据。无论您的数据是由于意外删除、格式化、硬盘损坏还是其他原因丢失的,该软件都能高效地帮助您找回。主......
  • Recovery Catalog Schema Upgrade Fails With ORA-02298 On Constraint ROUT_F3
    OracleDatabase-EnterpriseEdition-Version19.16.0.0.0andlaterRecoveryCatalogschemaupgradetoversion19.16 failsWithORA-02298onconstraintROUT_F3RMAN>upgradecatalogrecoverycatalogispartiallyupgradedto19.16.00.00errorcreatingu......
  • 【FAT32文件系统详细分析 (格式化SD nandSD卡)】
    ......