Classes | |
| struct | StreamInfo |
Public Member Functions | |
| ExfatRecovery (DiskReader &reader) | |
| bool | recover (uint64_t volume_offset, const fs::path &out_root, std::vector< RecoveredFileRecord > &recovered, std::vector< std::string > &logs, std::string &error) |
Private Member Functions | |
| bool | load_vbr (uint64_t volume_offset) |
| bool | cluster_allocated (uint32_t cluster) const |
| bool | load_allocation_bitmap () |
| uint64_t | cluster_to_offset (uint32_t cluster) const |
| bool | next_cluster (uint32_t current, uint32_t &next) |
| std::vector< uint32_t > | cluster_chain (uint32_t start, bool no_fat_chain, uint64_t data_length, size_t hard_limit=1<< 20) |
| bool | read_cluster (uint32_t cluster, std::vector< unsigned char > &out) |
| bool | export_stream (const StreamInfo &info, const fs::path &out_dir, std::vector< RecoveredFileRecord > &recovered, std::vector< std::string > &logs, std::string &error) |
| bool | export_stream_deleted (const StreamInfo &info, const fs::path &out_dir, std::vector< RecoveredFileRecord > &recovered, std::vector< std::string > &logs, std::string &error) |
| bool | recover_directory (uint32_t start_cluster, const fs::path &out_dir, std::vector< RecoveredFileRecord > &recovered, std::vector< std::string > &logs, std::string &error, std::set< uint32_t > &dir_guard, int depth) |
Static Private Member Functions | |
| static std::string | decode_utf16_name (const std::vector< unsigned char > &bytes) |
Private Attributes | |
| DiskReader & | reader_ |
| uint64_t | volume_offset_ {0} |
| uint64_t | partition_offset_sectors_ {0} |
| uint64_t | volume_length_sectors_ {0} |
| uint32_t | fat_offset_sectors_ {0} |
| uint32_t | fat_length_sectors_ {0} |
| uint32_t | cluster_heap_offset_sectors_ {0} |
| uint32_t | cluster_count_ {0} |
| uint32_t | root_dir_cluster_ {2} |
| uint32_t | serial_number_ {0} |
| uint8_t | bytes_per_sector_shift_ {0} |
| uint8_t | sectors_per_cluster_shift_ {0} |
| uint64_t | bytes_per_sector_ {0} |
| uint64_t | sectors_per_cluster_ {0} |
| uint64_t | cluster_size_ {0} |
| uint64_t | fat_offset_bytes_ {0} |
| uint64_t | cluster_heap_offset_bytes_ {0} |
| uint32_t | allocation_bitmap_cluster_ {0} |
| uint64_t | allocation_bitmap_length_ {0} |
| std::vector< unsigned char > | allocation_bitmap_ |
Definition at line 460 of file filesystem_recovery.cpp.
|
inlineexplicit |
Definition at line 462 of file filesystem_recovery.cpp.
References reader_.
|
inlineprivate |
Definition at line 541 of file filesystem_recovery.cpp.
References allocation_bitmap_, and cluster_count_.
Referenced by cluster_chain().
|
inlineprivate |
Definition at line 596 of file filesystem_recovery.cpp.
References cluster_allocated(), cluster_count_, cluster_size_, and next_cluster().
Referenced by export_stream(), load_allocation_bitmap(), and recover_directory().
|
inlineprivate |
Definition at line 584 of file filesystem_recovery.cpp.
References cluster_heap_offset_bytes_, and cluster_size_.
Referenced by export_stream(), export_stream_deleted(), load_allocation_bitmap(), and read_cluster().
|
inlinestaticprivate |
Definition at line 629 of file filesystem_recovery.cpp.
References text_utils::utf16le_to_utf8().
Referenced by recover_directory().
|
inlineprivate |
Definition at line 635 of file filesystem_recovery.cpp.
References cluster_chain(), cluster_size_, cluster_to_offset(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::data_length, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::first_cluster, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::is_directory, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::name, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::no_fat_chain, reader_, anonymous_namespace{filesystem_recovery.cpp}::sanitize_path_component(), trs(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::valid, and anonymous_namespace{filesystem_recovery.cpp}::write_data_to_file().
Referenced by recover_directory().
|
inlineprivate |
Definition at line 671 of file filesystem_recovery.cpp.
References cluster_count_, cluster_size_, cluster_to_offset(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::data_length, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::first_cluster, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::is_directory, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::name, reader_, anonymous_namespace{filesystem_recovery.cpp}::sanitize_path_component(), trs(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::valid, and anonymous_namespace{filesystem_recovery.cpp}::write_data_to_file().
Referenced by recover_directory().
|
inlineprivate |
Definition at line 551 of file filesystem_recovery.cpp.
References allocation_bitmap_, allocation_bitmap_cluster_, allocation_bitmap_length_, cluster_chain(), cluster_size_, cluster_to_offset(), anonymous_namespace{filesystem_recovery.cpp}::le32(), anonymous_namespace{filesystem_recovery.cpp}::le64(), read_cluster(), reader_, root_dir_cluster_, serial_number_, and anonymous_namespace{filesystem_recovery.cpp}::write_data_to_file().
Referenced by recover().
|
inlineprivate |
Definition at line 515 of file filesystem_recovery.cpp.
References allocation_bitmap_, allocation_bitmap_cluster_, allocation_bitmap_length_, bytes_per_sector_, bytes_per_sector_shift_, cluster_count_, cluster_heap_offset_bytes_, cluster_heap_offset_sectors_, cluster_size_, fat_length_sectors_, fat_offset_bytes_, fat_offset_sectors_, anonymous_namespace{filesystem_recovery.cpp}::le32(), anonymous_namespace{filesystem_recovery.cpp}::le64(), partition_offset_sectors_, DiskReader::read_at(), reader_, root_dir_cluster_, sectors_per_cluster_, sectors_per_cluster_shift_, serial_number_, volume_length_sectors_, and volume_offset_.
Referenced by recover().
|
inlineprivate |
Definition at line 588 of file filesystem_recovery.cpp.
References fat_offset_bytes_, anonymous_namespace{filesystem_recovery.cpp}::le32(), DiskReader::read_at(), and reader_.
Referenced by cluster_chain().
|
inlineprivate |
Definition at line 624 of file filesystem_recovery.cpp.
References cluster_size_, cluster_to_offset(), DiskReader::read_at(), and reader_.
Referenced by load_allocation_bitmap(), and recover_directory().
|
inline |
Definition at line 464 of file filesystem_recovery.cpp.
References allocation_bitmap_length_, load_allocation_bitmap(), load_vbr(), recover_directory(), root_dir_cluster_, and trs().
|
inlineprivate |
Definition at line 718 of file filesystem_recovery.cpp.
References cluster_chain(), cluster_size_, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::data_length, decode_utf16_name(), export_stream(), export_stream_deleted(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::first_cluster, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::is_deleted, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::is_directory, anonymous_namespace{filesystem_recovery.cpp}::le32(), anonymous_namespace{filesystem_recovery.cpp}::le64(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::name, anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::no_fat_chain, read_cluster(), recover_directory(), anonymous_namespace{filesystem_recovery.cpp}::sanitize_path_component(), and anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::StreamInfo::valid.
Referenced by recover(), and recover_directory().
|
private |
Definition at line 513 of file filesystem_recovery.cpp.
Referenced by cluster_allocated(), load_allocation_bitmap(), and load_vbr().
|
private |
Definition at line 511 of file filesystem_recovery.cpp.
Referenced by load_allocation_bitmap(), and load_vbr().
|
private |
Definition at line 512 of file filesystem_recovery.cpp.
Referenced by load_allocation_bitmap(), load_vbr(), and recover().
|
private |
Definition at line 506 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 504 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 501 of file filesystem_recovery.cpp.
Referenced by cluster_allocated(), cluster_chain(), export_stream_deleted(), and load_vbr().
|
private |
Definition at line 510 of file filesystem_recovery.cpp.
Referenced by cluster_to_offset(), and load_vbr().
|
private |
Definition at line 500 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 508 of file filesystem_recovery.cpp.
Referenced by cluster_chain(), cluster_to_offset(), export_stream(), export_stream_deleted(), load_allocation_bitmap(), load_vbr(), read_cluster(), and recover_directory().
|
private |
Definition at line 499 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 509 of file filesystem_recovery.cpp.
Referenced by load_vbr(), and next_cluster().
|
private |
Definition at line 498 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 496 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 494 of file filesystem_recovery.cpp.
Referenced by ExfatRecovery(), export_stream(), export_stream_deleted(), load_allocation_bitmap(), load_vbr(), next_cluster(), and read_cluster().
|
private |
Definition at line 502 of file filesystem_recovery.cpp.
Referenced by load_allocation_bitmap(), load_vbr(), and recover().
|
private |
Definition at line 507 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 505 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 503 of file filesystem_recovery.cpp.
Referenced by load_allocation_bitmap(), and load_vbr().
|
private |
Definition at line 497 of file filesystem_recovery.cpp.
Referenced by load_vbr().
|
private |
Definition at line 495 of file filesystem_recovery.cpp.
Referenced by load_vbr().