Skip to content

Commit

Permalink
use real cluster size for undelete command
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhiteninja committed Jul 22, 2023
1 parent 8aa1a26 commit 958ae00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Commands/command_undelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ int print_deleted_files(std::shared_ptr<Disk> disk, std::shared_ptr<Volume> vol,

std::shared_ptr<NTFSExplorer> explorer = std::make_shared<NTFSExplorer>(vol);

DWORD cluster_size = ((PBOOT_SECTOR_NTFS)explorer->reader()->boot_record())->bytePerSector * ((PBOOT_SECTOR_NTFS)explorer->reader()->boot_record())->sectorPerCluster;
DWORD record_size = ((PBOOT_SECTOR_NTFS)explorer->reader()->boot_record())->clusterPerRecord >= 0 ? ((PBOOT_SECTOR_NTFS)explorer->reader()->boot_record())->clusterPerRecord * cluster_size : 1 << -((PBOOT_SECTOR_NTFS)explorer->reader()->boot_record())->clusterPerRecord;
DWORD cluster_size = explorer->reader()->sizes.cluster_size;
DWORD record_size = explorer->reader()->sizes.record_size;

std::shared_ptr<MFTRecord> record = explorer->mft()->record_from_number(0);
ULONG64 total_size = record->datasize();
Expand Down

0 comments on commit 958ae00

Please sign in to comment.