├── .codecov.yml ├── .github └── workflows │ ├── build.yml │ ├── build_freebsd.yml │ ├── build_ossfuzz.yml │ ├── build_shared.yml │ └── build_wheel.yml ├── .gitignore ├── AUTHORS ├── COPYING ├── COPYING.LESSER ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── acinclude.m4 ├── appveyor.yml ├── autogen.ps1 ├── autogen.sh ├── build.ps1 ├── builddokan.ps1 ├── common ├── Makefile.am ├── byte_stream.h ├── common.h ├── config_borlandc.h ├── config_msc.h ├── config_winapi.h ├── file_stream.h ├── memory.h ├── narrow_string.h ├── system_string.h ├── types.h.in └── wide_string.h ├── configure.ac ├── documentation └── Apple File System (APFS).asciidoc ├── dpkg ├── changelog.in ├── compat ├── control ├── copyright ├── libfsapfs-dev.install ├── libfsapfs-python3.install ├── libfsapfs-tools.install ├── libfsapfs.install ├── rules └── source │ └── format ├── fsapfstools ├── Makefile.am ├── bodyfile.c ├── bodyfile.h ├── digest_hash.c ├── digest_hash.h ├── fsapfsinfo.c ├── fsapfsmount.c ├── fsapfstools_getopt.c ├── fsapfstools_getopt.h ├── fsapfstools_i18n.h ├── fsapfstools_libbfio.h ├── fsapfstools_libcdata.h ├── fsapfstools_libcerror.h ├── fsapfstools_libclocale.h ├── fsapfstools_libcnotify.h ├── fsapfstools_libcpath.h ├── fsapfstools_libfdatetime.h ├── fsapfstools_libfguid.h ├── fsapfstools_libfsapfs.h ├── fsapfstools_libfsrefs.h ├── fsapfstools_libhmac.h ├── fsapfstools_libuna.h ├── fsapfstools_output.c ├── fsapfstools_output.h ├── fsapfstools_signal.c ├── fsapfstools_signal.h ├── fsapfstools_unused.h ├── info_handle.c ├── info_handle.h ├── mount_dokan.c ├── mount_dokan.h ├── mount_file_entry.c ├── mount_file_entry.h ├── mount_file_system.c ├── mount_file_system.h ├── mount_fuse.c ├── mount_fuse.h ├── mount_handle.c ├── mount_handle.h ├── mount_path_string.c ├── mount_path_string.h ├── path_string.c └── path_string.h ├── include ├── Makefile.am ├── libfsapfs.h.in └── libfsapfs │ ├── codepage.h │ ├── definitions.h.in │ ├── error.h │ ├── extern.h │ ├── features.h.in │ └── types.h.in ├── libfsapfs.ini ├── libfsapfs.pc.in ├── libfsapfs.spec.in ├── libfsapfs ├── Makefile.am ├── fsapfs_btree.h ├── fsapfs_checkpoint_map.h ├── fsapfs_chunk_information_block.h ├── fsapfs_compressed_data.h ├── fsapfs_container_reaper.h ├── fsapfs_container_superblock.h ├── fsapfs_extent_reference_tree.h ├── fsapfs_file_system.h ├── fsapfs_fusion_middle_tree.h ├── fsapfs_key_bag.h ├── fsapfs_object.h ├── fsapfs_object_map.h ├── fsapfs_snapshot_metadata.h ├── fsapfs_space_manager.h ├── fsapfs_volume_superblock.h ├── libfsapfs.c ├── libfsapfs.rc.in ├── libfsapfs_attribute_values.c ├── libfsapfs_attribute_values.h ├── libfsapfs_attributes.c ├── libfsapfs_attributes.h ├── libfsapfs_bit_stream.c ├── libfsapfs_bit_stream.h ├── libfsapfs_btree_entry.c ├── libfsapfs_btree_entry.h ├── libfsapfs_btree_footer.c ├── libfsapfs_btree_footer.h ├── libfsapfs_btree_node.c ├── libfsapfs_btree_node.h ├── libfsapfs_btree_node_header.c ├── libfsapfs_btree_node_header.h ├── libfsapfs_buffer_data_handle.c ├── libfsapfs_buffer_data_handle.h ├── libfsapfs_checkpoint_map.c ├── libfsapfs_checkpoint_map.h ├── libfsapfs_checkpoint_map_entry.c ├── libfsapfs_checkpoint_map_entry.h ├── libfsapfs_checksum.c ├── libfsapfs_checksum.h ├── libfsapfs_chunk_information_block.c ├── libfsapfs_chunk_information_block.h ├── libfsapfs_compressed_data_handle.c ├── libfsapfs_compressed_data_handle.h ├── libfsapfs_compressed_data_header.c ├── libfsapfs_compressed_data_header.h ├── libfsapfs_compression.c ├── libfsapfs_compression.h ├── libfsapfs_container.c ├── libfsapfs_container.h ├── libfsapfs_container_data_handle.c ├── libfsapfs_container_data_handle.h ├── libfsapfs_container_key_bag.c ├── libfsapfs_container_key_bag.h ├── libfsapfs_container_reaper.c ├── libfsapfs_container_reaper.h ├── libfsapfs_container_superblock.c ├── libfsapfs_container_superblock.h ├── libfsapfs_data_block.c ├── libfsapfs_data_block.h ├── libfsapfs_data_block_data_handle.c ├── libfsapfs_data_block_data_handle.h ├── libfsapfs_data_block_vector.c ├── libfsapfs_data_block_vector.h ├── libfsapfs_data_stream.c ├── libfsapfs_data_stream.h ├── libfsapfs_debug.c ├── libfsapfs_debug.h ├── libfsapfs_definitions.h.in ├── libfsapfs_deflate.c ├── libfsapfs_deflate.h ├── libfsapfs_directory_record.c ├── libfsapfs_directory_record.h ├── libfsapfs_encryption_context.c ├── libfsapfs_encryption_context.h ├── libfsapfs_error.c ├── libfsapfs_error.h ├── libfsapfs_extended_attribute.c ├── libfsapfs_extended_attribute.h ├── libfsapfs_extent_reference_tree.c ├── libfsapfs_extent_reference_tree.h ├── libfsapfs_extern.h ├── libfsapfs_file_entry.c ├── libfsapfs_file_entry.h ├── libfsapfs_file_extent.c ├── libfsapfs_file_extent.h ├── libfsapfs_file_system.c ├── libfsapfs_file_system.h ├── libfsapfs_file_system_btree.c ├── libfsapfs_file_system_btree.h ├── libfsapfs_file_system_data_handle.c ├── libfsapfs_file_system_data_handle.h ├── libfsapfs_fusion_middle_tree.c ├── libfsapfs_fusion_middle_tree.h ├── libfsapfs_huffman_tree.c ├── libfsapfs_huffman_tree.h ├── libfsapfs_inode.c ├── libfsapfs_inode.h ├── libfsapfs_io_handle.c ├── libfsapfs_io_handle.h ├── libfsapfs_key_bag_entry.c ├── libfsapfs_key_bag_entry.h ├── libfsapfs_key_bag_header.c ├── libfsapfs_key_bag_header.h ├── libfsapfs_key_encrypted_key.c ├── libfsapfs_key_encrypted_key.h ├── libfsapfs_libbfio.h ├── libfsapfs_libcaes.h ├── libfsapfs_libcdata.h ├── libfsapfs_libcerror.h ├── libfsapfs_libclocale.h ├── libfsapfs_libcnotify.h ├── libfsapfs_libcthreads.h ├── libfsapfs_libfcache.h ├── libfsapfs_libfdata.h ├── libfsapfs_libfdatetime.h ├── libfsapfs_libfguid.h ├── libfsapfs_libfmos.h ├── libfsapfs_libhmac.h ├── libfsapfs_libuna.h ├── libfsapfs_name.c ├── libfsapfs_name.h ├── libfsapfs_name_hash.c ├── libfsapfs_name_hash.h ├── libfsapfs_notify.c ├── libfsapfs_notify.h ├── libfsapfs_object.c ├── libfsapfs_object.h ├── libfsapfs_object_map.c ├── libfsapfs_object_map.h ├── libfsapfs_object_map_btree.c ├── libfsapfs_object_map_btree.h ├── libfsapfs_object_map_descriptor.c ├── libfsapfs_object_map_descriptor.h ├── libfsapfs_password.c ├── libfsapfs_password.h ├── libfsapfs_profiler.c ├── libfsapfs_profiler.h ├── libfsapfs_snapshot.c ├── libfsapfs_snapshot.h ├── libfsapfs_snapshot_metadata.c ├── libfsapfs_snapshot_metadata.h ├── libfsapfs_snapshot_metadata_tree.c ├── libfsapfs_snapshot_metadata_tree.h ├── libfsapfs_space_manager.c ├── libfsapfs_space_manager.h ├── libfsapfs_support.c ├── libfsapfs_support.h ├── libfsapfs_types.h ├── libfsapfs_unused.h ├── libfsapfs_volume.c ├── libfsapfs_volume.h ├── libfsapfs_volume_key_bag.c ├── libfsapfs_volume_key_bag.h ├── libfsapfs_volume_superblock.c └── libfsapfs_volume_superblock.h ├── m4 ├── common.m4 ├── libbfio.m4 ├── libcaes.m4 ├── libcdata.m4 ├── libcerror.m4 ├── libcfile.m4 ├── libclocale.m4 ├── libcnotify.m4 ├── libcpath.m4 ├── libcrypto.m4 ├── libcsplit.m4 ├── libcthreads.m4 ├── libfcache.m4 ├── libfdata.m4 ├── libfdatetime.m4 ├── libfguid.m4 ├── libfmos.m4 ├── libfuse.m4 ├── libhmac.m4 ├── libuna.m4 ├── pthread.m4 ├── python.m4 ├── tests.m4 ├── types.m4 └── zlib.m4 ├── manuals ├── Makefile.am ├── fsapfsinfo.1 ├── fsapfsmount.1 └── libfsapfs.3 ├── msvscpp ├── Makefile.am ├── fsapfs_test_bit_stream │ └── fsapfs_test_bit_stream.vcproj ├── fsapfs_test_btree_entry │ └── fsapfs_test_btree_entry.vcproj ├── fsapfs_test_btree_footer │ └── fsapfs_test_btree_footer.vcproj ├── fsapfs_test_btree_node │ └── fsapfs_test_btree_node.vcproj ├── fsapfs_test_btree_node_header │ └── fsapfs_test_btree_node_header.vcproj ├── fsapfs_test_buffer_data_handle │ └── fsapfs_test_buffer_data_handle.vcproj ├── fsapfs_test_checkpoint_map │ └── fsapfs_test_checkpoint_map.vcproj ├── fsapfs_test_checkpoint_map_entry │ └── fsapfs_test_checkpoint_map_entry.vcproj ├── fsapfs_test_checksum │ └── fsapfs_test_checksum.vcproj ├── fsapfs_test_chunk_information_block │ └── fsapfs_test_chunk_information_block.vcproj ├── fsapfs_test_compressed_data_handle │ └── fsapfs_test_compressed_data_handle.vcproj ├── fsapfs_test_compression │ └── fsapfs_test_compression.vcproj ├── fsapfs_test_container │ └── fsapfs_test_container.vcproj ├── fsapfs_test_container_data_handle │ └── fsapfs_test_container_data_handle.vcproj ├── fsapfs_test_container_key_bag │ └── fsapfs_test_container_key_bag.vcproj ├── fsapfs_test_container_reaper │ └── fsapfs_test_container_reaper.vcproj ├── fsapfs_test_container_superblock │ └── fsapfs_test_container_superblock.vcproj ├── fsapfs_test_data_block │ └── fsapfs_test_data_block.vcproj ├── fsapfs_test_data_block_data_handle │ └── fsapfs_test_data_block_data_handle.vcproj ├── fsapfs_test_data_block_vector │ └── fsapfs_test_data_block_vector.vcproj ├── fsapfs_test_data_stream │ └── fsapfs_test_data_stream.vcproj ├── fsapfs_test_deflate │ └── fsapfs_test_deflate.vcproj ├── fsapfs_test_directory_record │ └── fsapfs_test_directory_record.vcproj ├── fsapfs_test_encryption_context │ └── fsapfs_test_encryption_context.vcproj ├── fsapfs_test_error │ └── fsapfs_test_error.vcproj ├── fsapfs_test_extended_attribute │ └── fsapfs_test_extended_attribute.vcproj ├── fsapfs_test_extent_reference_tree │ └── fsapfs_test_extent_reference_tree.vcproj ├── fsapfs_test_file_extent │ └── fsapfs_test_file_extent.vcproj ├── fsapfs_test_file_system │ └── fsapfs_test_file_system.vcproj ├── fsapfs_test_file_system_btree │ └── fsapfs_test_file_system_btree.vcproj ├── fsapfs_test_file_system_data_handle │ └── fsapfs_test_file_system_data_handle.vcproj ├── fsapfs_test_fusion_middle_tree │ └── fsapfs_test_fusion_middle_tree.vcproj ├── fsapfs_test_huffman_tree │ └── fsapfs_test_huffman_tree.vcproj ├── fsapfs_test_inode │ └── fsapfs_test_inode.vcproj ├── fsapfs_test_io_handle │ └── fsapfs_test_io_handle.vcproj ├── fsapfs_test_key_bag_entry │ └── fsapfs_test_key_bag_entry.vcproj ├── fsapfs_test_key_bag_header │ └── fsapfs_test_key_bag_header.vcproj ├── fsapfs_test_key_encrypted_key │ └── fsapfs_test_key_encrypted_key.vcproj ├── fsapfs_test_name │ └── fsapfs_test_name.vcproj ├── fsapfs_test_name_hash │ └── fsapfs_test_name_hash.vcproj ├── fsapfs_test_notify │ └── fsapfs_test_notify.vcproj ├── fsapfs_test_object │ └── fsapfs_test_object.vcproj ├── fsapfs_test_object_map │ └── fsapfs_test_object_map.vcproj ├── fsapfs_test_object_map_btree │ └── fsapfs_test_object_map_btree.vcproj ├── fsapfs_test_object_map_descriptor │ └── fsapfs_test_object_map_descriptor.vcproj ├── fsapfs_test_profiler │ └── fsapfs_test_profiler.vcproj ├── fsapfs_test_snapshot │ └── fsapfs_test_snapshot.vcproj ├── fsapfs_test_snapshot_metadata │ └── fsapfs_test_snapshot_metadata.vcproj ├── fsapfs_test_snapshot_metadata_tree │ └── fsapfs_test_snapshot_metadata_tree.vcproj ├── fsapfs_test_space_manager │ └── fsapfs_test_space_manager.vcproj ├── fsapfs_test_support │ └── fsapfs_test_support.vcproj ├── fsapfs_test_tools_bodyfile │ └── fsapfs_test_tools_bodyfile.vcproj ├── fsapfs_test_tools_digest_hash │ └── fsapfs_test_tools_digest_hash.vcproj ├── fsapfs_test_tools_info_handle │ └── fsapfs_test_tools_info_handle.vcproj ├── fsapfs_test_tools_mount_path_string │ └── fsapfs_test_tools_mount_path_string.vcproj ├── fsapfs_test_tools_output │ └── fsapfs_test_tools_output.vcproj ├── fsapfs_test_tools_path_string │ └── fsapfs_test_tools_path_string.vcproj ├── fsapfs_test_tools_signal │ └── fsapfs_test_tools_signal.vcproj ├── fsapfs_test_volume │ └── fsapfs_test_volume.vcproj ├── fsapfs_test_volume_key_bag │ └── fsapfs_test_volume_key_bag.vcproj ├── fsapfs_test_volume_superblock │ └── fsapfs_test_volume_superblock.vcproj ├── fsapfsinfo │ └── fsapfsinfo.vcproj ├── fsapfsmount │ └── fsapfsmount.vcproj ├── libbfio │ └── libbfio.vcproj ├── libcaes │ └── libcaes.vcproj ├── libcdata │ └── libcdata.vcproj ├── libcerror │ └── libcerror.vcproj ├── libcfile │ └── libcfile.vcproj ├── libclocale │ └── libclocale.vcproj ├── libcnotify │ └── libcnotify.vcproj ├── libcpath │ └── libcpath.vcproj ├── libcsplit │ └── libcsplit.vcproj ├── libcthreads │ └── libcthreads.vcproj ├── libfcache │ └── libfcache.vcproj ├── libfdata │ └── libfdata.vcproj ├── libfdatetime │ └── libfdatetime.vcproj ├── libfguid │ └── libfguid.vcproj ├── libfmos │ └── libfmos.vcproj ├── libfsapfs.sln ├── libfsapfs │ └── libfsapfs.vcproj ├── libhmac │ └── libhmac.vcproj ├── libuna │ └── libuna.vcproj ├── pyfsapfs │ └── pyfsapfs.vcproj └── zlib │ └── zlib.vcproj ├── ossfuzz ├── Makefile.am ├── container_fuzzer.cc ├── extended_attribute_fuzzer.cc ├── file_entry_fuzzer.cc ├── ossfuzz_libbfio.h ├── ossfuzz_libfsapfs.h └── volume_fuzzer.cc ├── po ├── ChangeLog ├── Makevars.in └── POTFILES.in ├── pyfsapfs ├── Makefile.am ├── pyfsapfs.c ├── pyfsapfs.h ├── pyfsapfs_container.c ├── pyfsapfs_container.h ├── pyfsapfs_datetime.c ├── pyfsapfs_datetime.h ├── pyfsapfs_error.c ├── pyfsapfs_error.h ├── pyfsapfs_extended_attribute.c ├── pyfsapfs_extended_attribute.h ├── pyfsapfs_extended_attributes.c ├── pyfsapfs_extended_attributes.h ├── pyfsapfs_file_entries.c ├── pyfsapfs_file_entries.h ├── pyfsapfs_file_entry.c ├── pyfsapfs_file_entry.h ├── pyfsapfs_file_object_io_handle.c ├── pyfsapfs_file_object_io_handle.h ├── pyfsapfs_guid.c ├── pyfsapfs_guid.h ├── pyfsapfs_integer.c ├── pyfsapfs_integer.h ├── pyfsapfs_libbfio.h ├── pyfsapfs_libcerror.h ├── pyfsapfs_libclocale.h ├── pyfsapfs_libfguid.h ├── pyfsapfs_libfsapfs.h ├── pyfsapfs_python.h ├── pyfsapfs_unused.h ├── pyfsapfs_volume.c ├── pyfsapfs_volume.h ├── pyfsapfs_volumes.c └── pyfsapfs_volumes.h ├── pyproject.toml ├── runtests.ps1 ├── runtests.sh ├── setup.cfg.in ├── setup.py ├── syncdokan.ps1 ├── synclibs.ps1 ├── synclibs.sh ├── synctestdata.ps1 ├── synctestdata.sh ├── synczlib.ps1 ├── tests ├── Makefile.am ├── build.sh ├── data │ ├── btree_footer.1 │ ├── btree_header.1 │ ├── btree_node.1 │ ├── checkpoint_map.1 │ ├── checkpoint_map_entry.1 │ ├── chunk_information_block.1 │ ├── container_object_map.1 │ ├── container_object_map_btree.1 │ ├── container_reaper.1 │ ├── container_space_manager.1 │ ├── container_superblock.1 │ ├── file_system_btree.1 │ ├── inode.1 │ ├── key_bag_entry.1 │ ├── key_bag_header.1 │ ├── volume_object_map.1 │ └── volume_superblock.1 ├── fsapfs_test_bit_stream.c ├── fsapfs_test_btree_entry.c ├── fsapfs_test_btree_footer.c ├── fsapfs_test_btree_node.c ├── fsapfs_test_btree_node_header.c ├── fsapfs_test_buffer_data_handle.c ├── fsapfs_test_checkpoint_map.c ├── fsapfs_test_checkpoint_map_entry.c ├── fsapfs_test_checksum.c ├── fsapfs_test_chunk_information_block.c ├── fsapfs_test_compressed_data_handle.c ├── fsapfs_test_compression.c ├── fsapfs_test_container.c ├── fsapfs_test_container_data_handle.c ├── fsapfs_test_container_key_bag.c ├── fsapfs_test_container_reaper.c ├── fsapfs_test_container_superblock.c ├── fsapfs_test_data_block.c ├── fsapfs_test_data_block_data_handle.c ├── fsapfs_test_data_block_vector.c ├── fsapfs_test_data_stream.c ├── fsapfs_test_deflate.c ├── fsapfs_test_directory_record.c ├── fsapfs_test_encryption_context.c ├── fsapfs_test_error.c ├── fsapfs_test_extended_attribute.c ├── fsapfs_test_extent_reference_tree.c ├── fsapfs_test_file_entry.c ├── fsapfs_test_file_extent.c ├── fsapfs_test_file_system.c ├── fsapfs_test_file_system_btree.c ├── fsapfs_test_file_system_data_handle.c ├── fsapfs_test_functions.c ├── fsapfs_test_functions.h ├── fsapfs_test_fusion_middle_tree.c ├── fsapfs_test_getopt.c ├── fsapfs_test_getopt.h ├── fsapfs_test_huffman_tree.c ├── fsapfs_test_inode.c ├── fsapfs_test_io_handle.c ├── fsapfs_test_key_bag_entry.c ├── fsapfs_test_key_bag_header.c ├── fsapfs_test_key_encrypted_key.c ├── fsapfs_test_libbfio.h ├── fsapfs_test_libcdata.h ├── fsapfs_test_libcerror.h ├── fsapfs_test_libclocale.h ├── fsapfs_test_libcnotify.h ├── fsapfs_test_libcpath.h ├── fsapfs_test_libfdata.h ├── fsapfs_test_libfsapfs.h ├── fsapfs_test_libuna.h ├── fsapfs_test_macros.h ├── fsapfs_test_memory.c ├── fsapfs_test_memory.h ├── fsapfs_test_name.c ├── fsapfs_test_name_hash.c ├── fsapfs_test_notify.c ├── fsapfs_test_object.c ├── fsapfs_test_object_map.c ├── fsapfs_test_object_map_btree.c ├── fsapfs_test_object_map_descriptor.c ├── fsapfs_test_profiler.c ├── fsapfs_test_rwlock.c ├── fsapfs_test_rwlock.h ├── fsapfs_test_snapshot.c ├── fsapfs_test_snapshot_metadata.c ├── fsapfs_test_snapshot_metadata_tree.c ├── fsapfs_test_space_manager.c ├── fsapfs_test_support.c ├── fsapfs_test_tools_bodyfile.c ├── fsapfs_test_tools_digest_hash.c ├── fsapfs_test_tools_info_handle.c ├── fsapfs_test_tools_mount_path_string.c ├── fsapfs_test_tools_output.c ├── fsapfs_test_tools_path_string.c ├── fsapfs_test_tools_signal.c ├── fsapfs_test_types.h ├── fsapfs_test_unicode_case_folding_mappings.h ├── fsapfs_test_unicode_decomposition_mappings.h ├── fsapfs_test_unused.h ├── fsapfs_test_volume.c ├── fsapfs_test_volume_key_bag.c ├── fsapfs_test_volume_superblock.c ├── lsan.suppressions ├── pkgbuild.sh ├── pyfsapfs_test_container.py ├── pyfsapfs_test_support.py ├── pyfsapfs_test_volume.py ├── runtests.py ├── runtests.sh ├── syncsharedlibs.sh ├── test_fsapfsinfo.ps1 ├── test_fsapfsinfo.sh ├── test_fsapfsinfo_bodyfile.ps1 ├── test_fsapfsinfo_bodyfile.sh ├── test_library.ps1 ├── test_library.sh ├── test_manpage.sh ├── test_python_module.sh ├── test_runner.sh ├── test_tools.ps1 └── test_tools.sh └── tox.ini /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 2 3 | round: down 4 | range: 70...100 5 | status: 6 | project: true 7 | patch: true 8 | changes: false 9 | ignore: 10 | - "libbfio/*" 11 | - "libcaes/*" 12 | - "libcdata/*" 13 | - "libcerror/*" 14 | - "libcfile/*" 15 | - "libclocale/*" 16 | - "libcnotify/*" 17 | - "libcpath/*" 18 | - "libcsplit/*" 19 | - "libcthreads/*" 20 | - "libfcache/*" 21 | - "libfdata/*" 22 | - "libfdatetime/*" 23 | - "libfguid/*" 24 | - "libfmos/*" 25 | - "libhmac/*" 26 | - "libuna/*" 27 | - "tests/*" 28 | -------------------------------------------------------------------------------- /.github/workflows/build_freebsd.yml: -------------------------------------------------------------------------------- 1 | # Build from source on FreeBSD. 2 | name: build_freebsd 3 | on: [push] 4 | permissions: read-all 5 | jobs: 6 | build_freebsd: 7 | runs-on: ubuntu-22.04 8 | steps: 9 | - uses: actions/checkout@v4 10 | - name: Building from source 11 | id: build_freebsd 12 | uses: vmactions/freebsd-vm@v1 13 | with: 14 | usesh: true 15 | mem: 4096 16 | # Note that the test scripts require bash 17 | prepare: | 18 | pkg install -y autoconf automake bash fusefs-libs gettext git libtool openssl pkgconf 19 | run: | 20 | tests/build.sh 21 | tests/runtests.sh 22 | -------------------------------------------------------------------------------- /.github/workflows/build_ossfuzz.yml: -------------------------------------------------------------------------------- 1 | # Build OSSFuzz fuzz targets from source. 2 | name: build_ossfuzz 3 | on: 4 | push: 5 | branches: [main] 6 | permissions: read-all 7 | jobs: 8 | build_ossfuzz: 9 | runs-on: ubuntu-22.04 10 | strategy: 11 | matrix: 12 | include: 13 | - architecture: 'x64' 14 | compiler: 'gcc' 15 | configure_options: '' 16 | steps: 17 | - name: Install build dependencies 18 | run: | 19 | sudo apt-get -y install git 20 | - uses: actions/checkout@v4 21 | with: 22 | repository: google/oss-fuzz 23 | path: oss-fuzz 24 | - name: Build OSSFuzz fuzz targets 25 | working-directory: oss-fuzz 26 | run: | 27 | mkdir -p projects/libfsapfs 28 | cp projects/libyal/build.sh projects/libfsapfs/ 29 | cp projects/libyal/project.yaml projects/libfsapfs/ 30 | head -n 20 projects/libyal/Dockerfile > projects/libfsapfs/Dockerfile 31 | echo "RUN git clone --depth 1 https://github.com/libyal/libfsapfs.git libfsapfs" >> projects/libfsapfs/Dockerfile 32 | tail -n 3 projects/libyal/Dockerfile >> projects/libfsapfs/Dockerfile 33 | python3 infra/helper.py build_image --pull libfsapfs 34 | python3 infra/helper.py build_fuzzers --sanitizer address libfsapfs 35 | python3 infra/helper.py check_build libfsapfs 36 | -------------------------------------------------------------------------------- /.github/workflows/build_shared.yml: -------------------------------------------------------------------------------- 1 | # Build from source with libyal dependencies as shared libraries. 2 | name: build_shared 3 | on: 4 | push: 5 | branches: [main] 6 | permissions: read-all 7 | jobs: 8 | build_shared_ubuntu: 9 | runs-on: ubuntu-22.04 10 | strategy: 11 | matrix: 12 | include: 13 | - architecture: 'x64' 14 | compiler: 'gcc' 15 | configure_options: '--enable-wide-character-type' 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Install build dependencies 19 | run: | 20 | sudo apt-get -y install autoconf automake autopoint build-essential git libfuse3-dev libssl-dev libtool pkg-config zlib1g-dev 21 | - name: Download test data 22 | run: | 23 | if test -x "synctestdata.sh"; then ./synctestdata.sh; fi 24 | - name: Prepare shared libraries 25 | run: | 26 | tests/syncsharedlibs.sh --use-head 27 | - name: Building from source 28 | env: 29 | CC: ${{ matrix.compiler }} 30 | run: | 31 | tests/build.sh ${{ matrix.configure_options }} 32 | - name: Run tests 33 | run: | 34 | tests/runtests.sh 35 | -------------------------------------------------------------------------------- /.github/workflows/build_wheel.yml: -------------------------------------------------------------------------------- 1 | # Build wheel from source using tox. 2 | name: build_wheel 3 | on: [push, pull_request] 4 | permissions: read-all 5 | jobs: 6 | build_wheel: 7 | runs-on: ubuntu-22.04 8 | strategy: 9 | matrix: 10 | include: 11 | - python-version: '3.7' 12 | toxenv: 'py37' 13 | - python-version: '3.8' 14 | toxenv: 'py38' 15 | - python-version: '3.9' 16 | toxenv: 'py39' 17 | - python-version: '3.10' 18 | toxenv: 'py310' 19 | - python-version: '3.11' 20 | toxenv: 'py311' 21 | - python-version: '3.12' 22 | toxenv: 'py312' 23 | steps: 24 | - uses: actions/checkout@v4 25 | - name: Install build dependencies 26 | run: | 27 | sudo add-apt-repository universe && 28 | sudo add-apt-repository -y ppa:deadsnakes/ppa && 29 | sudo apt-get update && 30 | sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools 31 | - name: Install tox 32 | run: | 33 | python3 -m pip install tox 34 | - name: Download test data 35 | run: | 36 | if test -x "synctestdata.sh"; then ./synctestdata.sh; fi 37 | - name: Prepare build 38 | run: | 39 | ./synclibs.sh --use-head && ./autogen.sh && ./configure && make sources >/dev/null 40 | - name: Build Python wheel 41 | run: | 42 | tox -e${{ matrix.toxenv }} 43 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Acknowledgements: libfsapfs 2 | 3 | Copyright (C) 2018-2024, Joachim Metz 4 | 5 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | libfsapfs is a library to access the Apple File System (APFS). 2 | 3 | Project information: 4 | 5 | * Status: experimental 6 | * Licence: LGPLv3+ 7 | 8 | Read-only supported APFS formats: 9 | 10 | * version 2 11 | 12 | Supported APFS format features: 13 | 14 | * ZLIB (DEFLATE) compression 15 | * LZVN compression 16 | * encryption 17 | * extended attributes 18 | 19 | Unsupported APFS format features: 20 | 21 | * APFS version 1 22 | * Fusion drive (NX_INCOMPAT_FUSION) 23 | * snapshots 24 | * LZFSE compression, compression methods 11 and 12 25 | * "uncompressed", compression methods 1, 9 and 10 26 | * T2 encryption 27 | 28 | For more information see: 29 | 30 | * Project documentation: https://github.com/libyal/libfsapfs/wiki/Home 31 | * How to build from source: https://github.com/libyal/libfsapfs/wiki/Building 32 | 33 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl Checks for required headers and functions 2 | dnl 3 | dnl Version: 20200713 4 | 5 | dnl Function to detect if libfsapfs dependencies are available 6 | AC_DEFUN([AX_LIBFSAPFS_CHECK_LOCAL], 7 | [dnl Check for internationalization functions in libfsapfs/libfsapfs_i18n.c 8 | AC_CHECK_FUNCS([bindtextdomain]) 9 | ]) 10 | 11 | dnl Function to detect if fsapfstools dependencies are available 12 | AC_DEFUN([AX_FSAPFSTOOLS_CHECK_LOCAL], 13 | [AC_CHECK_HEADERS([signal.h sys/signal.h unistd.h]) 14 | 15 | AC_CHECK_FUNCS([close getopt setvbuf]) 16 | 17 | AS_IF( 18 | [test "x$ac_cv_func_close" != xyes], 19 | [AC_MSG_FAILURE( 20 | [Missing function: close], 21 | [1]) 22 | ]) 23 | 24 | dnl Headers included in fsapfstools/fsapfsmount.c 25 | AC_CHECK_HEADERS([errno.h sys/time.h]) 26 | 27 | dnl Functions included in fsapfstools/mount_file_system.c and fsapfstools/mount_file_entry.c 28 | AS_IF( 29 | [test "x$ac_cv_enable_winapi" = xno], 30 | [AC_CHECK_FUNCS([clock_gettime getegid geteuid time]) 31 | ]) 32 | ]) 33 | 34 | dnl Function to check if DLL support is needed 35 | AC_DEFUN([AX_LIBFSAPFS_CHECK_DLL_SUPPORT], 36 | [AS_IF( 37 | [test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno], 38 | [AS_CASE( 39 | [$host], 40 | [*cygwin* | *mingw* | *msys*], 41 | [AC_DEFINE( 42 | [HAVE_DLLMAIN], 43 | [1], 44 | [Define to 1 to enable the DllMain function.]) 45 | AC_SUBST( 46 | [HAVE_DLLMAIN], 47 | [1]) 48 | 49 | AC_SUBST( 50 | [LIBFSAPFS_DLL_EXPORT], 51 | ["-DLIBFSAPFS_DLL_EXPORT"]) 52 | 53 | AC_SUBST( 54 | [LIBFSAPFS_DLL_IMPORT], 55 | ["-DLIBFSAPFS_DLL_IMPORT"]) 56 | ]) 57 | ]) 58 | ]) 59 | 60 | -------------------------------------------------------------------------------- /builddokan.ps1: -------------------------------------------------------------------------------- 1 | # Script that builds dokan 2 | # 3 | # Version: 20180322 4 | 5 | Param ( 6 | [string]$Configuration = ${Env:Configuration}, 7 | [string]$Platform = ${Env:Platform}, 8 | [switch]$UseLegacyVersion = $false 9 | ) 10 | 11 | If (-not ${Configuration}) 12 | { 13 | $Configuration = "Release" 14 | } 15 | If (-not ${Platform}) 16 | { 17 | $Platform = "Win32" 18 | } 19 | 20 | If (${Env:AppVeyor} -eq "True") 21 | { 22 | $MSBuild = "MSBuild.exe" 23 | } 24 | ElseIf (${Env:VisualStudioVersion} -eq "15.0") 25 | { 26 | $MSBuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe" 27 | } 28 | ElseIf (${Env:VisualStudioVersion} -eq "9.0") 29 | { 30 | $MSBuild = "C:\\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe" 31 | } 32 | Else 33 | { 34 | $MSBuild = "C:\\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" 35 | } 36 | $MSBuildOptions = "/verbosity:quiet /target:Build /property:Configuration=${Configuration},Platform=${Platform}" 37 | 38 | If ($UseLegacyVersion) 39 | { 40 | $DokanPath = "../dokan" 41 | $ProjectFile = "msvscpp\dokan.sln" 42 | } 43 | Else 44 | { 45 | $DokanPath = "../dokany" 46 | $ProjectFile = "dokan\dokan.vcxproj" 47 | } 48 | 49 | Push-Location ${DokanPath} 50 | 51 | Try 52 | { 53 | Write-Host "${MSBuild} ${MSBuildOptions} ${ProjectFile}" 54 | 55 | Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${ProjectFile}" 56 | } 57 | Finally 58 | { 59 | Pop-Location 60 | } 61 | 62 | -------------------------------------------------------------------------------- /common/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I../include -I$(top_srcdir)/include 3 | 4 | EXTRA_DIST = \ 5 | byte_stream.h \ 6 | common.h \ 7 | config.h \ 8 | config_borlandc.h \ 9 | config_msc.h \ 10 | config_winapi.h \ 11 | file_stream.h \ 12 | memory.h \ 13 | narrow_string.h \ 14 | system_string.h \ 15 | types.h \ 16 | types.h.in \ 17 | wide_string.h 18 | 19 | DISTCLEANFILES = \ 20 | config.h \ 21 | types.h \ 22 | Makefile \ 23 | Makefile.in 24 | 25 | -------------------------------------------------------------------------------- /common/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common include file 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _COMMON_H ) 23 | #define _COMMON_H 24 | 25 | #if defined( HAVE_CONFIG_H ) 26 | #include "config.h" 27 | #endif 28 | 29 | /* Include the Borland/CodeGear C++ Builder compiler specific configuration 30 | */ 31 | #if defined( __BORLANDC__ ) 32 | #include "config_borlandc.h" 33 | 34 | /* Include the Microsoft Visual Studio C++ compiler specific configuration 35 | */ 36 | #elif defined( _MSC_VER ) 37 | #include "config_msc.h" 38 | #endif 39 | 40 | #include "config_winapi.h" 41 | 42 | #endif /* !defined( _COMMON_H ) */ 43 | 44 | -------------------------------------------------------------------------------- /common/config_borlandc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Configuration for the Borland/CodeGear C++ Builder compiler 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _CONFIG_BORLANDC_H ) 23 | #define _CONFIG_BORLANDC_H 24 | 25 | #endif /* !defined( _CONFIG_BORLANDC_H ) */ 26 | 27 | -------------------------------------------------------------------------------- /common/config_msc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Configuration for the Microsoft Visual Studio C++ compiler 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _CONFIG_MSC_H ) 23 | #define _CONFIG_MSC_H 24 | 25 | /* Disable warning C4127: conditional expression is constant 26 | */ 27 | #pragma warning( disable : 4127 ) 28 | 29 | /* Disable warning C4201: nonstandard extension used : nameless struct/union 30 | */ 31 | #pragma warning( disable : 4201 ) 32 | 33 | #endif /* !defined( _CONFIG_MSC_H ) */ 34 | 35 | -------------------------------------------------------------------------------- /dpkg/changelog.in: -------------------------------------------------------------------------------- 1 | libfsapfs (@VERSION@-1) unstable; urgency=low 2 | 3 | * Auto-generated 4 | 5 | -- Joachim Metz @DPKG_DATE@ 6 | -------------------------------------------------------------------------------- /dpkg/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /dpkg/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: libfsapfs 3 | Source: https://github.com/libyal/libfsapfs 4 | 5 | Files: * 6 | Copyright: 2018-2024, Joachim Metz 7 | License: LGPL-3.0+ 8 | 9 | License: LGPL-3.0+ 10 | This package is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Lesser General Public 12 | License as published by the Free Software Foundation; either 13 | version 3 of the License, or (at your option) any later version. 14 | . 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Lesser General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | . 23 | On Debian systems, the complete text of the GNU Lesser General 24 | Public License can be found in "/usr/share/common-licenses/LGPL-3". 25 | 26 | -------------------------------------------------------------------------------- /dpkg/libfsapfs-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/*-*/lib*.a 3 | usr/lib/*-*/lib*.so 4 | usr/lib/*-*/pkgconfig/* 5 | usr/share/man/man3 6 | -------------------------------------------------------------------------------- /dpkg/libfsapfs-python3.install: -------------------------------------------------------------------------------- 1 | /usr/lib/python3* 2 | -------------------------------------------------------------------------------- /dpkg/libfsapfs-tools.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | -------------------------------------------------------------------------------- /dpkg/libfsapfs.install: -------------------------------------------------------------------------------- 1 | usr/lib/*-*/lib*.so.* 2 | -------------------------------------------------------------------------------- /dpkg/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment for debhelper verbose output. 5 | # export DH_VERBOSE=1 6 | 7 | export SKIP_PYTHON_TESTS=1 8 | 9 | %: 10 | dh $@ --buildsystem=autoconf --with=autoreconf,python3 11 | 12 | .PHONY: override_dh_auto_configure 13 | override_dh_auto_configure: 14 | dh_auto_configure -- --enable-python CFLAGS="-g" 15 | 16 | .PHONY: override_dh_install 17 | override_dh_install: 18 | dh_install --fail-missing -X.la -X/pyfsapfs.a 19 | 20 | .PHONY: override_dh_missing 21 | override_dh_missing: 22 | dh_missing -X.la -X/pyfsapfs.a --fail-missing 23 | 24 | .PHONY: override_dh_strip 25 | override_dh_strip: 26 | ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) 27 | dh_strip -plibfsapfs --dbg-package=libfsapfs-dbg 28 | dh_strip -plibfsapfs-tools --dbg-package=libfsapfs-tools-dbg 29 | dh_strip -plibfsapfs-python3 --dbg-package=libfsapfs-python3-dbg 30 | endif 31 | 32 | -------------------------------------------------------------------------------- /dpkg/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /fsapfstools/bodyfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bodyfile functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _BODYFILE_H ) 23 | #define _BODYFILE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfstools_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int bodyfile_path_string_copy_from_file_entry_path( 35 | system_character_t **path, 36 | size_t *path_size, 37 | const system_character_t *file_entry_path, 38 | size_t file_entry_path_length, 39 | libcerror_error_t **error ); 40 | 41 | #if defined( __cplusplus ) 42 | } 43 | #endif 44 | 45 | #endif /* !defined( _BODYFILE_H ) */ 46 | 47 | -------------------------------------------------------------------------------- /fsapfstools/digest_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Crypographic digest hash 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _DIGEST_HASH_H ) 23 | #define _DIGEST_HASH_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfstools_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int digest_hash_copy_to_string( 35 | const uint8_t *digest_hash, 36 | size_t digest_hash_size, 37 | char *string, 38 | size_t string_size, 39 | libcerror_error_t **error ); 40 | 41 | #if defined( __cplusplus ) 42 | } 43 | #endif 44 | 45 | #endif /* !defined( _DIGEST_HASH_H ) */ 46 | 47 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_GETOPT_H ) 23 | #define _FSAPFSTOOLS_GETOPT_H 24 | 25 | #include 26 | #include 27 | 28 | /* unistd.h is included here to export getopt, optarg, optind and optopt 29 | */ 30 | #if defined( HAVE_UNISTD_H ) 31 | #include 32 | #endif 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | #if defined( HAVE_GETOPT ) 39 | #define fsapfstools_getopt( argument_count, argument_values, options_string ) \ 40 | getopt( argument_count, argument_values, options_string ) 41 | 42 | #else 43 | 44 | #if !defined( __CYGWIN__ ) 45 | extern int optind; 46 | extern system_character_t *optarg; 47 | extern system_integer_t optopt; 48 | 49 | #else 50 | int optind; 51 | system_character_t *optarg; 52 | system_integer_t optopt; 53 | 54 | #endif /* !defined( __CYGWIN__ ) */ 55 | 56 | system_integer_t fsapfstools_getopt( 57 | int argument_count, 58 | system_character_t * const argument_values[], 59 | const system_character_t *options_string ); 60 | 61 | #endif /* defined( HAVE_GETOPT ) */ 62 | 63 | #if defined( __cplusplus ) 64 | } 65 | #endif 66 | 67 | #endif /* !defined( _FSAPFSTOOLS_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_i18n.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Internationalization (i18n) functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_I18N_H ) 23 | #define _FSAPFSTOOLS_I18N_H 24 | 25 | #include 26 | 27 | #if defined( HAVE_LIBINTL_H ) 28 | #include 29 | #endif 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | /* TODO for now do nothing i18n-like 36 | #define _( string ) \ 37 | gettext( string ) 38 | */ 39 | 40 | #define _( string ) \ 41 | string 42 | 43 | #if defined( __cplusplus ) 44 | } 45 | #endif 46 | 47 | #endif /* !defined( _FSAPFSTOOLS_I18N_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBBFIO_H ) 23 | #define _FSAPFSTOOLS_LIBBFIO_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio 28 | */ 29 | #if defined( HAVE_LOCAL_LIBBFIO ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT 43 | * before including libbfio.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 46 | #define LIBBFIO_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) 52 | #error Multi-threading support requires libbfio with multi-threading support 53 | #endif 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ 56 | 57 | #endif /* !defined( _FSAPFSTOOLS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libcdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcdata header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBCDATA_H ) 23 | #define _FSAPFSTOOLS_LIBCDATA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCDATA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT 43 | * before including libcdata.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBCDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ 52 | 53 | #endif /* !defined( _FSAPFSTOOLS_LIBCDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBCERROR_H ) 23 | #define _FSAPFSTOOLS_LIBCERROR_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCERROR ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT 39 | * before including libcerror.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 42 | #define LIBCERROR_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ 48 | 49 | #endif /* !defined( _FSAPFSTOOLS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBCLOCALE_H ) 23 | #define _FSAPFSTOOLS_LIBCLOCALE_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCLOCALE ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT 39 | * before including libclocale.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 42 | #define LIBCLOCALE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ 48 | 49 | #endif /* !defined( _FSAPFSTOOLS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBCNOTIFY_H ) 23 | #define _FSAPFSTOOLS_LIBCNOTIFY_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCNOTIFY ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT 39 | * before including libcnotify.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 42 | #define LIBCNOTIFY_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ 48 | 49 | #endif /* !defined( _FSAPFSTOOLS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libcpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcpath header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBCPATH_H ) 23 | #define _FSAPFSTOOLS_LIBCPATH_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCPATH ) 30 | 31 | #include 32 | #include 33 | 34 | #else 35 | 36 | /* If libtool DLL support is enabled set LIBCPATH_DLL_IMPORT 37 | * before including libcpath.h 38 | */ 39 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 40 | #define LIBCPATH_DLL_IMPORT 41 | #endif 42 | 43 | #include 44 | 45 | #endif /* defined( HAVE_LOCAL_LIBCPATH ) */ 46 | 47 | #endif /* !defined( _FSAPFSTOOLS_LIBCPATH_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBFDATETIME_H ) 23 | #define _FSAPFSTOOLS_LIBFDATETIME_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFDATETIME for local use of libfdatetime 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFDATETIME ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #else 43 | 44 | /* If libtool DLL support is enabled set LIBFDATETIME_DLL_IMPORT 45 | * before including libfdatetime.h 46 | */ 47 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 48 | #define LIBFDATETIME_DLL_IMPORT 49 | #endif 50 | 51 | #include 52 | 53 | #endif /* defined( HAVE_LOCAL_LIBFDATETIME ) */ 54 | 55 | #endif /* !defined( _FSAPFSTOOLS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBFGUID_H ) 23 | #define _FSAPFSTOOLS_LIBFGUID_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFGUID for local use of libfguid 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFGUID ) 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #else 36 | 37 | /* If libtool DLL support is enabled set LIBFGUID_DLL_IMPORT 38 | * before including libfguid.h 39 | */ 40 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 41 | #define LIBFGUID_DLL_IMPORT 42 | #endif 43 | 44 | #include 45 | 46 | #endif /* defined( HAVE_LOCAL_LIBFGUID ) */ 47 | 48 | #endif /* !defined( _FSAPFSTOOLS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libfsapfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsapfs header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBFSAPFS_H ) 23 | #define _FSAPFSTOOLS_LIBFSAPFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSAPFSTOOLS_LIBFSAPFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libfsrefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsapfs header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBFSAPFS_H ) 23 | #define _FSAPFSTOOLS_LIBFSAPFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSAPFSTOOLS_LIBFSAPFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libhmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libhmac header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBHMAC_H ) 23 | #define _FSAPFSTOOLS_LIBHMAC_H 24 | 25 | #include 26 | 27 | #if defined( HAVE_LOCAL_LIBHMAC ) 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #else 38 | 39 | /* If libtool DLL support is enabled set LIBHMAC_DLL_IMPORT 40 | * before including libhmac.h 41 | */ 42 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 43 | #define LIBHMAC_DLL_IMPORT 44 | #endif 45 | 46 | #include 47 | 48 | #endif /* defined( HAVE_LOCAL_LIBHMAC ) */ 49 | 50 | #endif /* !defined( _FSAPFSTOOLS_LIBHMAC_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_LIBUNA_H ) 23 | #define _FSAPFSTOOLS_LIBUNA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBUNA for local use of libuna 28 | */ 29 | #if defined( HAVE_LOCAL_LIBUNA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #else 47 | 48 | /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT 49 | * before including libuna.h 50 | */ 51 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 52 | #define LIBUNA_DLL_IMPORT 53 | #endif 54 | 55 | #include 56 | 57 | #endif /* defined( HAVE_LOCAL_LIBUNA ) */ 58 | 59 | #endif /* !defined( _FSAPFSTOOLS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common output functions for the fsapfstools 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_OUTPUT_H ) 23 | #define _FSAPFSTOOLS_OUTPUT_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "fsapfstools_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fsapfstools_output_initialize( 36 | int stdio_mode, 37 | libcerror_error_t **error ); 38 | 39 | void fsapfstools_output_copyright_fprint( 40 | FILE *stream ); 41 | 42 | void fsapfstools_output_version_fprint( 43 | FILE *stream, 44 | const char *program ); 45 | 46 | void fsapfstools_output_version_detailed_fprint( 47 | FILE *stream, 48 | const char *program ); 49 | 50 | #if defined( __cplusplus ) 51 | } 52 | #endif 53 | 54 | #endif /* !defined( _FSAPFSTOOLS_OUTPUT_H ) */ 55 | 56 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Signal handling functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_SIGNAL_H ) 23 | #define _FSAPFSTOOLS_SIGNAL_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfstools_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | #if !defined( HAVE_SIGNAL_H ) && !defined( WINAPI ) 35 | #error missing signal functions 36 | #endif 37 | 38 | #if defined( WINAPI ) 39 | typedef unsigned long fsapfstools_signal_t; 40 | 41 | #else 42 | typedef int fsapfstools_signal_t; 43 | 44 | #endif /* defined( WINAPI ) */ 45 | 46 | #if defined( WINAPI ) 47 | 48 | BOOL WINAPI fsapfstools_signal_handler( 49 | fsapfstools_signal_t signal ); 50 | 51 | #if defined( _MSC_VER ) 52 | 53 | void fsapfstools_signal_initialize_memory_debug( 54 | void ); 55 | 56 | #endif /* defined( _MSC_VER ) */ 57 | 58 | #endif /* defined( WINAPI ) */ 59 | 60 | int fsapfstools_signal_attach( 61 | void (*signal_handler)( fsapfstools_signal_t ), 62 | libcerror_error_t **error ); 63 | 64 | int fsapfstools_signal_detach( 65 | libcerror_error_t **error ); 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSAPFSTOOLS_SIGNAL_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /fsapfstools/fsapfstools_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFSTOOLS_UNUSED_H ) 23 | #define _FSAPFSTOOLS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSAPFSTOOLS_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSAPFSTOOLS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSAPFSTOOLS_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSAPFSTOOLS_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSAPFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSAPFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSAPFSTOOLS_UNUSED_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsapfstools/mount_path_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Mount path string functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _MOUNT_PATH_STRING_H ) 23 | #define _MOUNT_PATH_STRING_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfstools_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int mount_path_string_copy_hexadecimal_to_integer_32_bit( 35 | const system_character_t *string, 36 | size_t string_size, 37 | uint32_t *value_32bit, 38 | libcerror_error_t **error ); 39 | 40 | int mount_path_string_copy_from_file_entry_path( 41 | system_character_t **path, 42 | size_t *path_size, 43 | const system_character_t *file_entry_path, 44 | size_t file_entry_path_length, 45 | libcerror_error_t **error ); 46 | 47 | int mount_path_string_copy_to_file_entry_path( 48 | const system_character_t *path, 49 | size_t path_length, 50 | system_character_t **file_entry_path, 51 | size_t *file_entry_path_size, 52 | libcerror_error_t **error ); 53 | 54 | #if defined( __cplusplus ) 55 | } 56 | #endif 57 | 58 | #endif /* !defined( _MOUNT_PATH_STRING_H ) */ 59 | 60 | -------------------------------------------------------------------------------- /fsapfstools/path_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Path string functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PATH_STRING_H ) 23 | #define _PATH_STRING_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfstools_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int path_string_copy_hexadecimal_to_integer_32_bit( 35 | const system_character_t *string, 36 | size_t string_size, 37 | uint32_t *value_32bit, 38 | libcerror_error_t **error ); 39 | 40 | int path_string_copy_from_file_entry_path( 41 | system_character_t **path, 42 | size_t *path_size, 43 | const system_character_t *file_entry_path, 44 | size_t file_entry_path_length, 45 | libcerror_error_t **error ); 46 | 47 | int path_string_copy_to_file_entry_path( 48 | const system_character_t *path, 49 | size_t path_length, 50 | system_character_t path_segment_separator, 51 | system_character_t **file_entry_path, 52 | size_t *file_entry_path_size, 53 | libcerror_error_t **error ); 54 | 55 | #if defined( __cplusplus ) 56 | } 57 | #endif 58 | 59 | #endif /* !defined( _PATH_STRING_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = \ 2 | libfsapfs.h 3 | 4 | pkginclude_HEADERS = \ 5 | libfsapfs/codepage.h \ 6 | libfsapfs/definitions.h \ 7 | libfsapfs/error.h \ 8 | libfsapfs/extern.h \ 9 | libfsapfs/features.h \ 10 | libfsapfs/types.h 11 | 12 | EXTRA_DIST = \ 13 | libfsapfs.h.in \ 14 | libfsapfs/definitions.h.in \ 15 | libfsapfs/features.h.in \ 16 | libfsapfs/types.h.in 17 | 18 | DISTCLEANFILES = \ 19 | libfsapfs.h \ 20 | libfsapfs/definitions.h \ 21 | libfsapfs/features.h \ 22 | libfsapfs/types.h \ 23 | Makefile \ 24 | Makefile.in 25 | 26 | -------------------------------------------------------------------------------- /include/libfsapfs/extern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The extern definition 3 | * 4 | * This header should be included in header files that export or import 5 | * library functions 6 | * 7 | * Copyright (C) 2018-2024, Joachim Metz 8 | * 9 | * Refer to AUTHORS for acknowledgements. 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU Lesser General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #if !defined( _LIBFSAPFS_EXTERN_H ) 26 | #define _LIBFSAPFS_EXTERN_H 27 | 28 | /* To export functions from the libfsapfs DLL define LIBFSAPFS_DLL_EXPORT 29 | * To import functions from the libfsapfs DLL define LIBFSAPFS_DLL_IMPORT 30 | * Otherwise use default extern statement 31 | */ 32 | #if defined( LIBFSAPFS_DLL_EXPORT ) 33 | #define LIBFSAPFS_EXTERN __declspec(dllexport) 34 | 35 | #elif defined( LIBFSAPFS_DLL_IMPORT ) 36 | #define LIBFSAPFS_EXTERN extern __declspec(dllimport) 37 | 38 | #else 39 | #define LIBFSAPFS_EXTERN extern 40 | 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSAPFS_EXTERN_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /include/libfsapfs/features.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Features of libfsapfs 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_FEATURES_H ) 23 | #define _LIBFSAPFS_FEATURES_H 24 | 25 | /* The libfsapfs type support features 26 | */ 27 | #if defined( WINAPI ) || @HAVE_WIDE_CHARACTER_TYPE@ 28 | #define LIBFSAPFS_HAVE_WIDE_CHARACTER_TYPE 1 29 | #endif 30 | 31 | #if defined( WINAPI ) || @HAVE_MULTI_THREAD_SUPPORT@ 32 | #define LIBFSAPFS_HAVE_MULTI_THREAD_SUPPORT 1 33 | #endif 34 | 35 | #if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && @HAVE_LIBBFIO@ ) 36 | #define LIBFSAPFS_HAVE_BFIO 1 37 | #endif 38 | 39 | #if !defined( LIBFSAPFS_DEPRECATED ) 40 | #if defined( __GNUC__ ) && __GNUC__ >= 3 41 | #define LIBFSAPFS_DEPRECATED __attribute__ ((__deprecated__)) 42 | #elif defined( _MSC_VER ) 43 | #define LIBFSAPFS_DEPRECATED __declspec(deprecated) 44 | #else 45 | #define LIBFSAPFS_DEPRECATED 46 | #endif 47 | #endif 48 | 49 | #endif /* !defined( _LIBFSAPFS_FEATURES_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs.ini: -------------------------------------------------------------------------------- 1 | [project] 2 | description: "libfsapfs is a library to access the Apple File System (APFS)." 3 | name: "libfsapfs" 4 | status: "experimental" 5 | year_of_creation: "2018" 6 | documentation_url: "https://github.com/libyal/libfsapfs/tree/main/documentation" 7 | features: ["debug_output", "ossfuzz", "python_bindings", "tools"] 8 | 9 | [library] 10 | build_dependencies: ["crypto", "zlib"] 11 | description: "Library to access the Apple File System (APFS) format" 12 | features: ["pthread", "wide_character_type"] 13 | public_types: ["container", "extended_attribute", "file_entry", "snapshot", "volume"] 14 | 15 | [tools] 16 | build_dependencies: ["crypto", "fuse"] 17 | description: "Several tools for reading Apple File System (APFS) volumes" 18 | names: ["fsapfsinfo", "fsapfsmount"] 19 | 20 | [info_tool] 21 | source_description: "an Apple File System (APFS) container" 22 | source_type: "container" 23 | 24 | [mount_tool] 25 | features: ["offset", "password", "recovery_password"] 26 | base_type: "container" 27 | file_entry_access_time_type: "nano_posix_time" 28 | file_entry_creation_time_type: "nano_posix_time" 29 | file_entry_inode_change_time_type: "nano_posix_time" 30 | file_entry_modification_time_type: "nano_posix_time" 31 | file_entry_type: "file_entry" 32 | file_system_type: "volume" 33 | mounted_description: "a file system contained in the APFS container" 34 | source: "image.dmg" 35 | source_description: "an APFS container" 36 | source_description_long: "an Apple File System (APFS) container" 37 | source_type: "container" 38 | 39 | [tests] 40 | profiles: ["libfsapfs", "pyfsapfs", "fsapfsinfo", "fsapfsinfo_bodyfile_fs", "fsapfsinfo_fs"] 41 | option_sets: ["offset", "password"] 42 | info_tool_option_sets: ["offset", "password"] 43 | info_tool_options_per_profile: ["", "-H"] 44 | info_tool_profiles: ["fsapfsinfo", "fsapfsinfo_fs"] 45 | example_filename1: "image1.dmg" 46 | example_filename2: "image2.dmg" 47 | 48 | [pypi] 49 | appveyor_token: "VHuZiUWgTqTciKE2nsv/LuBOWTuFm7lT+/HRK0pL5yBrVXNacqwjZtAMWHq5uEPHtz2YRcuHDGzmF12YrGktwtTpUPSq7k/ntZ72h8xhvVea33s/l905e0k3pOa51K1ko/V76yqkyAklF93sAF20spco21LT9uwB9VVTO8IrSPZWzPxRtybPp0XAg3bluTbrmIEI+AaBT8UJxvONjSrcpUlHPH2l25zMnh4Sd8IL0l+HfZ8XdueNCZILBgCB2u+KKHthWZdnzI+jvB2d3IAfEPu88OsjZjAUDIlSWffesB0=" 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libfsapfs 7 | Description: Library to access the Apple File System (APFS) format 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lfsapfs 10 | Libs.private: @ax_libbfio_pc_libs_private@ @ax_libcaes_pc_libs_private@ @ax_libcdata_pc_libs_private@ @ax_libcerror_pc_libs_private@ @ax_libcfile_pc_libs_private@ @ax_libclocale_pc_libs_private@ @ax_libcnotify_pc_libs_private@ @ax_libcpath_pc_libs_private@ @ax_libcrypto_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdata_pc_libs_private@ @ax_libfdatetime_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfmos_pc_libs_private@ @ax_libhmac_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ @ax_zlib_pc_libs_private@ 11 | Cflags: -I${includedir} 12 | 13 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_chunk_information_block.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS chunk information block definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_CHUNK_INFORMATION_BLOCK_H ) 23 | #define _FSAPFS_CHUNK_INFORMATION_BLOCK_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_chunk_information_block fsapfs_chunk_information_block_t; 33 | 34 | struct fsapfs_chunk_information_block 35 | { 36 | /* The object checksum 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t object_checksum[ 8 ]; 40 | 41 | /* The object identifier 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t object_identifier[ 8 ]; 45 | 46 | /* The object transaction identifier 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t object_transaction_identifier[ 8 ]; 50 | 51 | /* The object type 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t object_type[ 4 ]; 55 | 56 | /* The object subtype 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t object_subtype[ 4 ]; 60 | 61 | /* Unknown 62 | * Consists of 4 bytes 63 | */ 64 | uint8_t unknown1[ 4 ]; 65 | }; 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSAPFS_CHUNK_INFORMATION_BLOCK_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_compressed_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS compressed data definitions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_COMPRESSED_DATA_H ) 23 | #define _FSAPFS_COMPRESSED_DATA_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_compressed_data_header fsapfs_compressed_data_header_t; 33 | 34 | struct fsapfs_compressed_data_header 35 | { 36 | /* The signature 37 | * Consists of 4 bytes 38 | * Contains "fpmc" 39 | */ 40 | uint8_t signature[ 4 ]; 41 | 42 | /* The compression method 43 | * Consists of 4 bytes 44 | */ 45 | uint8_t compression_method[ 4 ]; 46 | 47 | /* The uncompressed data size 48 | * Consists of 8 bytes 49 | */ 50 | uint8_t uncompressed_data_size[ 8 ]; 51 | }; 52 | 53 | #if defined( __cplusplus ) 54 | } 55 | #endif 56 | 57 | #endif /* !defined( _FSAPFS_COMPRESSED_DATA_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_container_reaper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS container reaper definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_CONTAINER_REAPER_H ) 23 | #define _FSAPFS_CONTAINER_REAPER_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_container_reaper fsapfs_container_reaper_t; 33 | 34 | struct fsapfs_container_reaper 35 | { 36 | /* The object checksum 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t object_checksum[ 8 ]; 40 | 41 | /* The object identifier 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t object_identifier[ 8 ]; 45 | 46 | /* The object transaction identifier 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t object_transaction_identifier[ 8 ]; 50 | 51 | /* The object type 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t object_type[ 4 ]; 55 | 56 | /* The object subtype 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t object_subtype[ 4 ]; 60 | 61 | /* Unknown 62 | * Consists of 8 bytes 63 | */ 64 | uint8_t unknown1[ 8 ]; 65 | 66 | /* TODO add more values */ 67 | }; 68 | 69 | /* TODO add more reaper list */ 70 | /* TODO add more reaper list entry */ 71 | 72 | #if defined( __cplusplus ) 73 | } 74 | #endif 75 | 76 | #endif /* !defined( _FSAPFS_CONTAINER_REAPER_H ) */ 77 | 78 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_extent_reference_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS extent reference tree definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_EXTENT_REFERENCE_TREE_H ) 23 | #define _FSAPFS_EXTENT_REFERENCE_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_extent_reference_tree fsapfs_extent_reference_tree_t; 33 | 34 | struct fsapfs_extent_reference_tree 35 | { 36 | /* The object checksum 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t object_checksum[ 8 ]; 40 | 41 | /* The object identifier 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t object_identifier[ 8 ]; 45 | 46 | /* The object transaction identifier 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t object_transaction_identifier[ 8 ]; 50 | 51 | /* The object type 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t object_type[ 4 ]; 55 | 56 | /* The object subtype 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t object_subtype[ 4 ]; 60 | 61 | /* Unknown 62 | * Consists of 4 bytes 63 | */ 64 | uint8_t unknown1[ 4 ]; 65 | }; 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSAPFS_EXTENT_REFERENCE_TREE_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_fusion_middle_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS Fusion middle tree definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_FUSION_MIDDLE_TREE_H ) 23 | #define _FSAPFS_FUSION_MIDDLE_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_fusion_middle_tree fsapfs_fusion_middle_tree_t; 33 | 34 | struct fsapfs_fusion_middle_tree 35 | { 36 | /* The object checksum 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t object_checksum[ 8 ]; 40 | 41 | /* The object identifier 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t object_identifier[ 8 ]; 45 | 46 | /* The object transaction identifier 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t object_transaction_identifier[ 8 ]; 50 | 51 | /* The object type 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t object_type[ 4 ]; 55 | 56 | /* The object subtype 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t object_subtype[ 4 ]; 60 | 61 | /* Unknown 62 | * Consists of 4 bytes 63 | */ 64 | uint8_t unknown1[ 4 ]; 65 | }; 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSAPFS_FUSION_MIDDLE_TREE_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /libfsapfs/fsapfs_object.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS object definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_OBJECT_H ) 23 | #define _FSAPFS_OBJECT_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsapfs_object fsapfs_object_t; 33 | 34 | struct fsapfs_object 35 | { 36 | /* The checksum 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t checksum[ 8 ]; 40 | 41 | /* The identifier 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t identifier[ 8 ]; 45 | 46 | /* The transaction identifier 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t transaction_identifier[ 8 ]; 50 | 51 | /* The type 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t type[ 4 ]; 55 | 56 | /* The subtype 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t subtype[ 4 ]; 60 | }; 61 | 62 | #if defined( __cplusplus ) 63 | } 64 | #endif 65 | 66 | #endif /* !defined( _FSAPFS_OBJECT_H ) */ 67 | 68 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Library to access the Apple File System (APFS) format 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #include 23 | 24 | #if defined( WINAPI ) 25 | #include 26 | #endif 27 | 28 | #include "libfsapfs_unused.h" 29 | 30 | /* Define HAVE_LOCAL_LIBFSAPFS for local use of libfsapfs 31 | */ 32 | #if !defined( HAVE_LOCAL_LIBFSAPFS ) 33 | 34 | #if defined( WINAPI ) && defined( HAVE_DLLMAIN ) 35 | 36 | #if defined( _MANAGED ) 37 | #pragma managed( push, off ) 38 | #endif 39 | 40 | /* Defines the entry point for the DLL 41 | */ 42 | BOOL WINAPI DllMain( 43 | HINSTANCE hinstDLL, 44 | DWORD fdwReason, 45 | LPVOID lpvReserved ) 46 | { 47 | LIBFSAPFS_UNREFERENCED_PARAMETER( lpvReserved ) 48 | 49 | switch( fdwReason ) 50 | { 51 | case DLL_PROCESS_ATTACH: 52 | DisableThreadLibraryCalls( 53 | hinstDLL ); 54 | break; 55 | 56 | case DLL_THREAD_ATTACH: 57 | break; 58 | 59 | case DLL_THREAD_DETACH: 60 | break; 61 | 62 | case DLL_PROCESS_DETACH: 63 | break; 64 | } 65 | return( TRUE ); 66 | } 67 | 68 | /* Function that indicates the library is a DLL 69 | * Returns 1 70 | */ 71 | int libfsapfs_is_dll( 72 | void ) 73 | { 74 | return( 1 ); 75 | } 76 | 77 | #endif /* defined( WINAPI ) && defined( HAVE_DLLMAIN ) */ 78 | 79 | #endif /* !defined( HAVE_LOCAL_LIBFSAPFS ) */ 80 | 81 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef GCC_WINDRES 4 | VS_VERSION_INFO VERSIONINFO 5 | #else 6 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 7 | #endif 8 | FILEVERSION 1,0,0,0 9 | PRODUCTVERSION 1,0,0,0 10 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 11 | #ifdef _DEBUG 12 | FILEFLAGS 0x1L 13 | #else 14 | FILEFLAGS 0x0L 15 | #endif 16 | FILEOS VOS__WINDOWS32 17 | FILETYPE VFT_DLL 18 | FILESUBTYPE 0x0L 19 | BEGIN 20 | BLOCK "StringFileInfo" 21 | BEGIN 22 | BLOCK "040904E4" 23 | BEGIN 24 | VALUE "FileDescription", "Library to access the Apple File System (APFS) format\0" 25 | VALUE "FileVersion", "@VERSION@" "\0" 26 | VALUE "InternalName", "libfsapfs.dll\0" 27 | VALUE "LegalCopyright", "(C) 2018-2024, Joachim Metz \0" 28 | VALUE "OriginalFilename", "libfsapfs.dll\0" 29 | VALUE "ProductName", "libfsapfs\0" 30 | VALUE "ProductVersion", "@VERSION@" "\0" 31 | VALUE "Comments", "For more information visit https://github.com/libyal/libfsapfs/\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 1200 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * (Extended) attribute functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_ATTRIBUTE_H ) 23 | #define _LIBFSAPFS_ATTRIBUTE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_attribute_values.h" 29 | #include "libfsapfs_encryption_context.h" 30 | #include "libfsapfs_file_system_btree.h" 31 | #include "libfsapfs_io_handle.h" 32 | #include "libfsapfs_libbfio.h" 33 | #include "libfsapfs_libcdata.h" 34 | #include "libfsapfs_libcerror.h" 35 | #include "libfsapfs_libfdata.h" 36 | 37 | #if defined( __cplusplus ) 38 | extern "C" { 39 | #endif 40 | 41 | int libfsapfs_attributes_get_file_extents( 42 | libfsapfs_attribute_values_t *attribute_values, 43 | libbfio_handle_t *file_io_handle, 44 | libfsapfs_file_system_btree_t *file_system_btree, 45 | uint64_t transaction_identifier, 46 | libcerror_error_t **error ); 47 | 48 | int libfsapfs_attributes_get_data_stream( 49 | libfsapfs_attribute_values_t *attribute_values, 50 | libfsapfs_io_handle_t *io_handle, 51 | libbfio_handle_t *file_io_handle, 52 | libfsapfs_encryption_context_t *encryption_context, 53 | libfsapfs_file_system_btree_t *file_system_btree, 54 | uint64_t transaction_identifier, 55 | libfdata_stream_t **data_stream, 56 | libcerror_error_t **error ); 57 | 58 | #if defined( __cplusplus ) 59 | } 60 | #endif 61 | 62 | #endif /* !defined( _LIBFSAPFS_ATTRIBUTE_H ) */ 63 | 64 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_btree_footer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The B-tree footer functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_BTREE_FOOTER_H ) 23 | #define _LIBFSAPFS_BTREE_FOOTER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsapfs_btree_footer libfsapfs_btree_footer_t; 35 | 36 | struct libfsapfs_btree_footer 37 | { 38 | /* The flags 39 | */ 40 | uint32_t flags; 41 | 42 | /* The node size 43 | */ 44 | uint32_t node_size; 45 | 46 | /* The key size 47 | */ 48 | uint32_t key_size; 49 | 50 | /* The value size 51 | */ 52 | uint32_t value_size; 53 | 54 | /* The maximum key size 55 | */ 56 | uint32_t maximum_key_size; 57 | 58 | /* The maximum value size 59 | */ 60 | uint32_t maximum_value_size; 61 | }; 62 | 63 | int libfsapfs_btree_footer_initialize( 64 | libfsapfs_btree_footer_t **btree_footer, 65 | libcerror_error_t **error ); 66 | 67 | int libfsapfs_btree_footer_free( 68 | libfsapfs_btree_footer_t **btree_footer, 69 | libcerror_error_t **error ); 70 | 71 | int libfsapfs_btree_footer_read_data( 72 | libfsapfs_btree_footer_t *btree_footer, 73 | const uint8_t *data, 74 | size_t data_size, 75 | libcerror_error_t **error ); 76 | 77 | #if defined( __cplusplus ) 78 | } 79 | #endif 80 | 81 | #endif /* !defined( _LIBFSAPFS_BTREE_FOOTER_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_checkpoint_map_entry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The checkpoint map entry functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_CHECKPOINT_MAP_ENTRY_H ) 23 | #define _LIBFSAPFS_CHECKPOINT_MAP_ENTRY_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsapfs_checkpoint_map_entry libfsapfs_checkpoint_map_entry_t; 35 | 36 | struct libfsapfs_checkpoint_map_entry 37 | { 38 | /* The object identifier 39 | */ 40 | uint64_t object_identifier; 41 | 42 | /* The physical address 43 | */ 44 | uint64_t physical_address; 45 | }; 46 | 47 | int libfsapfs_checkpoint_map_entry_initialize( 48 | libfsapfs_checkpoint_map_entry_t **checkpoint_map_entry, 49 | libcerror_error_t **error ); 50 | 51 | int libfsapfs_checkpoint_map_entry_free( 52 | libfsapfs_checkpoint_map_entry_t **checkpoint_map_entry, 53 | libcerror_error_t **error ); 54 | 55 | int libfsapfs_checkpoint_map_entry_read_data( 56 | libfsapfs_checkpoint_map_entry_t *checkpoint_map_entry, 57 | const uint8_t *data, 58 | size_t data_size, 59 | libcerror_error_t **error ); 60 | 61 | #if defined( __cplusplus ) 62 | } 63 | #endif 64 | 65 | #endif /* !defined( _LIBFSAPFS_CHECKPOINT_MAP_ENTRY_H ) */ 66 | 67 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_checksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Checksum functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_CHECKSUM_H ) 23 | #define _LIBFSAPFS_CHECKSUM_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | #include "libfsapfs_extern.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | LIBFSAPFS_EXTERN_VARIABLE \ 36 | uint32_t libfsapfs_checksum_crc32_table[ 256 ]; 37 | 38 | LIBFSAPFS_EXTERN_VARIABLE \ 39 | int libfsapfs_checksum_crc32_table_computed; 40 | 41 | void libfsapfs_checksum_initialize_crc32_table( 42 | uint32_t polynomial ); 43 | 44 | int libfsapfs_checksum_calculate_weak_crc32( 45 | uint32_t *checksum, 46 | const uint8_t *buffer, 47 | size_t size, 48 | uint32_t initial_value, 49 | libcerror_error_t **error ); 50 | 51 | int libfsapfs_checksum_calculate_fletcher64( 52 | uint64_t *checksum, 53 | const uint8_t *buffer, 54 | size_t size, 55 | uint64_t initial_value, 56 | libcerror_error_t **error ); 57 | 58 | #if defined( __cplusplus ) 59 | } 60 | #endif 61 | 62 | #endif /* !defined( _LIBFSAPFS_CHECKSUM_H ) */ 63 | 64 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_compressed_data_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The compressed data header functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_COMPRESSED_DATA_HEADER_H ) 23 | #define _LIBFSAPFS_COMPRESSED_DATA_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsapfs_compressed_data_header libfsapfs_compressed_data_header_t; 35 | 36 | struct libfsapfs_compressed_data_header 37 | { 38 | /* The compression method 39 | */ 40 | uint32_t compression_method; 41 | 42 | /* The uncompressed data size 43 | */ 44 | uint64_t uncompressed_data_size; 45 | }; 46 | 47 | int libfsapfs_compressed_data_header_initialize( 48 | libfsapfs_compressed_data_header_t **compressed_data_header, 49 | libcerror_error_t **error ); 50 | 51 | int libfsapfs_compressed_data_header_free( 52 | libfsapfs_compressed_data_header_t **compressed_data_header, 53 | libcerror_error_t **error ); 54 | 55 | int libfsapfs_compressed_data_header_read_data( 56 | libfsapfs_compressed_data_header_t *compressed_data_header, 57 | const uint8_t *data, 58 | size_t data_size, 59 | libcerror_error_t **error ); 60 | 61 | #if defined( __cplusplus ) 62 | } 63 | #endif 64 | 65 | #endif /* !defined( _LIBFSAPFS_COMPRESSED_DATA_HEADER_H ) */ 66 | 67 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_compression.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Compression functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_COMPRESSION_H ) 23 | #define _LIBFSAPFS_COMPRESSION_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int libfsapfs_decompress_data( 35 | const uint8_t *compressed_data, 36 | size_t compressed_data_size, 37 | int compression_method, 38 | uint8_t *uncompressed_data, 39 | size_t *uncompressed_data_size, 40 | libcerror_error_t **error ); 41 | 42 | #if defined( __cplusplus ) 43 | } 44 | #endif 45 | 46 | #endif /* !defined( _LIBFSAPFS_COMPRESSION_H ) */ 47 | 48 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_container_reaper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The container reaper functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_CONTAINER_REAPER_H ) 23 | #define _LIBFSAPFS_CONTAINER_REAPER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libbfio.h" 29 | #include "libfsapfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsapfs_container_reaper libfsapfs_container_reaper_t; 36 | 37 | struct libfsapfs_container_reaper 38 | { 39 | /* Dummy 40 | */ 41 | int dummy; 42 | }; 43 | 44 | int libfsapfs_container_reaper_initialize( 45 | libfsapfs_container_reaper_t **container_reaper, 46 | libcerror_error_t **error ); 47 | 48 | int libfsapfs_container_reaper_free( 49 | libfsapfs_container_reaper_t **container_reaper, 50 | libcerror_error_t **error ); 51 | 52 | int libfsapfs_container_reaper_read_file_io_handle( 53 | libfsapfs_container_reaper_t *container_reaper, 54 | libbfio_handle_t *file_io_handle, 55 | off64_t file_offset, 56 | libcerror_error_t **error ); 57 | 58 | int libfsapfs_container_reaper_read_data( 59 | libfsapfs_container_reaper_t *container_reaper, 60 | const uint8_t *data, 61 | size_t data_size, 62 | libcerror_error_t **error ); 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _LIBFSAPFS_CONTAINER_REAPER_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_data_block_vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The data block vector functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_DATA_BLOCK_VECTOR_H ) 23 | #define _LIBFSAPFS_DATA_BLOCK_VECTOR_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_file_system_data_handle.h" 29 | #include "libfsapfs_io_handle.h" 30 | #include "libfsapfs_libcerror.h" 31 | #include "libfsapfs_libcdata.h" 32 | #include "libfsapfs_libfdata.h" 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | int libfsapfs_data_block_vector_initialize( 39 | libfdata_vector_t **vector, 40 | libfsapfs_io_handle_t *io_handle, 41 | libfsapfs_file_system_data_handle_t *data_handle, 42 | libcdata_array_t *file_extents, 43 | uint8_t is_sparse, 44 | libcerror_error_t **error ); 45 | 46 | #if defined( __cplusplus ) 47 | } 48 | #endif 49 | 50 | #endif /* !defined( _LIBFSAPFS_DATA_BLOCK_VECTOR_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_data_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Data stream functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_DATA_STREAM_H ) 23 | #define _LIBFSAPFS_DATA_STREAM_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_encryption_context.h" 29 | #include "libfsapfs_io_handle.h" 30 | #include "libfsapfs_libcdata.h" 31 | #include "libfsapfs_libcerror.h" 32 | #include "libfsapfs_libfdata.h" 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | int libfsapfs_data_stream_initialize_from_data( 39 | libfdata_stream_t **data_stream, 40 | const uint8_t *data, 41 | size_t data_size, 42 | libcerror_error_t **error ); 43 | 44 | int libfsapfs_data_stream_initialize_from_file_extents( 45 | libfdata_stream_t **data_stream, 46 | libfsapfs_io_handle_t *io_handle, 47 | libfsapfs_encryption_context_t *encryption_context, 48 | libcdata_array_t *file_extents, 49 | size64_t data_stream_size, 50 | uint8_t is_sparse, 51 | libcerror_error_t **error ); 52 | 53 | int libfsapfs_data_stream_initialize_from_compressed_data_stream( 54 | libfdata_stream_t **data_stream, 55 | libfdata_stream_t *compressed_data_stream, 56 | size64_t uncompressed_data_size, 57 | int compression_method, 58 | libcerror_error_t **error ); 59 | 60 | #if defined( __cplusplus ) 61 | } 62 | #endif 63 | 64 | #endif /* !defined( _LIBFSAPFS_DATA_STREAM_H ) */ 65 | 66 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_INTERNAL_ERROR_H ) 23 | #define _LIBFSAPFS_INTERNAL_ERROR_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #if !defined( HAVE_LOCAL_LIBFSAPFS ) 30 | #include 31 | #endif 32 | 33 | #include "libfsapfs_extern.h" 34 | 35 | #if defined( __cplusplus ) 36 | extern "C" { 37 | #endif 38 | 39 | #if !defined( HAVE_LOCAL_LIBFSAPFS ) 40 | 41 | LIBFSAPFS_EXTERN \ 42 | void libfsapfs_error_free( 43 | libfsapfs_error_t **error ); 44 | 45 | LIBFSAPFS_EXTERN \ 46 | int libfsapfs_error_fprint( 47 | libfsapfs_error_t *error, 48 | FILE *stream ); 49 | 50 | LIBFSAPFS_EXTERN \ 51 | int libfsapfs_error_sprint( 52 | libfsapfs_error_t *error, 53 | char *string, 54 | size_t size ); 55 | 56 | LIBFSAPFS_EXTERN \ 57 | int libfsapfs_error_backtrace_fprint( 58 | libfsapfs_error_t *error, 59 | FILE *stream ); 60 | 61 | LIBFSAPFS_EXTERN \ 62 | int libfsapfs_error_backtrace_sprint( 63 | libfsapfs_error_t *error, 64 | char *string, 65 | size_t size ); 66 | 67 | #endif /* !defined( HAVE_LOCAL_LIBFSAPFS ) */ 68 | 69 | #if defined( __cplusplus ) 70 | } 71 | #endif 72 | 73 | #endif /* !defined( _LIBFSAPFS_INTERNAL_ERROR_H ) */ 74 | 75 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_extern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal extern definition 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_INTERNAL_EXTERN_H ) 23 | #define _LIBFSAPFS_INTERNAL_EXTERN_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFSAPFS for local use of libfsapfs 28 | */ 29 | #if !defined( HAVE_LOCAL_LIBFSAPFS ) 30 | 31 | #include 32 | 33 | #if defined( __CYGWIN__ ) || defined( __MINGW32__ ) 34 | #define LIBFSAPFS_EXTERN_VARIABLE extern 35 | #else 36 | #define LIBFSAPFS_EXTERN_VARIABLE LIBFSAPFS_EXTERN 37 | #endif 38 | 39 | #else 40 | #define LIBFSAPFS_EXTERN /* extern */ 41 | #define LIBFSAPFS_EXTERN_VARIABLE extern 42 | 43 | #endif /* !defined( HAVE_LOCAL_LIBFSAPFS ) */ 44 | 45 | #endif /* !defined( _LIBFSAPFS_INTERNAL_EXTERN_H ) */ 46 | 47 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_fusion_middle_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Fusion middle tree functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_FUSION_MIDDLE_TREE_H ) 23 | #define _LIBFSAPFS_FUSION_MIDDLE_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libbfio.h" 29 | #include "libfsapfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsapfs_fusion_middle_tree libfsapfs_fusion_middle_tree_t; 36 | 37 | struct libfsapfs_fusion_middle_tree 38 | { 39 | /* Dummy 40 | */ 41 | int dummy; 42 | }; 43 | 44 | int libfsapfs_fusion_middle_tree_initialize( 45 | libfsapfs_fusion_middle_tree_t **fusion_middle_tree, 46 | libcerror_error_t **error ); 47 | 48 | int libfsapfs_fusion_middle_tree_free( 49 | libfsapfs_fusion_middle_tree_t **fusion_middle_tree, 50 | libcerror_error_t **error ); 51 | 52 | int libfsapfs_fusion_middle_tree_read_file_io_handle( 53 | libfsapfs_fusion_middle_tree_t *fusion_middle_tree, 54 | libbfio_handle_t *file_io_handle, 55 | off64_t file_offset, 56 | libcerror_error_t **error ); 57 | 58 | int libfsapfs_fusion_middle_tree_read_data( 59 | libfsapfs_fusion_middle_tree_t *fusion_middle_tree, 60 | const uint8_t *data, 61 | size_t data_size, 62 | libcerror_error_t **error ); 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _LIBFSAPFS_FUSION_MIDDLE_TREE_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_key_bag_entry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The key bag entry functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_KEY_BAG_ENTRY_H ) 23 | #define _LIBFSAPFS_KEY_BAG_ENTRY_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsapfs_key_bag_entry libfsapfs_key_bag_entry_t; 35 | 36 | struct libfsapfs_key_bag_entry 37 | { 38 | /* The size 39 | */ 40 | size_t size; 41 | 42 | /* The identifier 43 | */ 44 | uint8_t identifier[ 16 ]; 45 | 46 | /* The entry type 47 | */ 48 | uint16_t type; 49 | 50 | /* The data 51 | */ 52 | uint8_t *data; 53 | 54 | /* The data size 55 | */ 56 | uint16_t data_size; 57 | }; 58 | 59 | int libfsapfs_key_bag_entry_initialize( 60 | libfsapfs_key_bag_entry_t **key_bag_entry, 61 | libcerror_error_t **error ); 62 | 63 | int libfsapfs_key_bag_entry_free( 64 | libfsapfs_key_bag_entry_t **key_bag_entry, 65 | libcerror_error_t **error ); 66 | 67 | int libfsapfs_key_bag_entry_read_data( 68 | libfsapfs_key_bag_entry_t *key_bag_entry, 69 | const uint8_t *data, 70 | size_t data_size, 71 | libcerror_error_t **error ); 72 | 73 | #if defined( __cplusplus ) 74 | } 75 | #endif 76 | 77 | #endif /* !defined( _LIBFSAPFS_KEY_BAG_ENTRY_H ) */ 78 | 79 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_key_bag_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The key bag header functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_KEY_BAG_HEADER_H ) 23 | #define _LIBFSAPFS_KEY_BAG_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsapfs_key_bag_header libfsapfs_key_bag_header_t; 35 | 36 | struct libfsapfs_key_bag_header 37 | { 38 | /* The number of entries 39 | */ 40 | uint16_t number_of_entries; 41 | 42 | /* The data size 43 | */ 44 | uint32_t data_size; 45 | }; 46 | 47 | int libfsapfs_key_bag_header_initialize( 48 | libfsapfs_key_bag_header_t **key_bag_header, 49 | libcerror_error_t **error ); 50 | 51 | int libfsapfs_key_bag_header_free( 52 | libfsapfs_key_bag_header_t **key_bag_header, 53 | libcerror_error_t **error ); 54 | 55 | int libfsapfs_key_bag_header_read_data( 56 | libfsapfs_key_bag_header_t *key_bag_header, 57 | const uint8_t *data, 58 | size_t data_size, 59 | libcerror_error_t **error ); 60 | 61 | #if defined( __cplusplus ) 62 | } 63 | #endif 64 | 65 | #endif /* !defined( _LIBFSAPFS_KEY_BAG_HEADER_H ) */ 66 | 67 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBBFIO_H ) 23 | #define _LIBFSAPFS_LIBBFIO_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio 28 | */ 29 | #if defined( HAVE_LOCAL_LIBBFIO ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT 43 | * before including libbfio.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBBFIO_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) 52 | #error Multi-threading support requires libbfio with multi-threading support 53 | #endif 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ 56 | 57 | #endif /* !defined( _LIBFSAPFS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libcaes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcaes header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCAES_H ) 23 | #define _LIBFSAPFS_LIBCAES_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCAES for local use of libcaes 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCAES ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #else 38 | 39 | /* If libtool DLL support is enabled set LIBCAES_DLL_IMPORT 40 | * before including libcaes.h 41 | */ 42 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 43 | #define LIBCAES_DLL_IMPORT 44 | #endif 45 | 46 | #include 47 | 48 | #endif /* defined( HAVE_LOCAL_LIBCAES ) */ 49 | 50 | #endif /* !defined( _LIBFSAPFS_LIBCAES_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libcdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcdata header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCDATA_H ) 23 | #define _LIBFSAPFS_LIBCDATA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCDATA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT 43 | * before including libcdata.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBCDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ 52 | 53 | #endif /* !defined( _LIBFSAPFS_LIBCDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCERROR_H ) 23 | #define _LIBFSAPFS_LIBCERROR_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCERROR ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT 39 | * before including libcerror.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCERROR_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ 48 | 49 | #endif /* !defined( _LIBFSAPFS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCLOCALE_H ) 23 | #define _LIBFSAPFS_LIBCLOCALE_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCLOCALE ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT 39 | * before including libclocale.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCLOCALE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ 48 | 49 | #endif /* !defined( _LIBFSAPFS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCNOTIFY_H ) 23 | #define _LIBFSAPFS_LIBCNOTIFY_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCNOTIFY ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT 39 | * before including libcnotify.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCNOTIFY_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ 48 | 49 | #endif /* !defined( _LIBFSAPFS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libcthreads.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcthreads header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBCTHREADS_H ) 23 | #define _LIBFSAPFS_LIBCTHREADS_H 24 | 25 | #include 26 | 27 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBFSAPFS ) 28 | #define HAVE_LIBFSAPFS_MULTI_THREAD_SUPPORT 29 | #endif 30 | 31 | #if defined( HAVE_LIBFSAPFS_MULTI_THREAD_SUPPORT ) 32 | 33 | /* Define HAVE_LOCAL_LIBCTHREADS for local use of libcthreads 34 | */ 35 | #if defined( HAVE_LOCAL_LIBCTHREADS ) 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #else 49 | 50 | /* If libtool DLL support is enabled set LIBCTHREADS_DLL_IMPORT 51 | * before including libcthreads.h 52 | */ 53 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 54 | #define LIBCTHREADS_DLL_IMPORT 55 | #endif 56 | 57 | #include 58 | 59 | #endif /* defined( HAVE_LOCAL_LIBCTHREADS ) */ 60 | 61 | #endif /* defined( HAVE_LIBFSAPFS_MULTI_THREAD_SUPPORT ) */ 62 | 63 | #endif /* !defined( _LIBFSAPFS_LIBCTHREADS_H ) */ 64 | 65 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libfcache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfcache header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBFCACHE_H ) 23 | #define _LIBFSAPFS_LIBFCACHE_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFCACHE ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBFCACHE_DLL_IMPORT 39 | * before including libfcache.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBFCACHE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ 48 | 49 | #endif /* !defined( _LIBFSAPFS_LIBFCACHE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBFDATA_H ) 23 | #define _LIBFSAPFS_LIBFDATA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFDATA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBFDATA_DLL_IMPORT 43 | * before including libfdata.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBFDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ 52 | 53 | #endif /* !defined( _LIBFSAPFS_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBFDATETIME_H ) 23 | #define _LIBFSAPFS_LIBFDATETIME_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFDATETIME for local use of libfdatetime 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFDATETIME ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #else 43 | 44 | /* If libtool DLL support is enabled set LIBFDATETIME_DLL_IMPORT 45 | * before including libfdatetime.h 46 | */ 47 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 48 | #define LIBFDATETIME_DLL_IMPORT 49 | #endif 50 | 51 | #include 52 | 53 | #endif /* defined( HAVE_LOCAL_LIBFDATETIME ) */ 54 | 55 | #endif /* !defined( _LIBFSAPFS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBFGUID_H ) 23 | #define _LIBFSAPFS_LIBFGUID_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFGUID for local use of libfguid 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFGUID ) 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #else 36 | 37 | /* If libtool DLL support is enabled set LIBFGUID_DLL_IMPORT 38 | * before including libfguid.h 39 | */ 40 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 41 | #define LIBFGUID_DLL_IMPORT 42 | #endif 43 | 44 | #include 45 | 46 | #endif /* defined( HAVE_LOCAL_LIBFGUID ) */ 47 | 48 | #endif /* !defined( _LIBFSAPFS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libfmos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfmos header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBFMOS_H ) 23 | #define _LIBFSAPFS_LIBFMOS_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFMOS for local use of libfmos 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFMOS ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #else 38 | 39 | /* If libtool DLL support is enabled set LIBFMOS_DLL_IMPORT 40 | * before including libfmos.h 41 | */ 42 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 43 | #define LIBFMOS_DLL_IMPORT 44 | #endif 45 | 46 | #include 47 | 48 | #endif /* defined( HAVE_LOCAL_LIBFMOS ) */ 49 | 50 | #endif /* !defined( _LIBFSAPFS_LIBFMOS_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libhmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal libhmac header 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBHMAC_H ) 23 | #define _LIBFSAPFS_LIBHMAC_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBHMAC for local use of libhmac 28 | */ 29 | #if defined( HAVE_LOCAL_LIBHMAC ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #else 40 | 41 | /* If libtool DLL support is enabled set LIBHMAC_DLL_IMPORT 42 | * before including libhmac.h 43 | */ 44 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 45 | #define LIBHMAC_DLL_IMPORT 46 | #endif 47 | 48 | #include 49 | 50 | #endif 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_LIBUNA_H ) 23 | #define _LIBFSAPFS_LIBUNA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBUNA for local use of libuna 28 | */ 29 | #if defined( HAVE_LOCAL_LIBUNA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #else 47 | 48 | /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT 49 | * before including libuna.h 50 | */ 51 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 52 | #define LIBUNA_DLL_IMPORT 53 | #endif 54 | 55 | #include 56 | 57 | #endif /* defined( HAVE_LOCAL_LIBUNA ) */ 58 | 59 | #endif /* !defined( _LIBFSAPFS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_name_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Name hash functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_NAME_HASH_H ) 23 | #define _LIBFSAPFS_NAME_HASH_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int libfsapfs_name_hash_calculate_from_utf8_string( 35 | uint32_t *name_hash, 36 | const uint8_t *utf8_string, 37 | size_t utf8_string_length, 38 | uint8_t use_case_folding, 39 | libcerror_error_t **error ); 40 | 41 | int libfsapfs_name_hash_calculate_from_utf16_string( 42 | uint32_t *name_hash, 43 | const uint16_t *utf16_string, 44 | size_t utf16_string_length, 45 | uint8_t use_case_folding, 46 | libcerror_error_t **error ); 47 | 48 | #if defined( __cplusplus ) 49 | } 50 | #endif 51 | 52 | #endif /* !defined( _LIBFSAPFS_NAME_HASH_H ) */ 53 | 54 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Notification functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_NOTIFY_H ) 23 | #define _LIBFSAPFS_NOTIFY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "libfsapfs_extern.h" 30 | #include "libfsapfs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | #if !defined( HAVE_LOCAL_LIBFSAPFS ) 37 | 38 | LIBFSAPFS_EXTERN \ 39 | void libfsapfs_notify_set_verbose( 40 | int verbose ); 41 | 42 | LIBFSAPFS_EXTERN \ 43 | int libfsapfs_notify_set_stream( 44 | FILE *stream, 45 | libcerror_error_t **error ); 46 | 47 | LIBFSAPFS_EXTERN \ 48 | int libfsapfs_notify_stream_open( 49 | const char *filename, 50 | libcerror_error_t **error ); 51 | 52 | LIBFSAPFS_EXTERN \ 53 | int libfsapfs_notify_stream_close( 54 | libcerror_error_t **error ); 55 | 56 | #endif /* !defined( HAVE_LOCAL_LIBFSAPFS ) */ 57 | 58 | #if defined( __cplusplus ) 59 | } 60 | #endif 61 | 62 | #endif /* !defined( _LIBFSAPFS_NOTIFY_H ) */ 63 | 64 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_object.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The APFS object functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_OBJECT_H ) 23 | #define _LIBFSAPFS_OBJECT_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libbfio.h" 29 | #include "libfsapfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsapfs_object libfsapfs_object_t; 36 | 37 | struct libfsapfs_object 38 | { 39 | /* The identifier 40 | */ 41 | uint64_t identifier; 42 | 43 | /* The transaction identifier 44 | */ 45 | uint64_t transaction_identifier; 46 | 47 | /* The type 48 | */ 49 | uint32_t type; 50 | 51 | /* The subtype 52 | */ 53 | uint32_t subtype; 54 | }; 55 | 56 | int libfsapfs_object_initialize( 57 | libfsapfs_object_t **object, 58 | libcerror_error_t **error ); 59 | 60 | int libfsapfs_object_free( 61 | libfsapfs_object_t **object, 62 | libcerror_error_t **error ); 63 | 64 | int libfsapfs_object_read_file_io_handle( 65 | libfsapfs_object_t *object, 66 | libbfio_handle_t *file_io_handle, 67 | off64_t file_offset, 68 | libcerror_error_t **error ); 69 | 70 | int libfsapfs_object_read_data( 71 | libfsapfs_object_t *object, 72 | const uint8_t *data, 73 | size_t data_size, 74 | libcerror_error_t **error ); 75 | 76 | #if defined( __cplusplus ) 77 | } 78 | #endif 79 | 80 | #endif /* !defined( _LIBFSAPFS_OBJECT_H ) */ 81 | 82 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_password.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Password functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_PASSWORD_H ) 23 | #define _LIBFSAPFS_PASSWORD_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int libfsapfs_password_pbkdf2( 35 | const uint8_t *password, 36 | size_t password_size, 37 | const uint8_t *salt, 38 | size_t salt_size, 39 | uint32_t number_of_iterations, 40 | uint8_t *output_data, 41 | size_t output_data_size, 42 | libcerror_error_t **error ); 43 | 44 | #if defined( __cplusplus ) 45 | } 46 | #endif 47 | 48 | #endif /* !defined( _LIBFSAPFS_PASSWORD_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_space_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The space manager functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_SPACE_MANAGER_H ) 23 | #define _LIBFSAPFS_SPACE_MANAGER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsapfs_libbfio.h" 29 | #include "libfsapfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsapfs_space_manager libfsapfs_space_manager_t; 36 | 37 | struct libfsapfs_space_manager 38 | { 39 | /* Dummy 40 | */ 41 | int dummy; 42 | }; 43 | 44 | int libfsapfs_space_manager_initialize( 45 | libfsapfs_space_manager_t **space_manager, 46 | libcerror_error_t **error ); 47 | 48 | int libfsapfs_space_manager_free( 49 | libfsapfs_space_manager_t **space_manager, 50 | libcerror_error_t **error ); 51 | 52 | int libfsapfs_space_manager_read_file_io_handle( 53 | libfsapfs_space_manager_t *space_manager, 54 | libbfio_handle_t *file_io_handle, 55 | off64_t file_offset, 56 | libcerror_error_t **error ); 57 | 58 | int libfsapfs_space_manager_read_data( 59 | libfsapfs_space_manager_t *space_manager, 60 | const uint8_t *data, 61 | size_t data_size, 62 | libcerror_error_t **error ); 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _LIBFSAPFS_SPACE_MANAGER_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal type definitions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_INTERNAL_TYPES_H ) 23 | #define _LIBFSAPFS_INTERNAL_TYPES_H 24 | 25 | #include 26 | #include 27 | 28 | /* Define HAVE_LOCAL_LIBFSAPFS for local use of libfsapfs 29 | * The definitions in are copied here 30 | * for local use of libfsapfs 31 | */ 32 | #if defined( HAVE_LOCAL_LIBFSAPFS ) 33 | 34 | /* The following type definitions hide internal data structures 35 | */ 36 | #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) 37 | typedef struct libfsapfs_container {} libfsapfs_container_t; 38 | typedef struct libfsapfs_extended_attribute {} libfsapfs_extended_attribute_t; 39 | typedef struct libfsapfs_file_entry {} libfsapfs_file_entry_t; 40 | typedef struct libfsapfs_snapshot {} libfsapfs_snapshot_t; 41 | typedef struct libfsapfs_volume {} libfsapfs_volume_t; 42 | 43 | #else 44 | typedef intptr_t libfsapfs_container_t; 45 | typedef intptr_t libfsapfs_extended_attribute_t; 46 | typedef intptr_t libfsapfs_file_entry_t; 47 | typedef intptr_t libfsapfs_snapshot_t; 48 | typedef intptr_t libfsapfs_volume_t; 49 | 50 | #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ 51 | 52 | #endif /* defined( HAVE_LOCAL_LIBFSAPFS ) */ 53 | 54 | #endif /* !defined( _LIBFSAPFS_INTERNAL_TYPES_H ) */ 55 | 56 | -------------------------------------------------------------------------------- /libfsapfs/libfsapfs_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _LIBFSAPFS_UNUSED_H ) 23 | #define _LIBFSAPFS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( LIBFSAPFS_ATTRIBUTE_UNUSED ) 28 | #if defined( __GNUC__ ) && __GNUC__ >= 3 29 | #define LIBFSAPFS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 30 | #else 31 | #define LIBFSAPFS_ATTRIBUTE_UNUSED 32 | #endif 33 | #endif 34 | 35 | #if defined( _MSC_VER ) 36 | #define LIBFSAPFS_UNREFERENCED_PARAMETER( parameter ) \ 37 | UNREFERENCED_PARAMETER( parameter ); 38 | #else 39 | #define LIBFSAPFS_UNREFERENCED_PARAMETER( parameter ) \ 40 | /* parameter */ 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSAPFS_UNUSED_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /m4/tests.m4: -------------------------------------------------------------------------------- 1 | dnl Functions for testing 2 | dnl 3 | dnl Version: 20200712 4 | 5 | dnl Function to detect if tests dependencies are available 6 | AC_DEFUN([AX_TESTS_CHECK_LOCAL], 7 | [AC_CHECK_HEADERS([dlfcn.h]) 8 | 9 | AC_CHECK_FUNCS([fmemopen getopt mkstemp setenv tzset unlink]) 10 | 11 | AC_CHECK_LIB( 12 | dl, 13 | dlsym) 14 | 15 | AS_IF( 16 | [test "x$lt_cv_prog_gnu_ld" = xyes && test "x$ac_cv_lib_dl_dlsym" = xyes], 17 | [AC_DEFINE( 18 | [HAVE_GNU_DL_DLSYM], 19 | [1], 20 | [Define to 1 if dlsym function is available in GNU dl.]) 21 | ]) 22 | ]) 23 | 24 | dnl Function to detect if OSS-Fuzz build environment is available 25 | AC_DEFUN([AX_TESTS_CHECK_OSSFUZZ], 26 | [AM_CONDITIONAL( 27 | HAVE_LIB_FUZZING_ENGINE, 28 | [test "x${LIB_FUZZING_ENGINE}" != x]) 29 | AC_SUBST( 30 | [LIB_FUZZING_ENGINE], 31 | ["${LIB_FUZZING_ENGINE}"]) 32 | ]) 33 | 34 | -------------------------------------------------------------------------------- /manuals/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = \ 2 | fsapfsinfo.1 \ 3 | fsapfsmount.1 \ 4 | libfsapfs.3 5 | 6 | EXTRA_DIST = \ 7 | fsapfsinfo.1 \ 8 | fsapfsmount.1 \ 9 | libfsapfs.3 10 | 11 | DISTCLEANFILES = \ 12 | Makefile \ 13 | Makefile.in 14 | 15 | -------------------------------------------------------------------------------- /manuals/fsapfsmount.1: -------------------------------------------------------------------------------- 1 | .Dd May 20, 2024 2 | .Dt fsapfsmount 3 | .Os libfsapfs 4 | .Sh NAME 5 | .Nm fsapfsmount 6 | .Nd mounts an Apple File System (APFS) container 7 | .Sh SYNOPSIS 8 | .Nm fsapfsmount 9 | .Op Fl f Ar file_system_index 10 | .Op Fl o Ar offset 11 | .Op Fl p Ar password 12 | .Op Fl r Ar password 13 | .Op Fl hvV 14 | .Ar source 15 | .Sh DESCRIPTION 16 | .Nm fsapfsmount 17 | is a utility to mount an Apple File System (APFS) container 18 | .Pp 19 | .Nm fsapfsmount 20 | is part of the 21 | .Nm libfsapfs 22 | package. 23 | .Nm libfsapfs 24 | is a library to access the Apple File System (APFS) format 25 | .Pp 26 | .Ar source 27 | is the source file. 28 | .Pp 29 | The options are as follows: 30 | .Bl -tag -width Ds 31 | .It Fl f Ar file_system_index 32 | specify a specific file system or "all" 33 | .It Fl h 34 | shows this help 35 | .It Fl o Ar offset 36 | specify the container offset in bytes 37 | .It Fl p Ar password 38 | specify the password 39 | .It Fl r Ar password 40 | specify the recovery password 41 | .It Fl v 42 | verbose output to stderr 43 | .It Fl V 44 | print version 45 | .It Fl X Ar extended_options 46 | extended options to pass to sub system 47 | .El 48 | .Sh ENVIRONMENT 49 | None 50 | .Sh FILES 51 | None 52 | .Sh EXAMPLES 53 | .Bd -literal 54 | # fsapfsmount -f 1 -p Password /dev/sda1 55 | fsapfsmount 20181214 56 | .sp 57 | .Ed 58 | .Sh DIAGNOSTICS 59 | Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. 60 | Verbose and debug output are only printed when enabled at compilation. 61 | .Sh BUGS 62 | Please report bugs of any kind to or on the project website: 63 | https://github.com/libyal/libfsapfs/ 64 | .Sh AUTHOR 65 | These man pages were written by Joachim Metz. 66 | .Sh COPYRIGHT 67 | Copyright (C) 2018-2024, Joachim Metz . 68 | This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 69 | .Sh SEE ALSO 70 | .Xr fsapfsinfo 1 71 | -------------------------------------------------------------------------------- /ossfuzz/ossfuzz_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _OSSFUZZ_LIBBFIO_H ) 23 | #define _OSSFUZZ_LIBBFIO_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio 28 | */ 29 | #if defined( HAVE_LOCAL_LIBBFIO ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT 43 | * before including libbfio.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 46 | #define LIBBFIO_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) 52 | #error Multi-threading support requires libbfio with multi-threading support 53 | #endif 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ 56 | 57 | #endif /* !defined( _OSSFUZZ_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /ossfuzz/ossfuzz_libfsapfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsapfs header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _OSSFUZZ_LIBFSAPFS_H ) 23 | #define _OSSFUZZ_LIBFSAPFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _OSSFUZZ_LIBFSAPFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2016-11-09 gettextize 2 | -------------------------------------------------------------------------------- /po/Makevars.in: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = @PACKAGE@ 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Joachim Metz 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = @PACKAGE_BUGREPORT@ 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | 43 | # Additional make targets. 44 | sources splint: 45 | 46 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files which contain translatable strings. 2 | -------------------------------------------------------------------------------- /pyfsapfs/Makefile.am: -------------------------------------------------------------------------------- 1 | if HAVE_PYTHON 2 | AM_CFLAGS = \ 3 | -I../include -I$(top_srcdir)/include \ 4 | -I../common -I$(top_srcdir)/common \ 5 | @LIBCERROR_CPPFLAGS@ \ 6 | @LIBCDATA_CPPFLAGS@ \ 7 | @LIBCLOCALE_CPPFLAGS@ \ 8 | @LIBCSPLIT_CPPFLAGS@ \ 9 | @LIBUNA_CPPFLAGS@ \ 10 | @LIBCFILE_CPPFLAGS@ \ 11 | @LIBCPATH_CPPFLAGS@ \ 12 | @LIBBFIO_CPPFLAGS@ \ 13 | @LIBFGUID_CPPFLAGS@ \ 14 | @LIBFSAPFS_DLL_IMPORT@ 15 | 16 | pyexec_LTLIBRARIES = pyfsapfs.la 17 | 18 | pyfsapfs_la_SOURCES = \ 19 | pyfsapfs.c pyfsapfs.h \ 20 | pyfsapfs_container.c pyfsapfs_container.h \ 21 | pyfsapfs_datetime.c pyfsapfs_datetime.h \ 22 | pyfsapfs_error.c pyfsapfs_error.h \ 23 | pyfsapfs_extended_attribute.c pyfsapfs_extended_attribute.h \ 24 | pyfsapfs_extended_attributes.c pyfsapfs_extended_attributes.h \ 25 | pyfsapfs_file_entries.c pyfsapfs_file_entries.h \ 26 | pyfsapfs_file_entry.c pyfsapfs_file_entry.h \ 27 | pyfsapfs_file_object_io_handle.c pyfsapfs_file_object_io_handle.h \ 28 | pyfsapfs_guid.c pyfsapfs_guid.h \ 29 | pyfsapfs_integer.c pyfsapfs_integer.h \ 30 | pyfsapfs_libbfio.h \ 31 | pyfsapfs_libcerror.h \ 32 | pyfsapfs_libclocale.h \ 33 | pyfsapfs_libfguid.h \ 34 | pyfsapfs_libfsapfs.h \ 35 | pyfsapfs_python.h \ 36 | pyfsapfs_unused.h \ 37 | pyfsapfs_volume.c pyfsapfs_volume.h \ 38 | pyfsapfs_volumes.c pyfsapfs_volumes.h 39 | 40 | pyfsapfs_la_LIBADD = \ 41 | @LIBCERROR_LIBADD@ \ 42 | ../libfsapfs/libfsapfs.la \ 43 | @LIBCDATA_LIBADD@ \ 44 | @LIBCLOCALE_LIBADD@ \ 45 | @LIBCSPLIT_LIBADD@ \ 46 | @LIBUNA_LIBADD@ \ 47 | @LIBCFILE_LIBADD@ \ 48 | @LIBCPATH_LIBADD@ \ 49 | @LIBBFIO_LIBADD@ \ 50 | @LIBFGUID_LIBADD@ 51 | 52 | pyfsapfs_la_CPPFLAGS = $(PYTHON_CPPFLAGS) 53 | pyfsapfs_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) 54 | 55 | endif 56 | 57 | DISTCLEANFILES = \ 58 | Makefile \ 59 | Makefile.in 60 | 61 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Python bindings module for libfsapfs (pyfsapfs) 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_H ) 23 | #define _PYFSAPFS_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfsapfs_python.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | PyObject *pyfsapfs_get_version( 35 | PyObject *self, 36 | PyObject *arguments ); 37 | 38 | PyObject *pyfsapfs_check_container_signature( 39 | PyObject *self, 40 | PyObject *arguments, 41 | PyObject *keywords ); 42 | 43 | PyObject *pyfsapfs_check_container_signature_file_object( 44 | PyObject *self, 45 | PyObject *arguments, 46 | PyObject *keywords ); 47 | 48 | PyObject *pyfsapfs_open_new_container( 49 | PyObject *self, 50 | PyObject *arguments, 51 | PyObject *keywords ); 52 | 53 | PyObject *pyfsapfs_open_new_container_with_file_object( 54 | PyObject *self, 55 | PyObject *arguments, 56 | PyObject *keywords ); 57 | 58 | #if PY_MAJOR_VERSION >= 3 59 | PyMODINIT_FUNC PyInit_pyfsapfs( 60 | void ); 61 | #else 62 | PyMODINIT_FUNC initpyfsapfs( 63 | void ); 64 | #endif 65 | 66 | #if defined( __cplusplus ) 67 | } 68 | #endif 69 | 70 | #endif /* !defined( _PYFSAPFS_H ) */ 71 | 72 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_datetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Date and time functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_DATETIME_H ) 23 | #define _PYFSAPFS_DATETIME_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfsapfs_python.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | PyObject *pyfsapfs_datetime_new_from_time_elements( 35 | uint16_t year, 36 | uint64_t number_of_days, 37 | uint8_t hours, 38 | uint8_t minutes, 39 | uint8_t seconds, 40 | uint32_t micro_seconds ); 41 | 42 | PyObject *pyfsapfs_datetime_new_from_fat_date_time( 43 | uint32_t fat_date_time ); 44 | 45 | PyObject *pyfsapfs_datetime_new_from_filetime( 46 | uint64_t filetime ); 47 | 48 | PyObject *pyfsapfs_datetime_new_from_floatingtime( 49 | uint64_t floatingtime ); 50 | 51 | PyObject *pyfsapfs_datetime_new_from_hfs_time( 52 | uint32_t hfs_time ); 53 | 54 | PyObject *pyfsapfs_datetime_new_from_posix_time( 55 | int64_t posix_time ); 56 | 57 | PyObject *pyfsapfs_datetime_new_from_posix_time_in_micro_seconds( 58 | int64_t posix_time ); 59 | 60 | #if defined( __cplusplus ) 61 | } 62 | #endif 63 | 64 | #endif /* !defined( _PYFSAPFS_DATETIME_H ) */ 65 | 66 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_ERROR_H ) 23 | #define _PYFSAPFS_ERROR_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfsapfs_libcerror.h" 29 | #include "pyfsapfs_python.h" 30 | 31 | #define PYFSAPFS_ERROR_STRING_SIZE 2048 32 | 33 | #if defined( __cplusplus ) 34 | extern "C" { 35 | #endif 36 | 37 | void pyfsapfs_error_fetch( 38 | libcerror_error_t **error, 39 | int error_domain, 40 | int error_code, 41 | const char *format_string, 42 | ... ); 43 | 44 | void pyfsapfs_error_fetch_and_raise( 45 | PyObject *exception_object, 46 | const char *format_string, 47 | ... ); 48 | 49 | void pyfsapfs_error_raise( 50 | libcerror_error_t *error, 51 | PyObject *exception_object, 52 | const char *format_string, 53 | ... ); 54 | 55 | #if defined( __cplusplus ) 56 | } 57 | #endif 58 | 59 | #endif /* !defined( _PYFSAPFS_ERROR_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_guid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GUID functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_GUID_H ) 23 | #define _PYFSAPFS_GUID_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfsapfs_python.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | PyObject *pyfsapfs_string_new_from_guid( 35 | const uint8_t *guid_buffer, 36 | size_t guid_buffer_size ); 37 | 38 | #if defined( __cplusplus ) 39 | } 40 | #endif 41 | 42 | #endif /* !defined( _PYFSAPFS_GUID_H ) */ 43 | 44 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Integer functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_INTEGER_H ) 23 | #define _PYFSAPFS_INTEGER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfsapfs_libcerror.h" 29 | #include "pyfsapfs_python.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | PyObject *pyfsapfs_integer_signed_new_from_64bit( 36 | int64_t value_64bit ); 37 | 38 | PyObject *pyfsapfs_integer_unsigned_new_from_64bit( 39 | uint64_t value_64bit ); 40 | 41 | int pyfsapfs_integer_signed_copy_to_64bit( 42 | PyObject *integer_object, 43 | int64_t *value_64bit, 44 | libcerror_error_t **error ); 45 | 46 | int pyfsapfs_integer_unsigned_copy_to_64bit( 47 | PyObject *integer_object, 48 | uint64_t *value_64bit, 49 | libcerror_error_t **error ); 50 | 51 | #if defined( __cplusplus ) 52 | } 53 | #endif 54 | 55 | #endif /* !defined( _PYFSAPFS_INTEGER_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_LIBBFIO_H ) 23 | #define _PYFSAPFS_LIBBFIO_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio 28 | */ 29 | #if defined( HAVE_LOCAL_LIBBFIO ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT 43 | * before including libbfio.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBBFIO_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ 52 | 53 | #endif /* !defined( _PYFSAPFS_LIBBFIO_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_LIBCERROR_H ) 23 | #define _PYFSAPFS_LIBCERROR_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCERROR ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT 39 | * before including libcerror.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCERROR_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ 48 | 49 | #endif /* !defined( _PYFSAPFS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_LIBCLOCALE_H ) 23 | #define _PYFSAPFS_LIBCLOCALE_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCLOCALE ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT 39 | * before including libclocale.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCLOCALE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ 48 | 49 | #endif /* !defined( _PYFSAPFS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_LIBFGUID_H ) 23 | #define _PYFSAPFS_LIBFGUID_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFGUID for local use of libfguid 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFGUID ) 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #else 36 | 37 | /* If libtool DLL support is enabled set LIBFGUID_DLL_IMPORT 38 | * before including libfguid.h 39 | */ 40 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 41 | #define LIBFGUID_DLL_IMPORT 42 | #endif 43 | 44 | #include 45 | 46 | #endif 47 | 48 | #endif /* !defined( _PYFSAPFS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_libfsapfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal libfsapfs header 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_LIBFSAPFS_H ) 23 | #define _PYFSAPFS_LIBFSAPFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _PYFSAPFS_LIBFSAPFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /pyfsapfs/pyfsapfs_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _PYFSAPFS_UNUSED_H ) 23 | #define _PYFSAPFS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( PYFSAPFS_ATTRIBUTE_UNUSED ) 28 | #if defined( __GNUC__ ) && __GNUC__ >= 3 29 | #define PYFSAPFS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 30 | #else 31 | #define PYFSAPFS_ATTRIBUTE_UNUSED 32 | #endif 33 | #endif 34 | 35 | #if defined( _MSC_VER ) 36 | #define PYFSAPFS_UNREFERENCED_PARAMETER( parameter ) \ 37 | UNREFERENCED_PARAMETER( parameter ); 38 | #else 39 | #define PYFSAPFS_UNREFERENCED_PARAMETER( parameter ) \ 40 | /* parameter */ 41 | #endif 42 | 43 | #endif /* !defined( _PYFSAPFS_UNUSED_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | -------------------------------------------------------------------------------- /runtests.ps1: -------------------------------------------------------------------------------- 1 | # Script that runs the tests 2 | # 3 | # Version: 20220103 4 | 5 | $ExitSuccess = 0 6 | $ExitFailure = 1 7 | $ExitIgnore = 77 8 | 9 | Set-Location -Path "tests" 10 | 11 | $Result = ${ExitSuccess} 12 | 13 | $Lines = Get-Content "Makefile.am" 14 | $InTests = $FALSE 15 | 16 | Foreach (${Line} in ${Lines}) 17 | { 18 | If (${InTests}) 19 | { 20 | If (-Not ${Line}) 21 | { 22 | ${InTests} = $FALSE 23 | 24 | Continue 25 | } 26 | ${Line} = ${Line}.TrimStart() 27 | 28 | If (${Line}.EndsWith(" \")) 29 | { 30 | ${Line} = ${Line}.Substring(0, ${Line}.Length - 2) 31 | } 32 | If (-Not (${Line}.EndsWith(".sh"))) 33 | { 34 | Continue 35 | } 36 | ${Line} = ${Line}.Substring(0, ${Line}.Length - 3) 37 | ${Line} = ".\${Line}.ps1" 38 | 39 | Try 40 | { 41 | Invoke-Expression ${Line} 42 | } 43 | Catch 44 | { 45 | $LastExitCode = ${ExitIgnore} 46 | } 47 | If (${LastExitCode} -eq ${ExitFailure}) 48 | { 49 | $Result = ${ExitFailure} 50 | Write-Host "FAIL" -foreground Red -nonewline 51 | } 52 | ElseIf (${LastExitCode} -eq ${ExitIgnore}) 53 | { 54 | Write-Host "SKIP" -foreground Cyan -nonewline 55 | } 56 | Else 57 | { 58 | Write-Host "PASS" -foreground Green -nonewline 59 | } 60 | Write-Host ": ${Line}" 61 | } 62 | ElseIf (${Line}.StartsWith("TESTS = ")) 63 | { 64 | ${InTests} = $TRUE 65 | } 66 | } 67 | 68 | Set-Location -Path ".." 69 | 70 | Exit ${Result} 71 | -------------------------------------------------------------------------------- /setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = libfsapfs-python 3 | version = @VERSION@ 4 | description = Python bindings module for libfsapfs 5 | long_description = Python bindings module for libfsapfs 6 | long_description_content_type = text/plain 7 | author = Joachim Metz 8 | author_email = joachim.metz@gmail.com 9 | license = GNU Lesser General Public License v3 or later (LGPLv3+) 10 | license_files = COPYING COPYING.LESSER 11 | classifiers = 12 | Development Status :: 2 - Pre-Alpha 13 | Programming Language :: Python 14 | 15 | [options] 16 | python_requires = >=3.7 17 | -------------------------------------------------------------------------------- /syncdokan.ps1: -------------------------------------------------------------------------------- 1 | # Script that synchronizes dokan 2 | # 3 | # Version: 20190810 4 | 5 | Param ( 6 | [switch]$UseHead = $false, 7 | [switch]$UseLegacyVersion = $false 8 | ) 9 | 10 | $Git = "git" 11 | 12 | If (${UseLegacyVersion}) 13 | { 14 | # Patched version of dokan 0.6.0 15 | $GitUrl = "https://github.com/joachimmetz/dokan.git" 16 | $Destination = "..\dokan" 17 | } 18 | Else 19 | { 20 | $GitUrl = "https://github.com/dokan-dev/dokany.git" 21 | $Destination = "..\dokany" 22 | } 23 | 24 | # PowerShell will raise NativeCommandError if git writes to stdout or stderr 25 | # therefore 2>&1 is added and the output is stored in a variable. 26 | $Output = Invoke-Expression -Command "${Git} clone ${GitUrl} ${Destination} 2>&1" 27 | 28 | Push-Location ${Destination} 29 | 30 | Try 31 | { 32 | $Output = Invoke-Expression -Command "${Git} fetch --quiet --all --tags --prune 2>&1" 33 | 34 | $LatestTag = Invoke-Expression -Command "${Git} describe --tags --abbrev=0 2>&1" 35 | 36 | If (${LatestTag} -and -not ${UseHead}) 37 | { 38 | Write-Host "Synchronizing: dokan from ${GitUrl} tag ${LatestTag}" 39 | 40 | $Output = Invoke-Expression -Command "${Git} checkout --quiet tags/${LatestTag} 2>&1" 41 | } 42 | Else 43 | { 44 | Write-Host "Synchronizing: dokan from ${GitUrl} HEAD" 45 | } 46 | If (-Not ${UseLegacyVersion}) 47 | { 48 | # AppVeyor does not come with platform toolset version 142 49 | ((Get-Content -Path "..\dokany\dokan\dokan.vcxproj" -Raw) -Replace 'v142','v141') | Set-Content -Path "..\dokany\dokan\dokan.vcxproj" 50 | } 51 | } 52 | Finally 53 | { 54 | Pop-Location 55 | } 56 | 57 | -------------------------------------------------------------------------------- /synctestdata.ps1: -------------------------------------------------------------------------------- 1 | # Script that synchronizes the local test data 2 | # 3 | # Version: 20230709 4 | 5 | $TestSet = "public" 6 | $TestInputDirectory = "tests/input" 7 | $TestFiles = "apfs.raw" 8 | 9 | If (-Not (Test-Path ${TestInputDirectory})) 10 | { 11 | New-Item -Name ${TestInputDirectory} -ItemType "directory" | Out-Null 12 | } 13 | If (-Not (Test-Path "${TestInputDirectory}\${TestSet}")) 14 | { 15 | New-Item -Name "${TestInputDirectory}\${TestSet}" -ItemType "directory" | Out-Null 16 | } 17 | ForEach ($TestFile in ${TestFiles} -split " ") 18 | { 19 | $Url = "https://github.com/log2timeline/dfvfs/blob/main/test_data/${TestFile}?raw=true" 20 | 21 | Invoke-WebRequest -Uri ${Url} -OutFile "${TestInputDirectory}\${TestSet}\${TestFile}" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /synctestdata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script that synchronizes the local test data 3 | # 4 | # Version: 20161009 5 | 6 | TEST_SET="public"; 7 | TEST_INPUT_DIRECTORY="tests/input"; 8 | TEST_FILES="apfs.raw"; 9 | 10 | mkdir -p "${TEST_INPUT_DIRECTORY}/${TEST_SET}"; 11 | 12 | for TEST_FILE in ${TEST_FILES}; 13 | do 14 | URL="https://github.com/log2timeline/dfvfs/blob/main/test_data/${TEST_FILE}?raw=true"; 15 | 16 | curl -L -o "${TEST_INPUT_DIRECTORY}/${TEST_SET}/${TEST_FILE}" ${URL}; 17 | done 18 | 19 | -------------------------------------------------------------------------------- /synczlib.ps1: -------------------------------------------------------------------------------- 1 | # Script that synchronizes zlib. 2 | # 3 | # Version: 20240305 4 | 5 | Function ExtractZip($Filename) 6 | { 7 | # AppVeyor does not seem to support extraction using "native ZIP" so we use 7z instead. 8 | $SevenZip = "C:\Program Files\7-Zip\7z.exe" 9 | 10 | If (Test-Path ${SevenZip}) 11 | { 12 | # PowerShell will raise NativeCommandError if 7z writes to stdout or stderr 13 | # therefore 2>&1 is added and the output is stored in a variable. 14 | # The leading & and single quotes are necessary to compensate for the spaces in the path. 15 | $Output = Invoke-Expression -Command "& '${SevenZip}' -y x ${Filename} 2>&1" 16 | } 17 | else 18 | { 19 | $Shell = New-Object -ComObject Shell.Application 20 | $Archive = ${Shell}.NameSpace(${Filename}) 21 | $Directory = ${Shell}.Namespace("${pwd}") 22 | 23 | ForEach($FileEntry in ${Archive}.items()) 24 | { 25 | ${Directory}.CopyHere(${FileEntry}) 26 | } 27 | } 28 | } 29 | 30 | $Filename = "${pwd}\zlib131.zip" 31 | $Url = "https://zlib.net/zlib131.zip" 32 | $ExtractedPath = "zlib-1.3.1" 33 | $DestinationPath = "..\zlib" 34 | 35 | If (Test-Path ${Filename}) 36 | { 37 | Remove-Item -Path ${Filename} -Force 38 | } 39 | Invoke-WebRequest -Uri ${Url} -OutFile ${Filename} 40 | 41 | If (Test-Path ${ExtractedPath}) 42 | { 43 | Remove-Item -Path ${ExtractedPath} -Force -Recurse 44 | } 45 | ExtractZip -Filename ${Filename} 46 | 47 | Remove-Item -Path ${Filename} -Force 48 | 49 | If (Test-Path ${DestinationPath}) 50 | { 51 | Remove-Item -Path ${DestinationPath} -Force -Recurse 52 | } 53 | Move-Item ${ExtractedPath} ${DestinationPath} 54 | 55 | -------------------------------------------------------------------------------- /tests/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script to build from source 3 | # 4 | # Version: 20201121 5 | 6 | set -e 7 | 8 | ./synclibs.sh --use-head 9 | ./autogen.sh 10 | ./configure "$@" 11 | make > /dev/null 12 | 13 | -------------------------------------------------------------------------------- /tests/data/btree_footer.1: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/data/btree_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/btree_header.1 -------------------------------------------------------------------------------- /tests/data/btree_node.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/btree_node.1 -------------------------------------------------------------------------------- /tests/data/checkpoint_map.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/checkpoint_map.1 -------------------------------------------------------------------------------- /tests/data/checkpoint_map_entry.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/checkpoint_map_entry.1 -------------------------------------------------------------------------------- /tests/data/chunk_information_block.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/chunk_information_block.1 -------------------------------------------------------------------------------- /tests/data/container_object_map.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/container_object_map.1 -------------------------------------------------------------------------------- /tests/data/container_object_map_btree.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/container_object_map_btree.1 -------------------------------------------------------------------------------- /tests/data/container_reaper.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/container_reaper.1 -------------------------------------------------------------------------------- /tests/data/container_space_manager.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/container_space_manager.1 -------------------------------------------------------------------------------- /tests/data/container_superblock.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/container_superblock.1 -------------------------------------------------------------------------------- /tests/data/file_system_btree.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/file_system_btree.1 -------------------------------------------------------------------------------- /tests/data/inode.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/inode.1 -------------------------------------------------------------------------------- /tests/data/key_bag_entry.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/key_bag_entry.1 -------------------------------------------------------------------------------- /tests/data/key_bag_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/key_bag_header.1 -------------------------------------------------------------------------------- /tests/data/volume_object_map.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/volume_object_map.1 -------------------------------------------------------------------------------- /tests/data/volume_superblock.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsapfs/5f86c438cc2cd544928e1f693f010414eb8c50bc/tests/data/volume_superblock.1 -------------------------------------------------------------------------------- /tests/fsapfs_test_functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Functions for testing 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_FUNCTIONS_H ) 23 | #define _FSAPFS_TEST_FUNCTIONS_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfs_test_libbfio.h" 29 | #include "fsapfs_test_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fsapfs_test_get_narrow_source( 36 | const system_character_t *source, 37 | char *narrow_string, 38 | size_t narrow_string_size, 39 | libcerror_error_t **error ); 40 | 41 | #if defined( HAVE_WIDE_CHARACTER_TYPE ) 42 | 43 | int fsapfs_test_get_wide_source( 44 | const system_character_t *source, 45 | wchar_t *wide_string, 46 | size_t wide_string_size, 47 | libcerror_error_t **error ); 48 | 49 | #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ 50 | 51 | int fsapfs_test_system_string_copy_from_64_bit_in_decimal( 52 | const system_character_t *string, 53 | size_t string_size, 54 | uint64_t *value_64bit, 55 | libcerror_error_t **error ); 56 | 57 | int fsapfs_test_open_file_io_handle( 58 | libbfio_handle_t **file_io_handle, 59 | uint8_t *data, 60 | size_t data_size, 61 | libcerror_error_t **error ); 62 | 63 | int fsapfs_test_close_file_io_handle( 64 | libbfio_handle_t **file_io_handle, 65 | libcerror_error_t **error ); 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSAPFS_TEST_FUNCTIONS_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /tests/fsapfs_test_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_GETOPT_H ) 23 | #define _FSAPFS_TEST_GETOPT_H 24 | 25 | #include 26 | #include 27 | 28 | /* unistd.h is included here to export getopt, optarg, optind and optopt 29 | */ 30 | #if defined( HAVE_UNISTD_H ) 31 | #include 32 | #endif 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | #if defined( HAVE_GETOPT ) 39 | #define fsapfs_test_getopt( argument_count, argument_values, options_string ) \ 40 | getopt( argument_count, argument_values, options_string ) 41 | 42 | #else 43 | 44 | #if !defined( __CYGWIN__ ) 45 | extern int optind; 46 | extern system_character_t *optarg; 47 | extern system_integer_t optopt; 48 | 49 | #else 50 | int optind; 51 | system_character_t *optarg; 52 | system_integer_t optopt; 53 | 54 | #endif /* !defined( __CYGWIN__ ) */ 55 | 56 | system_integer_t fsapfs_test_getopt( 57 | int argument_count, 58 | system_character_t * const argument_values[], 59 | const system_character_t *options_string ); 60 | 61 | #endif /* defined( HAVE_GETOPT ) */ 62 | 63 | #if defined( __cplusplus ) 64 | } 65 | #endif 66 | 67 | #endif /* !defined( _FSAPFS_TEST_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBBFIO_H ) 23 | #define _FSAPFS_TEST_LIBBFIO_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio 28 | */ 29 | #if defined( HAVE_LOCAL_LIBBFIO ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT 43 | * before including libbfio.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBBFIO_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) 52 | #error Multi-threading support requires libbfio with multi-threading support 53 | #endif 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBBFIO ) */ 56 | 57 | #endif /* !defined( _FSAPFS_TEST_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libcdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcdata header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBCDATA_H ) 23 | #define _FSAPFS_TEST_LIBCDATA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCDATA for local use of libcdata 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCDATA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT 43 | * before including libcdata.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBCDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBCDATA ) */ 52 | 53 | #endif /* !defined( _FSAPFS_TEST_LIBCDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBCERROR_H ) 23 | #define _FSAPFS_TEST_LIBCERROR_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCERROR for local use of libcerror 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCERROR ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT 39 | * before including libcerror.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCERROR_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCERROR ) */ 48 | 49 | #endif /* !defined( _FSAPFS_TEST_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBCLOCALE_H ) 23 | #define _FSAPFS_TEST_LIBCLOCALE_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCLOCALE for local use of libclocale 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCLOCALE ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCLOCALE_DLL_IMPORT 39 | * before including libclocale.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCLOCALE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCLOCALE ) */ 48 | 49 | #endif /* !defined( _FSAPFS_TEST_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBCNOTIFY_H ) 23 | #define _FSAPFS_TEST_LIBCNOTIFY_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCNOTIFY ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #else 37 | 38 | /* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT 39 | * before including libcnotify.h 40 | */ 41 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 42 | #define LIBCNOTIFY_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ 48 | 49 | #endif /* !defined( _FSAPFS_TEST_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libcpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcpath header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBCPATH_H ) 23 | #define _FSAPFS_TEST_LIBCPATH_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBCPATH for local use of libcpath 28 | */ 29 | #if defined( HAVE_LOCAL_LIBCPATH ) 30 | 31 | #include 32 | #include 33 | 34 | #else 35 | 36 | /* If libtool DLL support is enabled set LIBCPATH_DLL_IMPORT 37 | * before including libcpath.h 38 | */ 39 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 40 | #define LIBCPATH_DLL_IMPORT 41 | #endif 42 | 43 | #include 44 | 45 | #endif /* defined( HAVE_LOCAL_LIBCPATH ) */ 46 | 47 | #endif /* !defined( _FSAPFS_TEST_LIBCPATH_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBFDATA_H ) 23 | #define _FSAPFS_TEST_LIBFDATA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFDATA for local use of libfdata 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFDATA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #else 41 | 42 | /* If libtool DLL support is enabled set LIBFDATA_DLL_IMPORT 43 | * before including libfdata.h 44 | */ 45 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 46 | #define LIBFDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ 52 | 53 | #endif /* !defined( _FSAPFS_TEST_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libfsapfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsapfs header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBFSAPFS_H ) 23 | #define _FSAPFS_TEST_LIBFSAPFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSAPFS_TEST_LIBFSAPFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /tests/fsapfs_test_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_LIBUNA_H ) 23 | #define _FSAPFS_TEST_LIBUNA_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBUNA for local use of libuna 28 | */ 29 | #if defined( HAVE_LOCAL_LIBUNA ) 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #else 47 | 48 | /* If libtool DLL support is enabled set LIBUNA_DLL_IMPORT 49 | * before including libuna.h 50 | */ 51 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 52 | #define LIBUNA_DLL_IMPORT 53 | #endif 54 | 55 | #include 56 | 57 | #endif /* defined( HAVE_LOCAL_LIBUNA ) */ 58 | 59 | #endif /* !defined( _FSAPFS_TEST_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /tests/fsapfs_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Memory allocation functions for testing 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_MEMORY_H ) 23 | #define _FSAPFS_TEST_MEMORY_H 24 | 25 | #include 26 | 27 | #if defined( __cplusplus ) 28 | extern "C" { 29 | #endif 30 | 31 | #if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBFSAPFS_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __loongarch__ ) && !defined( __mips__ ) && !defined( __riscv ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) 32 | #define HAVE_FSAPFS_TEST_MEMORY 1 33 | #endif 34 | 35 | #if defined( HAVE_FSAPFS_TEST_MEMORY ) 36 | 37 | extern int fsapfs_test_malloc_attempts_before_fail; 38 | 39 | extern int fsapfs_test_memcpy_attempts_before_fail; 40 | 41 | extern int fsapfs_test_memset_attempts_before_fail; 42 | 43 | extern int fsapfs_test_realloc_attempts_before_fail; 44 | 45 | #endif /* defined( HAVE_FSAPFS_TEST_MEMORY ) */ 46 | 47 | #if defined( __cplusplus ) 48 | } 49 | #endif 50 | 51 | #endif /* !defined( _FSAPFS_TEST_MEMORY_H ) */ 52 | 53 | -------------------------------------------------------------------------------- /tests/fsapfs_test_rwlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Read/Write lock functions for testing 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_RWLOCK_H ) 23 | #define _FSAPFS_TEST_RWLOCK_H 24 | 25 | #include 26 | 27 | #include "fsapfs_test_libfsapfs.h" 28 | 29 | #if defined( __cplusplus ) 30 | extern "C" { 31 | #endif 32 | 33 | #if defined( LIBFSAPFS_HAVE_MULTI_THREAD_SUPPORT ) && defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) 34 | #define HAVE_FSAPFS_TEST_RWLOCK 1 35 | #endif 36 | 37 | #if defined( HAVE_FSAPFS_TEST_RWLOCK ) 38 | 39 | extern int fsapfs_test_pthread_rwlock_init_attempts_before_fail; 40 | 41 | extern int fsapfs_test_pthread_rwlock_destroy_attempts_before_fail; 42 | 43 | extern int fsapfs_test_pthread_rwlock_rdlock_attempts_before_fail; 44 | 45 | extern int fsapfs_test_pthread_rwlock_wrlock_attempts_before_fail; 46 | 47 | extern int fsapfs_test_pthread_rwlock_unlock_attempts_before_fail; 48 | 49 | #endif /* defined( HAVE_FSAPFS_TEST_RWLOCK ) */ 50 | 51 | #if defined( __cplusplus ) 52 | } 53 | #endif 54 | 55 | #endif /* !defined( _FSAPFS_TEST_RWLOCK_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /tests/fsapfs_test_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The type definitions 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_TYPES_H ) 23 | #define _FSAPFS_TEST_TYPES_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsapfs_test_libuna.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct fsapfs_test_unicode_case_folding_mapping fsapfs_test_unicode_case_folding_mapping_t; 35 | 36 | struct fsapfs_test_unicode_case_folding_mapping 37 | { 38 | /* The Unicode character 39 | */ 40 | libuna_unicode_character_t unicode_character; 41 | 42 | /* The character 43 | */ 44 | uint32_t character; 45 | }; 46 | 47 | typedef struct fsapfs_test_unicode_decomposition_mapping fsapfs_test_unicode_decomposition_mapping_t; 48 | 49 | struct fsapfs_test_unicode_decomposition_mapping 50 | { 51 | /* The Unicode character 52 | */ 53 | libuna_unicode_character_t unicode_character; 54 | 55 | /* The number of characters 56 | */ 57 | uint8_t number_of_characters; 58 | 59 | /* The characters 60 | */ 61 | uint32_t characters[ 4 ]; 62 | }; 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _FSAPFS_TEST_TYPES_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /tests/fsapfs_test_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2018-2024, Joachim Metz 5 | * 6 | * Refer to AUTHORS for acknowledgements. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #if !defined( _FSAPFS_TEST_UNUSED_H ) 23 | #define _FSAPFS_TEST_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSAPFS_TEST_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSAPFS_TEST_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSAPFS_TEST_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSAPFS_TEST_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSAPFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSAPFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSAPFS_TEST_UNUSED_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/lsan.suppressions: -------------------------------------------------------------------------------- 1 | leak:/lib*/libpython* 2 | -------------------------------------------------------------------------------- /tests/pkgbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script to build a MacOS pkg 3 | # 4 | # Version: 20201121 5 | 6 | set -e 7 | 8 | make install DESTDIR=${PWD}/osx-pkg 9 | mkdir -p ${PWD}/osx-pkg/usr/share/doc/libfsapfs 10 | cp AUTHORS COPYING COPYING.LESSER NEWS README ${PWD}/osx-pkg/usr/share/doc/libfsapfs 11 | 12 | VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` 13 | pkgbuild --root osx-pkg --identifier com.github.libyal.libfsapfs --version ${VERSION} --ownership recommended ../libfsapfs-${VERSION}.pkg 14 | 15 | -------------------------------------------------------------------------------- /tests/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script to run tests 3 | # 4 | # Version: 20201121 5 | 6 | if test -f ${PWD}/libfsapfs/.libs/libfsapfs.1.dylib && test -f ./pyfsapfs/.libs/pyfsapfs.so; 7 | then 8 | install_name_tool -change /usr/local/lib/libfsapfs.1.dylib ${PWD}/libfsapfs/.libs/libfsapfs.1.dylib ./pyfsapfs/.libs/pyfsapfs.so; 9 | fi 10 | 11 | make check CHECK_WITH_STDERR=1; 12 | RESULT=$?; 13 | 14 | if test ${RESULT} -ne 0 && test -f tests/test-suite.log; 15 | then 16 | cat tests/test-suite.log; 17 | fi 18 | exit ${RESULT}; 19 | 20 | -------------------------------------------------------------------------------- /tests/syncsharedlibs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script that synchronizes the shared library dependencies 3 | # 4 | # Version: 20201121 5 | 6 | EXIT_SUCCESS=0; 7 | EXIT_FAILURE=1; 8 | 9 | GIT_URL_PREFIX="https://github.com/libyal"; 10 | SHARED_LIBS="libcerror libcthreads libcdata libclocale libcnotify libcsplit libuna libcfile libcpath libbfio libfcache libfdata libfdatetime libfguid libfmos libhmac libcaes"; 11 | 12 | USE_HEAD=""; 13 | 14 | if test "$1" = "--use-head"; 15 | then 16 | USE_HEAD="--use-head"; 17 | fi 18 | 19 | OLDIFS=$IFS; 20 | IFS=" "; 21 | 22 | for SHARED_LIB in ${SHARED_LIBS}; 23 | do 24 | GIT_URL="${GIT_URL_PREFIX}/${SHARED_LIB}.git"; 25 | 26 | git clone --quiet ${GIT_URL} ${SHARED_LIB}-$$; 27 | 28 | if ! test -d ${SHARED_LIB}-$$; 29 | then 30 | echo "Unable to git clone: ${GIT_URL}"; 31 | 32 | IFS=$OLDIFS; 33 | 34 | exit ${EXIT_FAILURE}; 35 | fi 36 | (cd ${SHARED_LIB}-$$ && git fetch --quiet --all --tags --prune) 37 | 38 | LATEST_TAG=`cd ${SHARED_LIB}-$$ && git describe --tags --abbrev=0`; 39 | 40 | if test -n ${LATEST_TAG} && test -z ${USE_HEAD}; 41 | then 42 | echo "Synchronizing: ${SHARED_LIB} from ${GIT_URL} tag ${LATEST_TAG}"; 43 | 44 | (cd ${SHARED_LIB}-$$ && git checkout --quiet tags/${LATEST_TAG}); 45 | else 46 | echo "Synchronizing: ${SHARED_LIB} from ${GIT_URL} HEAD"; 47 | fi 48 | 49 | (cd ${SHARED_LIB}-$$ && ./synclibs.sh ${USE_HEAD} && ./autogen.sh); 50 | 51 | CONFIGURE_OPTIONS=""; 52 | 53 | (cd ${SHARED_LIB}-$$ && ./configure --help | grep -- '--enable-wide-character-type' > /dev/null); 54 | 55 | if test $? -eq 0; 56 | then 57 | CONFIGURE_OPTIONS="${CONFIGURE_OPTIONS} --enable-wide-character-type"; 58 | fi 59 | 60 | (cd ${SHARED_LIB}-$$ && ./configure --prefix=/usr ${CONFIGURE_OPTIONS} && make && sudo make install); 61 | 62 | rm -rf ${SHARED_LIB}-$$; 63 | done 64 | 65 | IFS=$OLDIFS; 66 | 67 | exit ${EXIT_SUCCESS}; 68 | 69 | -------------------------------------------------------------------------------- /tests/test_manpage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Tests man pages. 3 | # 4 | # Version: 20240413 5 | 6 | EXIT_SUCCESS=0; 7 | EXIT_FAILURE=1; 8 | EXIT_IGNORE=77; 9 | 10 | run_test() 11 | { 12 | local INPUT_FILE=$1; 13 | local RESULT=0 14 | 15 | TEST_NAME=`basename ${INPUT_FILE}`; 16 | echo -n "Testing man with input: ${TEST_NAME}"; 17 | 18 | LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z ${INPUT_FILE} > /dev/null 2> ${TMPDIR}/${TEST_NAME}.warnings; 19 | RESULT=$?; 20 | 21 | # For now line break warnings are ignored. 22 | if test -f ${TMPDIR}/${TEST_NAME}.warnings; 23 | then 24 | sed "/can't break line/ d" -i ${TMPDIR}/${TEST_NAME}.warnings; 25 | fi 26 | if test -s ${TMPDIR}/${TEST_NAME}.warnings; 27 | then 28 | RESULT=${EXIT_FAILURE}; 29 | fi 30 | if test ${RESULT} -ne ${EXIT_SUCCESS}; 31 | then 32 | echo " (FAIL)"; 33 | else 34 | echo " (PASS)"; 35 | fi 36 | if test -s ${TMPDIR}/${TEST_NAME}.warnings; 37 | then 38 | cat ${TMPDIR}/${TEST_NAME}.warnings; 39 | fi 40 | return ${RESULT}; 41 | } 42 | 43 | if test "${OSTYPE}" = "msys"; 44 | then 45 | exit ${EXIT_IGNORE}; 46 | fi 47 | 48 | TEST_DIRECTORY=`dirname $0`; 49 | 50 | TEST_RUNNER="${TEST_DIRECTORY}/test_runner.sh"; 51 | 52 | if ! test -f "${TEST_RUNNER}"; 53 | then 54 | echo "Missing test runner: ${TEST_RUNNER}"; 55 | 56 | exit ${EXIT_FAILURE}; 57 | fi 58 | 59 | source ${TEST_RUNNER}; 60 | 61 | assert_availability_binary man; 62 | 63 | RESULT=${EXIT_IGNORE}; 64 | 65 | TMPDIR="tmp$$"; 66 | 67 | rm -rf ${TMPDIR}; 68 | mkdir ${TMPDIR}; 69 | 70 | MANUALS_PATH="../manuals"; 71 | 72 | if ! test -d ${MANUALS_PATH}; 73 | then 74 | MANUALS_PATH="manuals"; 75 | fi 76 | 77 | if ! test -d ${MANUALS_PATH}; 78 | then 79 | echo "Manuals directory not found."; 80 | 81 | exit ${EXIT_IGNORE}; 82 | fi 83 | 84 | for INPUT_FILE in ${MANUALS_PATH}/*.[13]; 85 | do 86 | run_test "${INPUT_FILE}"; 87 | RESULT=$?; 88 | 89 | if test ${RESULT} -ne ${EXIT_SUCCESS}; 90 | then 91 | break; 92 | fi 93 | done 94 | 95 | rm -rf ${TMPDIR}; 96 | 97 | exit ${RESULT}; 98 | 99 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = auditwheel,py3{7,8,9,10,11,12} 3 | 4 | [testenv] 5 | usedevelop = True 6 | pip_pre = True 7 | passenv = 8 | CFLAGS 9 | CPPFLAGS 10 | INCLUDE 11 | LDFLAGS 12 | LIB 13 | deps = 14 | build 15 | setuptools >= 65 16 | wheel 17 | commands = 18 | python -m build --no-isolation --outdir=dist --wheel 19 | python -m pip install --no-index --find-links=dist libfsapfs-python 20 | python tests/runtests.py 21 | 22 | [testenv:auditwheel] 23 | usedevelop = True 24 | pip_pre = True 25 | deps = 26 | auditwheel 27 | setuptools >= 65 28 | commands = 29 | python -m auditwheel repair {posargs} 30 | --------------------------------------------------------------------------------