├── .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 └── Hierarchical File System (HFS).asciidoc ├── dpkg ├── changelog.in ├── compat ├── control ├── copyright ├── libfshfs-dev.install ├── libfshfs-python3.install ├── libfshfs-tools.install ├── libfshfs.install ├── rules └── source │ └── format ├── fshfstools ├── Makefile.am ├── digest_hash.c ├── digest_hash.h ├── fshfsinfo.c ├── fshfsmount.c ├── fshfstools_getopt.c ├── fshfstools_getopt.h ├── fshfstools_i18n.h ├── fshfstools_libbfio.h ├── fshfstools_libcerror.h ├── fshfstools_libclocale.h ├── fshfstools_libcnotify.h ├── fshfstools_libcpath.h ├── fshfstools_libfcache.h ├── fshfstools_libfdata.h ├── fshfstools_libfdatetime.h ├── fshfstools_libfguid.h ├── fshfstools_libfshfs.h ├── fshfstools_libhmac.h ├── fshfstools_libuna.h ├── fshfstools_output.c ├── fshfstools_output.h ├── fshfstools_signal.c ├── fshfstools_signal.h ├── fshfstools_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 ├── include ├── Makefile.am ├── libfshfs.h.in └── libfshfs │ ├── codepage.h │ ├── definitions.h.in │ ├── error.h │ ├── extern.h │ ├── features.h.in │ └── types.h.in ├── libfshfs.ini ├── libfshfs.pc.in ├── libfshfs.spec.in ├── libfshfs ├── Makefile.am ├── fshfs_attributes_file.h ├── fshfs_btree.h ├── fshfs_catalog_file.h ├── fshfs_compressed_data.h ├── fshfs_extents_file.h ├── fshfs_fork_descriptor.h ├── fshfs_master_directory_block.h ├── fshfs_volume_header.h ├── libfshfs.c ├── libfshfs.rc.in ├── libfshfs_allocation_block_stream.c ├── libfshfs_allocation_block_stream.h ├── libfshfs_attribute_record.c ├── libfshfs_attribute_record.h ├── libfshfs_attributes_btree_file.c ├── libfshfs_attributes_btree_file.h ├── libfshfs_attributes_btree_key.c ├── libfshfs_attributes_btree_key.h ├── libfshfs_bit_stream.c ├── libfshfs_bit_stream.h ├── libfshfs_block_data_handle.c ├── libfshfs_block_data_handle.h ├── libfshfs_btree_file.c ├── libfshfs_btree_file.h ├── libfshfs_btree_header.c ├── libfshfs_btree_header.h ├── libfshfs_btree_node.c ├── libfshfs_btree_node.h ├── libfshfs_btree_node_cache.c ├── libfshfs_btree_node_cache.h ├── libfshfs_btree_node_descriptor.c ├── libfshfs_btree_node_descriptor.h ├── libfshfs_btree_node_record.c ├── libfshfs_btree_node_record.h ├── libfshfs_btree_node_vector.c ├── libfshfs_btree_node_vector.h ├── libfshfs_buffer_data_handle.c ├── libfshfs_buffer_data_handle.h ├── libfshfs_catalog_btree_file.c ├── libfshfs_catalog_btree_file.h ├── libfshfs_catalog_btree_key.c ├── libfshfs_catalog_btree_key.h ├── libfshfs_compressed_data_handle.c ├── libfshfs_compressed_data_handle.h ├── libfshfs_compressed_data_header.c ├── libfshfs_compressed_data_header.h ├── libfshfs_compression.c ├── libfshfs_compression.h ├── libfshfs_data_stream.c ├── libfshfs_data_stream.h ├── libfshfs_debug.c ├── libfshfs_debug.h ├── libfshfs_definitions.h.in ├── libfshfs_deflate.c ├── libfshfs_deflate.h ├── libfshfs_directory_entry.c ├── libfshfs_directory_entry.h ├── libfshfs_directory_record.c ├── libfshfs_directory_record.h ├── libfshfs_error.c ├── libfshfs_error.h ├── libfshfs_extended_attribute.c ├── libfshfs_extended_attribute.h ├── libfshfs_extent.c ├── libfshfs_extent.h ├── libfshfs_extents_btree_file.c ├── libfshfs_extents_btree_file.h ├── libfshfs_extents_btree_key.c ├── libfshfs_extents_btree_key.h ├── libfshfs_extents_record.c ├── libfshfs_extents_record.h ├── libfshfs_extern.h ├── libfshfs_file_entry.c ├── libfshfs_file_entry.h ├── libfshfs_file_record.c ├── libfshfs_file_record.h ├── libfshfs_file_system.c ├── libfshfs_file_system.h ├── libfshfs_fork_descriptor.c ├── libfshfs_fork_descriptor.h ├── libfshfs_huffman_tree.c ├── libfshfs_huffman_tree.h ├── libfshfs_io_handle.c ├── libfshfs_io_handle.h ├── libfshfs_libbfio.h ├── libfshfs_libcdata.h ├── libfshfs_libcerror.h ├── libfshfs_libclocale.h ├── libfshfs_libcnotify.h ├── libfshfs_libcthreads.h ├── libfshfs_libfcache.h ├── libfshfs_libfdata.h ├── libfshfs_libfdatetime.h ├── libfshfs_libfguid.h ├── libfshfs_libfmos.h ├── libfshfs_libuna.h ├── libfshfs_master_directory_block.c ├── libfshfs_master_directory_block.h ├── libfshfs_name.c ├── libfshfs_name.h ├── libfshfs_notify.c ├── libfshfs_notify.h ├── libfshfs_profiler.c ├── libfshfs_profiler.h ├── libfshfs_support.c ├── libfshfs_support.h ├── libfshfs_thread_record.c ├── libfshfs_thread_record.h ├── libfshfs_types.h ├── libfshfs_unused.h ├── libfshfs_volume.c ├── libfshfs_volume.h ├── libfshfs_volume_header.c └── libfshfs_volume_header.h ├── m4 ├── common.m4 ├── libbfio.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 ├── fshfsinfo.1 ├── fshfsmount.1 └── libfshfs.3 ├── msvscpp ├── Makefile.am ├── fshfs_test_attribute_record │ └── fshfs_test_attribute_record.vcproj ├── fshfs_test_attributes_btree_key │ └── fshfs_test_attributes_btree_key.vcproj ├── fshfs_test_bit_stream │ └── fshfs_test_bit_stream.vcproj ├── fshfs_test_btree_file │ └── fshfs_test_btree_file.vcproj ├── fshfs_test_btree_header │ └── fshfs_test_btree_header.vcproj ├── fshfs_test_btree_node │ └── fshfs_test_btree_node.vcproj ├── fshfs_test_btree_node_descriptor │ └── fshfs_test_btree_node_descriptor.vcproj ├── fshfs_test_btree_node_record │ └── fshfs_test_btree_node_record.vcproj ├── fshfs_test_buffer_data_handle │ └── fshfs_test_buffer_data_handle.vcproj ├── fshfs_test_catalog_btree_key │ └── fshfs_test_catalog_btree_key.vcproj ├── fshfs_test_compressed_data_handle │ └── fshfs_test_compressed_data_handle.vcproj ├── fshfs_test_compression │ └── fshfs_test_compression.vcproj ├── fshfs_test_deflate │ └── fshfs_test_deflate.vcproj ├── fshfs_test_directory_entry │ └── fshfs_test_directory_entry.vcproj ├── fshfs_test_directory_record │ └── fshfs_test_directory_record.vcproj ├── fshfs_test_error │ └── fshfs_test_error.vcproj ├── fshfs_test_extent │ └── fshfs_test_extent.vcproj ├── fshfs_test_extents_btree_key │ └── fshfs_test_extents_btree_key.vcproj ├── fshfs_test_file_entry │ └── fshfs_test_file_entry.vcproj ├── fshfs_test_file_record │ └── fshfs_test_file_record.vcproj ├── fshfs_test_file_system │ └── fshfs_test_file_system.vcproj ├── fshfs_test_fork_descriptor │ └── fshfs_test_fork_descriptor.vcproj ├── fshfs_test_huffman_tree │ └── fshfs_test_huffman_tree.vcproj ├── fshfs_test_io_handle │ └── fshfs_test_io_handle.vcproj ├── fshfs_test_master_directory_block │ └── fshfs_test_master_directory_block.vcproj ├── fshfs_test_name │ └── fshfs_test_name.vcproj ├── fshfs_test_notify │ └── fshfs_test_notify.vcproj ├── fshfs_test_profiler │ └── fshfs_test_profiler.vcproj ├── fshfs_test_support │ └── fshfs_test_support.vcproj ├── fshfs_test_thread_record │ └── fshfs_test_thread_record.vcproj ├── fshfs_test_tools_info_handle │ └── fshfs_test_tools_info_handle.vcproj ├── fshfs_test_tools_mount_path_string │ └── fshfs_test_tools_mount_path_string.vcproj ├── fshfs_test_tools_output │ └── fshfs_test_tools_output.vcproj ├── fshfs_test_tools_signal │ └── fshfs_test_tools_signal.vcproj ├── fshfs_test_volume │ └── fshfs_test_volume.vcproj ├── fshfs_test_volume_header │ └── fshfs_test_volume_header.vcproj ├── fshfsinfo │ └── fshfsinfo.vcproj ├── fshfsmount │ └── fshfsmount.vcproj ├── libbfio │ └── libbfio.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 ├── libfshfs.sln ├── libfshfs │ └── libfshfs.vcproj ├── libhmac │ └── libhmac.vcproj ├── libuna │ └── libuna.vcproj ├── pyfshfs │ └── pyfshfs.vcproj └── zlib │ └── zlib.vcproj ├── ossfuzz ├── Makefile.am ├── extended_attribute_fuzzer.cc ├── file_entry_fuzzer.cc ├── ossfuzz_libbfio.h ├── ossfuzz_libfshfs.h └── volume_fuzzer.cc ├── po ├── ChangeLog ├── Makevars.in └── POTFILES.in ├── pyfshfs ├── Makefile.am ├── pyfshfs.c ├── pyfshfs.h ├── pyfshfs_data_stream.c ├── pyfshfs_data_stream.h ├── pyfshfs_datetime.c ├── pyfshfs_datetime.h ├── pyfshfs_error.c ├── pyfshfs_error.h ├── pyfshfs_extended_attribute.c ├── pyfshfs_extended_attribute.h ├── pyfshfs_extended_attributes.c ├── pyfshfs_extended_attributes.h ├── pyfshfs_file_entries.c ├── pyfshfs_file_entries.h ├── pyfshfs_file_entry.c ├── pyfshfs_file_entry.h ├── pyfshfs_file_object_io_handle.c ├── pyfshfs_file_object_io_handle.h ├── pyfshfs_integer.c ├── pyfshfs_integer.h ├── pyfshfs_libbfio.h ├── pyfshfs_libcerror.h ├── pyfshfs_libfshfs.h ├── pyfshfs_python.h ├── pyfshfs_unused.h ├── pyfshfs_volume.c └── pyfshfs_volume.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_header.1 │ ├── btree_node_descriptor.1 │ ├── catalog_btree_key.1 │ ├── directory_record.1 │ ├── file_record.1 │ ├── master_directory_block.1 │ ├── thread_record.1 │ └── volume_header.1 ├── fshfs_test_attribute_record.c ├── fshfs_test_attributes_btree_key.c ├── fshfs_test_bit_stream.c ├── fshfs_test_btree_file.c ├── fshfs_test_btree_header.c ├── fshfs_test_btree_node.c ├── fshfs_test_btree_node_descriptor.c ├── fshfs_test_btree_node_record.c ├── fshfs_test_buffer_data_handle.c ├── fshfs_test_catalog_btree_key.c ├── fshfs_test_compressed_data_handle.c ├── fshfs_test_compression.c ├── fshfs_test_deflate.c ├── fshfs_test_directory_entry.c ├── fshfs_test_directory_record.c ├── fshfs_test_error.c ├── fshfs_test_extent.c ├── fshfs_test_extents_btree_key.c ├── fshfs_test_file_entry.c ├── fshfs_test_file_record.c ├── fshfs_test_file_system.c ├── fshfs_test_fork_descriptor.c ├── fshfs_test_functions.c ├── fshfs_test_functions.h ├── fshfs_test_getopt.c ├── fshfs_test_getopt.h ├── fshfs_test_huffman_tree.c ├── fshfs_test_io_handle.c ├── fshfs_test_libbfio.h ├── fshfs_test_libcerror.h ├── fshfs_test_libclocale.h ├── fshfs_test_libcnotify.h ├── fshfs_test_libcpath.h ├── fshfs_test_libfdata.h ├── fshfs_test_libfshfs.h ├── fshfs_test_libuna.h ├── fshfs_test_macros.h ├── fshfs_test_master_directory_block.c ├── fshfs_test_memory.c ├── fshfs_test_memory.h ├── fshfs_test_name.c ├── fshfs_test_notify.c ├── fshfs_test_profiler.c ├── fshfs_test_support.c ├── fshfs_test_thread_record.c ├── fshfs_test_tools_info_handle.c ├── fshfs_test_tools_mount_path_string.c ├── fshfs_test_tools_output.c ├── fshfs_test_tools_signal.c ├── fshfs_test_types.h ├── fshfs_test_unicode_case_folding_mappings.h ├── fshfs_test_unicode_decomposition_mappings.h ├── fshfs_test_unused.h ├── fshfs_test_volume.c ├── fshfs_test_volume_header.c ├── lsan.suppressions ├── pkgbuild.sh ├── pyfshfs_test_support.py ├── pyfshfs_test_volume.py ├── runtests.py ├── runtests.sh ├── syncsharedlibs.sh ├── test_fshfsinfo.ps1 ├── test_fshfsinfo.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 | - "libcdata/*" 12 | - "libcerror/*" 13 | - "libcfile/*" 14 | - "libclocale/*" 15 | - "libcnotify/*" 16 | - "libcpath/*" 17 | - "libcsplit/*" 18 | - "libcthreads/*" 19 | - "libfcache/*" 20 | - "libfdata/*" 21 | - "libfdatetime/*" 22 | - "libfguid/*" 23 | - "libfmos/*" 24 | - "libhmac/*" 25 | - "libuna/*" 26 | - "tests/*" 27 | -------------------------------------------------------------------------------- /.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/libfshfs 28 | cp projects/libyal/build.sh projects/libfshfs/ 29 | cp projects/libyal/project.yaml projects/libfshfs/ 30 | head -n 20 projects/libyal/Dockerfile > projects/libfshfs/Dockerfile 31 | echo "RUN git clone --depth 1 https://github.com/libyal/libfshfs.git libfshfs" >> projects/libfshfs/Dockerfile 32 | tail -n 3 projects/libyal/Dockerfile >> projects/libfshfs/Dockerfile 33 | python3 infra/helper.py build_image --pull libfshfs 34 | python3 infra/helper.py build_fuzzers --sanitizer address libfshfs 35 | python3 infra/helper.py check_build libfshfs 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: libfshfs 2 | 3 | Copyright (C) 2009-2024, Joachim Metz 4 | 5 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | To do: 2 | * rename volume name to volume label ? 3 | 4 | * check if get directory entries uses previous/next node 5 | 6 | * add support for extended attribute (named fork) data stream with LIBFSHFS_ATTRIBUTE_RECORD_TYPE_EXTENTS 7 | * for extended attributes by name look up use native B-tree structures 8 | 9 | * info handle implement is_empty ? 10 | 11 | * handle (hard) link count differently for indirect node files in /␀␀␀␀HFS+ Private Data/ 12 | * what about a symbolic link to HFS+ Private data directory? 13 | 14 | * on file_entry_initialize lookup com.apple.decmpfs specifically instead of all attributes? 15 | * catalog B-tree file, include name in branch key check 16 | * file entry API: add extents functions 17 | 18 | * add support to print information about special files (those without a catalog record) ? 19 | 20 | * HFS+/HFSX 21 | ** add support for solaris and bsdos device numbers 22 | 23 | * classic HFS 24 | ** fshfsinfo: add support retrieving non-directory file entries using fshfsinfo -E 25 | *** files in classic HFS do not need to have a thread record 26 | ** API: add option to set file system encoding 27 | ** API: add means to determine if date and time values are in local time or UTC 28 | ** API: determine how to represent file mode 29 | ** add support for Mac OS codepages 30 | ** pass IO handle to directory, file and thread records to validate record types ? 31 | ** correct file record extents with extents start 32 | 33 | Format support: 34 | * implement support for classic HFS pre Mac OS 9.0 35 | * implement support for HFS+/HFX Unicode 2.1 version 36 | * implement support for folder and file information 37 | * implement support for extended folder and file information 38 | 39 | 20160605 40 | * see `git log' for more recent change log 41 | * worked on format support 42 | 43 | 20160604 44 | * worked on format support 45 | 46 | 20160603 47 | * worked on format support 48 | 49 | 20160228 50 | * worked on format support 51 | 52 | 20160227 53 | * worked on format support 54 | 55 | 20160226 56 | * worked on format support 57 | 58 | 20160220 59 | * worked on format support 60 | 61 | 20160217 62 | * 2016 update 63 | 64 | 20090212 65 | * Initial version 66 | 67 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | libfshfs is a library to access the Mac OS Hierarchical File System (HFS). 2 | 3 | Project information: 4 | 5 | * Status: experimental 6 | * Licence: LGPLv3+ 7 | 8 | Read-only supported HFS formats: 9 | 10 | * HFS+, Mac OS 10.3 and later (Unicode 3.2 case-insensitive) 11 | * HFSX, Mac OS 10.3 and later (Unicode 3.2 case-sensitive) 12 | 13 | Unsupported HFS formats: 14 | 15 | * (traditional) HFS 16 | * HFS+, Mac OS 8.1 through 10.2 (Unicode 2.1 case-insensitive) 17 | * HFSX, Mac OS 8.1 through 10.2 (Unicode 2.1 case-sensitive) 18 | 19 | Supported HFS format features: 20 | 21 | * ZLIB (DEFLATE) compression 22 | * LZVN compression 23 | * extended attributes 24 | 25 | Unsupported HFS format features: 26 | 27 | * LZFSE compression, compression methods 11 and 12 28 | * "uncompressed", compression methods 1, 9 and 10 29 | 30 | Planned: 31 | 32 | * Complete extents extended attribute value data (kHFSPlusAttrExtents) support 33 | 34 | For more information see: 35 | 36 | * Project documentation: https://github.com/libyal/libfshfs/wiki/Home 37 | * How to build from source: https://github.com/libyal/libfshfs/wiki/Building 38 | 39 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl Checks for required headers and functions 2 | dnl 3 | dnl Version: 20200713 4 | 5 | dnl Function to detect if libfshfs dependencies are available 6 | AC_DEFUN([AX_LIBFSHFS_CHECK_LOCAL], 7 | [dnl Check for internationalization functions in libfshfs/libfshfs_i18n.c 8 | AC_CHECK_FUNCS([bindtextdomain]) 9 | ]) 10 | 11 | dnl Function to detect if fshfstools dependencies are available 12 | AC_DEFUN([AX_FSHFSTOOLS_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 fshfstools/fshfsmount.c 25 | AC_CHECK_HEADERS([errno.h sys/time.h]) 26 | 27 | dnl Functions included in fshfstools/mount_file_system.c and fshfstools/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_LIBFSHFS_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 | [LIBFSHFS_DLL_EXPORT], 51 | ["-DLIBFSHFS_DLL_EXPORT"]) 52 | 53 | AC_SUBST( 54 | [LIBFSHFS_DLL_IMPORT], 55 | ["-DLIBFSHFS_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) 2009-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) 2009-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) 2009-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 | libfshfs (@VERSION@-1) unstable; urgency=low 2 | 3 | * Auto-generated 4 | 5 | -- Joachim Metz @DPKG_DATE@ 6 | -------------------------------------------------------------------------------- /dpkg/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /dpkg/control: -------------------------------------------------------------------------------- 1 | Source: libfshfs 2 | Priority: extra 3 | Maintainer: Joachim Metz 4 | Build-Depends: debhelper (>= 9), dh-autoreconf, dh-python, pkg-config, zlib1g-dev, libssl-dev, python3-dev, python3-setuptools, libfuse-dev 5 | Standards-Version: 4.1.4 6 | Section: libs 7 | Homepage: https://github.com/libyal/libfshfs 8 | Vcs-Git: https://github.com/libyal/libfshfs.git 9 | 10 | Package: libfshfs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${misc:Depends} 13 | Conflicts: libfshfs1 14 | Replaces: libfshfs1 15 | Suggests: libfshfs-dbg 16 | Description: Library to access the Hierarchical File System (HFS) format 17 | libfshfs is a library to access the Hierarchical File System (HFS) format. 18 | 19 | Package: libfshfs-dbg 20 | Architecture: any 21 | Section: debug 22 | Depends: libfshfs (= ${binary:Version}), ${misc:Depends} 23 | Description: Debugging symbols for libfshfs 24 | Debugging symbols for libfshfs. 25 | 26 | Package: libfshfs-dev 27 | Section: libdevel 28 | Architecture: any 29 | Depends: libfshfs (= ${binary:Version}), ${misc:Depends} 30 | Description: Header files and libraries for developing applications for libfshfs 31 | Header files and libraries for developing applications for libfshfs. 32 | 33 | Package: libfshfs-tools 34 | Section: utils 35 | Architecture: any 36 | Depends: libfshfs (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} 37 | Conflicts: libfshfs-utils 38 | Replaces: libfshfs-utils 39 | Description: Several tools for reading Hierarchical File System (HFS) volumes 40 | Several tools for reading Hierarchical File System (HFS) volumes. 41 | 42 | Package: libfshfs-tools-dbg 43 | Section: debug 44 | Architecture: any 45 | Depends: libfshfs-tools (= ${binary:Version}), ${misc:Depends} 46 | Description: Debugging symbols for libfshfs-tools 47 | Debugging symbols for libfshfs-tools. 48 | 49 | Package: libfshfs-python3 50 | Section: python 51 | Architecture: any 52 | Depends: libfshfs (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} 53 | Conflicts: python3-libfshfs 54 | Replaces: python3-libfshfs 55 | Suggests: libfshfs-python3-dbg 56 | Description: Python 3 bindings for libfshfs 57 | Python 3 bindings for libfshfs. 58 | 59 | Package: libfshfs-python3-dbg 60 | Section: debug 61 | Architecture: any 62 | Depends: libfshfs-python3 (= ${binary:Version}), ${misc:Depends} 63 | Description: Debugging symbols for libfshfs-python3 64 | Debugging symbols for libfshfs-python3. 65 | 66 | -------------------------------------------------------------------------------- /dpkg/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: libfshfs 3 | Source: https://github.com/libyal/libfshfs 4 | 5 | Files: * 6 | Copyright: 2009-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/libfshfs-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/libfshfs-python3.install: -------------------------------------------------------------------------------- 1 | /usr/lib/python3* 2 | -------------------------------------------------------------------------------- /dpkg/libfshfs-tools.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | -------------------------------------------------------------------------------- /dpkg/libfshfs.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/pyfshfs.a 19 | 20 | .PHONY: override_dh_missing 21 | override_dh_missing: 22 | dh_missing -X.la -X/pyfshfs.a --fail-missing 23 | 24 | .PHONY: override_dh_strip 25 | override_dh_strip: 26 | ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) 27 | dh_strip -plibfshfs --dbg-package=libfshfs-dbg 28 | dh_strip -plibfshfs-tools --dbg-package=libfshfs-tools-dbg 29 | dh_strip -plibfshfs-python3 --dbg-package=libfshfs-python3-dbg 30 | endif 31 | 32 | -------------------------------------------------------------------------------- /dpkg/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /fshfstools/digest_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Crypographic digest hash 3 | * 4 | * Copyright (C) 2009-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 "fshfstools_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 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_GETOPT_H ) 23 | #define _FSHFSTOOLS_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 fshfstools_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 fshfstools_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( _FSHFSTOOLS_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_i18n.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Internationalization (i18n) functions 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_I18N_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_I18N_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBBFIO_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBCERROR_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBCLOCALE_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBCNOTIFY_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libcpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcpath header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBCPATH_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBCPATH_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libfcache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfcache header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBFCACHE_H ) 23 | #define _FSHFSTOOLS_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 ) && !defined( HAVE_STATIC_EXECUTABLES ) 42 | #define LIBFCACHE_DLL_IMPORT 43 | #endif 44 | 45 | #include 46 | 47 | #endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ 48 | 49 | #endif /* !defined( _FSHFSTOOLS_LIBFCACHE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBFDATA_H ) 23 | #define _FSHFSTOOLS_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 ) && !defined( HAVE_STATIC_EXECUTABLES ) 46 | #define LIBFDATA_DLL_IMPORT 47 | #endif 48 | 49 | #include 50 | 51 | #endif /* defined( HAVE_LOCAL_LIBFDATA ) */ 52 | 53 | #endif /* !defined( _FSHFSTOOLS_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBFDATETIME_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBFGUID_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libfshfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfshfs header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBFSHFS_H ) 23 | #define _FSHFSTOOLS_LIBFSHFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSHFSTOOLS_LIBFSHFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libhmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libhmac header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBHMAC_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBHMAC_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_LIBUNA_H ) 23 | #define _FSHFSTOOLS_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( _FSHFSTOOLS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common output functions for the fshfstools 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_OUTPUT_H ) 23 | #define _FSHFSTOOLS_OUTPUT_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "fshfstools_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fshfstools_output_initialize( 36 | int stdio_mode, 37 | libcerror_error_t **error ); 38 | 39 | void fshfstools_output_copyright_fprint( 40 | FILE *stream ); 41 | 42 | void fshfstools_output_version_fprint( 43 | FILE *stream, 44 | const char *program ); 45 | 46 | void fshfstools_output_version_detailed_fprint( 47 | FILE *stream, 48 | const char *program ); 49 | 50 | #if defined( __cplusplus ) 51 | } 52 | #endif 53 | 54 | #endif /* !defined( _FSHFSTOOLS_OUTPUT_H ) */ 55 | 56 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Signal handling functions 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_SIGNAL_H ) 23 | #define _FSHFSTOOLS_SIGNAL_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fshfstools_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 fshfstools_signal_t; 40 | 41 | #else 42 | typedef int fshfstools_signal_t; 43 | 44 | #endif /* defined( WINAPI ) */ 45 | 46 | #if defined( WINAPI ) 47 | 48 | BOOL WINAPI fshfstools_signal_handler( 49 | fshfstools_signal_t signal ); 50 | 51 | #if defined( _MSC_VER ) 52 | 53 | void fshfstools_signal_initialize_memory_debug( 54 | void ); 55 | 56 | #endif /* defined( _MSC_VER ) */ 57 | 58 | #endif /* defined( WINAPI ) */ 59 | 60 | int fshfstools_signal_attach( 61 | void (*signal_handler)( fshfstools_signal_t ), 62 | libcerror_error_t **error ); 63 | 64 | int fshfstools_signal_detach( 65 | libcerror_error_t **error ); 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSHFSTOOLS_SIGNAL_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /fshfstools/fshfstools_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2009-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( _FSHFSTOOLS_UNUSED_H ) 23 | #define _FSHFSTOOLS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSHFSTOOLS_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSHFSTOOLS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSHFSTOOLS_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSHFSTOOLS_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSHFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSHFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSHFSTOOLS_UNUSED_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fshfstools/mount_path_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Mount path string functions 3 | * 4 | * Copyright (C) 2009-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 "fshfstools_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 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = \ 2 | libfshfs.h 3 | 4 | pkginclude_HEADERS = \ 5 | libfshfs/codepage.h \ 6 | libfshfs/definitions.h \ 7 | libfshfs/error.h \ 8 | libfshfs/extern.h \ 9 | libfshfs/features.h \ 10 | libfshfs/types.h 11 | 12 | EXTRA_DIST = \ 13 | libfshfs.h.in \ 14 | libfshfs/definitions.h.in \ 15 | libfshfs/features.h.in \ 16 | libfshfs/types.h.in 17 | 18 | DISTCLEANFILES = \ 19 | libfshfs.h \ 20 | libfshfs/definitions.h \ 21 | libfshfs/features.h \ 22 | libfshfs/types.h \ 23 | Makefile \ 24 | Makefile.in 25 | 26 | -------------------------------------------------------------------------------- /include/libfshfs/definitions.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions for libfshfs 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_DEFINITIONS_H ) 23 | #define _LIBFSHFS_DEFINITIONS_H 24 | 25 | #include 26 | 27 | #define LIBFSHFS_VERSION @VERSION@ 28 | 29 | /* The version string 30 | */ 31 | #define LIBFSHFS_VERSION_STRING "@VERSION@" 32 | 33 | /* The file access 34 | * bit 1 set to 1 for read access 35 | * bit 2 set to 1 for write access 36 | * bit 3-8 not used 37 | */ 38 | enum LIBFSHFS_ACCESS_FLAGS 39 | { 40 | LIBFSHFS_ACCESS_FLAG_READ = 0x01, 41 | /* Reserved: not supported yet */ 42 | LIBFSHFS_ACCESS_FLAG_WRITE = 0x02 43 | }; 44 | 45 | /* The file access macros 46 | */ 47 | #define LIBFSHFS_OPEN_READ ( LIBFSHFS_ACCESS_FLAG_READ ) 48 | /* Reserved: not supported yet */ 49 | #define LIBFSHFS_OPEN_WRITE ( LIBFSHFS_ACCESS_FLAG_WRITE ) 50 | /* Reserved: not supported yet */ 51 | #define LIBFSHFS_OPEN_READ_WRITE ( LIBFSHFS_ACCESS_FLAG_READ | LIBFSHFS_ACCESS_FLAG_WRITE ) 52 | 53 | /* The path segment separator 54 | */ 55 | #define LIBFSHFS_SEPARATOR '/' 56 | 57 | /* The file system types 58 | */ 59 | enum LIBFSHFS_FILE_SYSTEM_TYPES 60 | { 61 | LIBFSHFS_FILE_SYSTEM_TYPE_UNDEFINED, 62 | LIBFSHFS_FILE_SYSTEM_TYPE_HFS, 63 | LIBFSHFS_FILE_SYSTEM_TYPE_HFS_PLUS, 64 | LIBFSHFS_FILE_SYSTEM_TYPE_HFSX 65 | }; 66 | 67 | /* The file types 68 | */ 69 | enum LIBFSHFS_FILE_TYPES 70 | { 71 | LIBFSHFS_FILE_TYPE_FIFO = 0x1000, 72 | LIBFSHFS_FILE_TYPE_CHARACTER_DEVICE = 0x2000, 73 | LIBFSHFS_FILE_TYPE_DIRECTORY = 0x4000, 74 | LIBFSHFS_FILE_TYPE_BLOCK_DEVICE = 0x6000, 75 | LIBFSHFS_FILE_TYPE_REGULAR_FILE = 0x8000, 76 | LIBFSHFS_FILE_TYPE_SYMBOLIC_LINK = 0xa000, 77 | LIBFSHFS_FILE_TYPE_SOCKET = 0xc000 78 | }; 79 | 80 | #endif /* !defined( _LIBFSHFS_DEFINITIONS_H ) */ 81 | 82 | -------------------------------------------------------------------------------- /include/libfshfs/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) 2009-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( _LIBFSHFS_EXTERN_H ) 26 | #define _LIBFSHFS_EXTERN_H 27 | 28 | /* To export functions from the libfshfs DLL define LIBFSHFS_DLL_EXPORT 29 | * To import functions from the libfshfs DLL define LIBFSHFS_DLL_IMPORT 30 | * Otherwise use default extern statement 31 | */ 32 | #if defined( LIBFSHFS_DLL_EXPORT ) 33 | #define LIBFSHFS_EXTERN __declspec(dllexport) 34 | 35 | #elif defined( LIBFSHFS_DLL_IMPORT ) 36 | #define LIBFSHFS_EXTERN extern __declspec(dllimport) 37 | 38 | #else 39 | #define LIBFSHFS_EXTERN extern 40 | 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSHFS_EXTERN_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /include/libfshfs/features.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Features of libfshfs 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_FEATURES_H ) 23 | #define _LIBFSHFS_FEATURES_H 24 | 25 | /* The libfshfs type support features 26 | */ 27 | #if defined( WINAPI ) || @HAVE_WIDE_CHARACTER_TYPE@ 28 | #define LIBFSHFS_HAVE_WIDE_CHARACTER_TYPE 1 29 | #endif 30 | 31 | #if defined( WINAPI ) || @HAVE_MULTI_THREAD_SUPPORT@ 32 | #define LIBFSHFS_HAVE_MULTI_THREAD_SUPPORT 1 33 | #endif 34 | 35 | #if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && @HAVE_LIBBFIO@ ) 36 | #define LIBFSHFS_HAVE_BFIO 1 37 | #endif 38 | 39 | #if !defined( LIBFSHFS_DEPRECATED ) 40 | #if defined( __GNUC__ ) && __GNUC__ >= 3 41 | #define LIBFSHFS_DEPRECATED __attribute__ ((__deprecated__)) 42 | #elif defined( _MSC_VER ) 43 | #define LIBFSHFS_DEPRECATED __declspec(deprecated) 44 | #else 45 | #define LIBFSHFS_DEPRECATED 46 | #endif 47 | #endif 48 | 49 | #endif /* !defined( _LIBFSHFS_FEATURES_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfshfs.ini: -------------------------------------------------------------------------------- 1 | [project] 2 | name: "libfshfs" 3 | status: "experimental" 4 | year_of_creation: "2009" 5 | data_format: "Hierarchical File System (HFS)" 6 | documentation_url: "https://github.com/libyal/libfshfs/tree/main/documentation" 7 | features: ["debug_output", "ossfuzz", "python_bindings", "tools"] 8 | 9 | [library] 10 | build_dependencies: ["zlib"] 11 | features: ["pthread", "wide_character_type"] 12 | public_types: ["data_stream", "extended_attribute", "file_entry", "volume"] 13 | 14 | [tools] 15 | build_dependencies: ["crypto", "fuse"] 16 | description: "Several tools for reading Hierarchical File System (HFS) volumes" 17 | names: ["fshfsinfo", "fshfsmount"] 18 | 19 | [info_tool] 20 | source_description: "a Hierarchical File System (HFS) volume" 21 | source_type: "volume" 22 | 23 | [mount_tool] 24 | features: ["extended_attributes", "offset", "symbolic_link"] 25 | file_entry_access_time_type: "hfs_time" 26 | file_entry_creation_time_type: "hfs_time" 27 | file_entry_inode_change_time_type: "hfs_time" 28 | file_entry_modification_time_type: "hfs_time" 29 | file_entry_type: "file_entry" 30 | file_system_type: "volume" 31 | mounted_description: "a file system contained in the HFS volume" 32 | source: "image.dmg" 33 | source_description: "a HFS volume" 34 | source_description_long: "a Hierarchical File System (HFS) volume" 35 | source_type: "volume" 36 | 37 | [tests] 38 | profiles: ["libfshfs", "pyfshfs", "fshfsinfo", "fshfsinfo_fs"] 39 | option_sets: ["offset"] 40 | info_tool_option_sets: ["offset"] 41 | info_tool_options_per_profile: ["", "-H"] 42 | info_tool_profiles: ["fshfsinfo", "fshfsinfo_fs"] 43 | 44 | [pypi] 45 | appveyor_token: "VHuZiUWgTqTciKE2nsv/LuZBy6+pskSFfz9EHVrulyZtYMn/DhD+4xRs7NSm5i83M7Ta/w6LbPQ2DmeLTrc9SuUnzTGKWQmRbN/10xVGTdlRWR56oBPd9uS7jTzT9j249p7Lwxz/BDHI3odbIGGIqbQ4B/tgqKR91oo9pVQ9BDRqWdHsBI6aRel6sMGeNajCdaXrvBCNZgr5DZE5d9Dgpi9WBcSOGIYgJeXrgs+r+4eoXEejEIIRIE7Xs8lFY9XY3uC5nunceomxqvQahqdqRWjF28nSqrGT41qmXaym7Jw=" 46 | 47 | -------------------------------------------------------------------------------- /libfshfs.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libfshfs 7 | Description: Library to access the Hierarchical File System (HFS) format 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lfshfs 10 | Libs.private: @ax_libbfio_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_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_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ @ax_zlib_pc_libs_private@ 11 | Cflags: -I${includedir} 12 | 13 | -------------------------------------------------------------------------------- /libfshfs/fshfs_attributes_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The HFS+ attributes B-tree file definitions 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_ATTRIBUTES_FILE_H ) 23 | #define _FSHFS_ATTRIBUTES_FILE_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fshfs_attributes_index_key_hfsplus fshfs_attributes_index_key_hfsplus_t; 33 | 34 | struct fshfs_attributes_index_key_hfsplus 35 | { 36 | /* The data size 37 | * Consists of 2 bytes 38 | */ 39 | uint8_t data_size[ 2 ]; 40 | 41 | /* Unknown 42 | * Consists of 2 bytes 43 | */ 44 | uint8_t unknown1[ 2 ]; 45 | 46 | /* The identifier (CNID) 47 | * Consists of 4 bytes 48 | */ 49 | uint8_t identifier[ 4 ]; 50 | 51 | /* Unknown 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t unknown2[ 4 ]; 55 | 56 | /* The number of characters of the name string 57 | * Consists of 2 bytes 58 | */ 59 | uint8_t name_size[ 2 ]; 60 | 61 | /* The name string 62 | * Variable of size 63 | */ 64 | }; 65 | 66 | typedef struct fshfs_attribute_record_hfsplus fshfs_attribute_record_hfsplus_t; 67 | 68 | struct fshfs_attribute_record_hfsplus 69 | { 70 | /* The record type 71 | * Consists of 4 bytes 72 | */ 73 | uint8_t record_type[ 4 ]; 74 | 75 | /* Unknown 76 | * Consists of 4 bytes 77 | */ 78 | uint8_t unknown1[ 4 ]; 79 | }; 80 | 81 | #if defined( __cplusplus ) 82 | } 83 | #endif 84 | 85 | #endif /* !defined( _FSHFS_ATTRIBUTES_FILE_H ) */ 86 | 87 | -------------------------------------------------------------------------------- /libfshfs/fshfs_compressed_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The HFS+ compressed data definitions 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_COMPRESSED_DATA_H ) 23 | #define _FSHFS_COMPRESSED_DATA_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fshfs_compressed_data_header fshfs_compressed_data_header_t; 33 | 34 | struct fshfs_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( _FSHFS_COMPRESSED_DATA_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfshfs/fshfs_extents_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The HFS extents (overflow) B-tree file definitions 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_EXTENTS_FILE_H ) 23 | #define _FSHFS_EXTENTS_FILE_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fshfs_extents_index_key_hfs fshfs_extents_index_key_hfs_t; 33 | 34 | struct fshfs_extents_index_key_hfs 35 | { 36 | /* The data size 37 | * Consists of 1 byte 38 | */ 39 | uint8_t data_size; 40 | 41 | /* The fork type 42 | * Consists of 1 byte 43 | */ 44 | uint8_t fork_type; 45 | 46 | /* The identifier (CNID) 47 | * Consists of 4 bytes 48 | */ 49 | uint8_t identifier[ 4 ]; 50 | 51 | /* The start block 52 | * Consists of 2 bytes 53 | */ 54 | uint8_t start_block[ 2 ]; 55 | }; 56 | 57 | typedef struct fshfs_extents_index_key_hfsplus fshfs_extents_index_key_hfsplus_t; 58 | 59 | struct fshfs_extents_index_key_hfsplus 60 | { 61 | /* The data size 62 | * Consists of 2 bytes 63 | */ 64 | uint8_t data_size[ 2 ]; 65 | 66 | /* The fork type 67 | * Consists of 1 byte 68 | */ 69 | uint8_t fork_type; 70 | 71 | /* Unknown (reserved) 72 | * Consists of 1 byte 73 | */ 74 | uint8_t unknown1; 75 | 76 | /* The identifier (CNID) 77 | * Consists of 4 bytes 78 | */ 79 | uint8_t identifier[ 4 ]; 80 | 81 | /* The start block 82 | * Consists of 4 bytes 83 | */ 84 | uint8_t start_block[ 4 ]; 85 | }; 86 | 87 | #if defined( __cplusplus ) 88 | } 89 | #endif 90 | 91 | #endif /* !defined( _FSHFS_EXTENTS_FILE_H ) */ 92 | 93 | -------------------------------------------------------------------------------- /libfshfs/fshfs_fork_descriptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The HFS+/HFSX fork descriptor definition 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_FORK_DESCRIPTOR_H ) 23 | #define _FSHFS_FORK_DESCRIPTOR_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fshfs_fork_descriptor fshfs_fork_descriptor_t; 33 | 34 | struct fshfs_fork_descriptor 35 | { 36 | /* The logical size 37 | * Consists of 8 bytes 38 | */ 39 | uint8_t logical_size[ 8 ]; 40 | 41 | /* The clump size 42 | * Consists of 4 bytes 43 | */ 44 | uint8_t clump_size[ 4 ]; 45 | 46 | /* The number of blocks 47 | * Consists of 4 bytes 48 | */ 49 | uint8_t number_of_blocks[ 4 ]; 50 | 51 | /* The first 8 extents 52 | * Consists of 8 x ( 4 + 4 ) = 64 bytes 53 | */ 54 | uint8_t extents[ 64 ]; 55 | }; 56 | 57 | #if defined( __cplusplus ) 58 | } 59 | #endif 60 | 61 | #endif /* !defined( _FSHFS_FORK_DESCRIPTOR_H ) */ 62 | 63 | -------------------------------------------------------------------------------- /libfshfs/libfshfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Library to access the Hierarchical File System (HFS) format 3 | * 4 | * Copyright (C) 2009-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 "libfshfs_unused.h" 29 | 30 | /* Define HAVE_LOCAL_LIBFSHFS for local use of libfshfs 31 | */ 32 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 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 | LIBFSHFS_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 libfshfs_is_dll( 72 | void ) 73 | { 74 | return( 1 ); 75 | } 76 | 77 | #endif /* defined( WINAPI ) && defined( HAVE_DLLMAIN ) */ 78 | 79 | #endif /* !defined( HAVE_LOCAL_LIBFSHFS ) */ 80 | 81 | -------------------------------------------------------------------------------- /libfshfs/libfshfs.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 Hierarchical File System (HFS) format\0" 25 | VALUE "FileVersion", "@VERSION@" "\0" 26 | VALUE "InternalName", "libfshfs.dll\0" 27 | VALUE "LegalCopyright", "(C) 2009-2024, Joachim Metz \0" 28 | VALUE "OriginalFilename", "libfshfs.dll\0" 29 | VALUE "ProductName", "libfshfs\0" 30 | VALUE "ProductVersion", "@VERSION@" "\0" 31 | VALUE "Comments", "For more information visit https://github.com/libyal/libfshfs/\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 1200 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_allocation_block_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Allocation block stream functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_ALLOCATION_BLOCK_STREAM_H ) 23 | #define _LIBFSHFS_ALLOCATION_BLOCK_STREAM_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_fork_descriptor.h" 29 | #include "libfshfs_io_handle.h" 30 | #include "libfshfs_libcdata.h" 31 | #include "libfshfs_libcerror.h" 32 | #include "libfshfs_libfdata.h" 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | int libfshfs_allocation_block_stream_initialize_from_data( 39 | libfdata_stream_t **allocation_block_stream, 40 | const uint8_t *data, 41 | size_t data_size, 42 | libcerror_error_t **error ); 43 | 44 | int libfshfs_allocation_block_stream_initialize_from_fork_descriptor( 45 | libfdata_stream_t **allocation_block_stream, 46 | libfshfs_io_handle_t *io_handle, 47 | libfshfs_fork_descriptor_t *fork_descriptor, 48 | libcerror_error_t **error ); 49 | 50 | int libfshfs_allocation_block_stream_initialize_from_extents( 51 | libfdata_stream_t **allocation_block_stream, 52 | libfshfs_io_handle_t *io_handle, 53 | libcdata_array_t *extents, 54 | size64_t data_size, 55 | libcerror_error_t **error ); 56 | 57 | int libfshfs_allocation_block_stream_initialize_from_compressed_stream( 58 | libfdata_stream_t **allocation_block_stream, 59 | libfdata_stream_t *compressed_allocation_block_stream, 60 | size64_t uncompressed_data_size, 61 | int compression_method, 62 | libcerror_error_t **error ); 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _LIBFSHFS_ALLOCATION_BLOCK_STREAM_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_bit_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bit-stream functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BIT_STREAM_H ) 23 | #define _LIBFSHFS_BIT_STREAM_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | /* The storage type 35 | */ 36 | enum LIBFSHFS_BIT_STREAM_STORAGE_TYPES 37 | { 38 | LIBFSHFS_BIT_STREAM_STORAGE_TYPE_UNKNOWN = 0x00, 39 | LIBFSHFS_BIT_STREAM_STORAGE_TYPE_BYTE_FRONT_TO_BACK = 0x01, 40 | LIBFSHFS_BIT_STREAM_STORAGE_TYPE_BYTE_BACK_TO_FRONT = 0x02 41 | }; 42 | 43 | typedef struct libfshfs_bit_stream libfshfs_bit_stream_t; 44 | 45 | struct libfshfs_bit_stream 46 | { 47 | /* The byte stream 48 | */ 49 | const uint8_t *byte_stream; 50 | 51 | /* The byte stream size 52 | */ 53 | size_t byte_stream_size; 54 | 55 | /* The byte stream offset 56 | */ 57 | size_t byte_stream_offset; 58 | 59 | /* The storage type 60 | */ 61 | uint8_t storage_type; 62 | 63 | /* The bit buffer 64 | */ 65 | uint32_t bit_buffer; 66 | 67 | /* The number of bits remaining in the bit buffer 68 | */ 69 | uint8_t bit_buffer_size; 70 | }; 71 | 72 | int libfshfs_bit_stream_initialize( 73 | libfshfs_bit_stream_t **bit_stream, 74 | const uint8_t *byte_stream, 75 | size_t byte_stream_size, 76 | size_t byte_stream_offset, 77 | uint8_t storage_type, 78 | libcerror_error_t **error ); 79 | 80 | int libfshfs_bit_stream_free( 81 | libfshfs_bit_stream_t **bit_stream, 82 | libcerror_error_t **error ); 83 | 84 | int libfshfs_bit_stream_get_value( 85 | libfshfs_bit_stream_t *bit_stream, 86 | uint8_t number_of_bits, 87 | uint32_t *value_32bit, 88 | libcerror_error_t **error ); 89 | 90 | #if defined( __cplusplus ) 91 | } 92 | #endif 93 | 94 | #endif /* !defined( _LIBFSHFS_BIT_STREAM_H ) */ 95 | 96 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_block_data_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Block data handle functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BLOCK_DATA_HANDLE_H ) 23 | #define _LIBFSHFS_BLOCK_DATA_HANDLE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_io_handle.h" 29 | #include "libfshfs_libbfio.h" 30 | #include "libfshfs_libcerror.h" 31 | #include "libfshfs_libfdata.h" 32 | 33 | #if defined( __cplusplus ) 34 | extern "C" { 35 | #endif 36 | 37 | ssize_t libfshfs_block_data_handle_read_segment_data( 38 | intptr_t *data_handle, 39 | libbfio_handle_t *file_io_handle, 40 | int segment_index, 41 | int segment_file_index, 42 | uint8_t *segment_data, 43 | size_t segment_data_size, 44 | uint32_t segment_flags, 45 | uint8_t read_flags, 46 | libcerror_error_t **error ); 47 | 48 | off64_t libfshfs_block_data_handle_seek_segment_offset( 49 | intptr_t *data_handle, 50 | libbfio_handle_t *file_io_handle, 51 | int segment_index, 52 | int segment_file_index, 53 | off64_t segment_offset, 54 | libcerror_error_t **error ); 55 | 56 | #if defined( __cplusplus ) 57 | } 58 | #endif 59 | 60 | #endif /* !defined( _LIBFSHFS_BLOCK_DATA_HANDLE_H ) */ 61 | 62 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_btree_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * B-tree header functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BTREE_HEADER_H ) 23 | #define _LIBFSHFS_BTREE_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_btree_header libfshfs_btree_header_t; 35 | 36 | struct libfshfs_btree_header 37 | { 38 | /* The node size 39 | */ 40 | uint16_t node_size; 41 | 42 | /* The root node number 43 | */ 44 | uint32_t root_node_number; 45 | 46 | /* The first leaf node number 47 | */ 48 | uint32_t first_leaf_node_number; 49 | 50 | /* The last leaf node number 51 | */ 52 | uint32_t last_leaf_node_number; 53 | }; 54 | 55 | int libfshfs_btree_header_initialize( 56 | libfshfs_btree_header_t **btree_header, 57 | libcerror_error_t **error ); 58 | 59 | int libfshfs_btree_header_free( 60 | libfshfs_btree_header_t **btree_header, 61 | libcerror_error_t **error ); 62 | 63 | int libfshfs_btree_header_read_data( 64 | libfshfs_btree_header_t *btree_header, 65 | const uint8_t *data, 66 | size_t data_size, 67 | libcerror_error_t **error ); 68 | 69 | #if defined( __cplusplus ) 70 | } 71 | #endif 72 | 73 | #endif /* !defined( _LIBFSHFS_BTREE_HEADER_H ) */ 74 | 75 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_btree_node_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * B-tree node cache functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BTREE_NODE_CACHE_H ) 23 | #define _LIBFSHFS_BTREE_NODE_CACHE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | #include "libfshfs_libfcache.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfshfs_btree_node_cache libfshfs_btree_node_cache_t; 36 | 37 | struct libfshfs_btree_node_cache 38 | { 39 | /* One MRU cache for each level of the B-tree 40 | */ 41 | libfcache_cache_t *caches[ 9 ]; 42 | }; 43 | 44 | int libfshfs_btree_node_cache_initialize( 45 | libfshfs_btree_node_cache_t **btree_node_cache, 46 | libcerror_error_t **error ); 47 | 48 | int libfshfs_btree_node_cache_free( 49 | libfshfs_btree_node_cache_t **btree_node_cache, 50 | libcerror_error_t **error ); 51 | 52 | #if defined( __cplusplus ) 53 | } 54 | #endif 55 | 56 | #endif /* !defined( _LIBFSHFS_BTREE_NODE_CACHE_H ) */ 57 | 58 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_btree_node_descriptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * B-tree node descriptor functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H ) 23 | #define _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_btree_node_descriptor libfshfs_btree_node_descriptor_t; 35 | 36 | struct libfshfs_btree_node_descriptor 37 | { 38 | /* The (node) type 39 | */ 40 | uint8_t type; 41 | 42 | /* The (node) level 43 | */ 44 | uint8_t level; 45 | 46 | /* The number of records 47 | */ 48 | uint16_t number_of_records; 49 | 50 | /* The next node number 51 | */ 52 | uint32_t next_node_number; 53 | 54 | /* The previous node number 55 | */ 56 | uint32_t previous_node_number; 57 | }; 58 | 59 | int libfshfs_btree_node_descriptor_initialize( 60 | libfshfs_btree_node_descriptor_t **btree_node_descriptor, 61 | libcerror_error_t **error ); 62 | 63 | int libfshfs_btree_node_descriptor_free( 64 | libfshfs_btree_node_descriptor_t **btree_node_descriptor, 65 | libcerror_error_t **error ); 66 | 67 | int libfshfs_btree_node_descriptor_read_data( 68 | libfshfs_btree_node_descriptor_t *btree_node_descriptor, 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( _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H ) */ 78 | 79 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_btree_node_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * B-tree node record functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BTREE_NODE_RECORD_H ) 23 | #define _LIBFSHFS_BTREE_NODE_RECORD_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_btree_node_record libfshfs_btree_node_record_t; 35 | 36 | struct libfshfs_btree_node_record 37 | { 38 | /* The reference to the node record data 39 | */ 40 | const uint8_t *data; 41 | 42 | /* The size of the node record data 43 | */ 44 | uint16_t data_size; 45 | 46 | /* The offset of the node record 47 | */ 48 | uint16_t offset; 49 | 50 | /* The key value 51 | */ 52 | intptr_t *key_value; 53 | 54 | /* The key value free function 55 | */ 56 | int (*key_value_free_function)( 57 | intptr_t **key_value, 58 | libcerror_error_t **error ); 59 | }; 60 | 61 | int libfshfs_btree_node_record_initialize( 62 | libfshfs_btree_node_record_t **node_record, 63 | libcerror_error_t **error ); 64 | 65 | int libfshfs_btree_node_record_free( 66 | libfshfs_btree_node_record_t **node_record, 67 | libcerror_error_t **error ); 68 | 69 | #if defined( __cplusplus ) 70 | } 71 | #endif 72 | 73 | #endif /* !defined( _LIBFSHFS_BTREE_NODE_RECORD_H ) */ 74 | 75 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_buffer_data_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The buffer data handle functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_BUFFER_DATA_HANDLE_H ) 23 | #define _LIBFSHFS_BUFFER_DATA_HANDLE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_buffer_data_handle libfshfs_buffer_data_handle_t; 35 | 36 | struct libfshfs_buffer_data_handle 37 | { 38 | /* The current offset 39 | */ 40 | off64_t current_offset; 41 | 42 | /* The data 43 | */ 44 | const uint8_t *data; 45 | 46 | /* The data size 47 | */ 48 | size_t data_size; 49 | }; 50 | 51 | int libfshfs_buffer_data_handle_initialize( 52 | libfshfs_buffer_data_handle_t **data_handle, 53 | const uint8_t *data, 54 | size_t data_size, 55 | libcerror_error_t **error ); 56 | 57 | int libfshfs_buffer_data_handle_free( 58 | libfshfs_buffer_data_handle_t **data_handle, 59 | libcerror_error_t **error ); 60 | 61 | ssize_t libfshfs_buffer_data_handle_read_segment_data( 62 | libfshfs_buffer_data_handle_t *data_handle, 63 | intptr_t *file_io_handle, 64 | int segment_index, 65 | int segment_file_index, 66 | uint8_t *segment_data, 67 | size_t segment_data_size, 68 | uint32_t segment_flags, 69 | uint8_t read_flags, 70 | libcerror_error_t **error ); 71 | 72 | off64_t libfshfs_buffer_data_handle_seek_segment_offset( 73 | libfshfs_buffer_data_handle_t *data_handle, 74 | intptr_t *file_io_handle, 75 | int segment_index, 76 | int segment_file_index, 77 | off64_t segment_offset, 78 | libcerror_error_t **error ); 79 | 80 | #if defined( __cplusplus ) 81 | } 82 | #endif 83 | 84 | #endif /* !defined( _LIBFSHFS_BUFFER_DATA_HANDLE_H ) */ 85 | 86 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_compressed_data_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The compressed data header functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_COMPRESSED_DATA_HEADER_H ) 23 | #define _LIBFSHFS_COMPRESSED_DATA_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_compressed_data_header libfshfs_compressed_data_header_t; 35 | 36 | struct libfshfs_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 libfshfs_compressed_data_header_initialize( 48 | libfshfs_compressed_data_header_t **compressed_data_header, 49 | libcerror_error_t **error ); 50 | 51 | int libfshfs_compressed_data_header_free( 52 | libfshfs_compressed_data_header_t **compressed_data_header, 53 | libcerror_error_t **error ); 54 | 55 | int libfshfs_compressed_data_header_read_data( 56 | libfshfs_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( _LIBFSHFS_COMPRESSED_DATA_HEADER_H ) */ 66 | 67 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_compression.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Compression functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_COMPRESSION_H ) 23 | #define _LIBFSHFS_COMPRESSION_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | int libfshfs_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( _LIBFSHFS_COMPRESSION_H ) */ 47 | 48 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_INTERNAL_ERROR_H ) 23 | #define _LIBFSHFS_INTERNAL_ERROR_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 30 | #include 31 | #endif 32 | 33 | #include "libfshfs_extern.h" 34 | 35 | #if defined( __cplusplus ) 36 | extern "C" { 37 | #endif 38 | 39 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 40 | 41 | LIBFSHFS_EXTERN \ 42 | void libfshfs_error_free( 43 | libfshfs_error_t **error ); 44 | 45 | LIBFSHFS_EXTERN \ 46 | int libfshfs_error_fprint( 47 | libfshfs_error_t *error, 48 | FILE *stream ); 49 | 50 | LIBFSHFS_EXTERN \ 51 | int libfshfs_error_sprint( 52 | libfshfs_error_t *error, 53 | char *string, 54 | size_t size ); 55 | 56 | LIBFSHFS_EXTERN \ 57 | int libfshfs_error_backtrace_fprint( 58 | libfshfs_error_t *error, 59 | FILE *stream ); 60 | 61 | LIBFSHFS_EXTERN \ 62 | int libfshfs_error_backtrace_sprint( 63 | libfshfs_error_t *error, 64 | char *string, 65 | size_t size ); 66 | 67 | #endif /* !defined( HAVE_LOCAL_LIBFSHFS ) */ 68 | 69 | #if defined( __cplusplus ) 70 | } 71 | #endif 72 | 73 | #endif /* !defined( _LIBFSHFS_INTERNAL_ERROR_H ) */ 74 | 75 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_extent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Extent functions 3 | * 4 | * Copyright (C) 2010-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( _LIBFSHFS_EXTENT_H ) 23 | #define _LIBFSHFS_EXTENT_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | #include "libfshfs_io_handle.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfshfs_extent libfshfs_extent_t; 36 | 37 | struct libfshfs_extent 38 | { 39 | /* Block number 40 | */ 41 | uint32_t block_number; 42 | 43 | /* Number of blocks 44 | */ 45 | uint64_t number_of_blocks; 46 | }; 47 | 48 | int libfshfs_extent_initialize( 49 | libfshfs_extent_t **extent, 50 | libcerror_error_t **error ); 51 | 52 | int libfshfs_extent_free( 53 | libfshfs_extent_t **extent, 54 | libcerror_error_t **error ); 55 | 56 | int libfshfs_extent_get_values( 57 | libfshfs_extent_t *extent, 58 | libfshfs_io_handle_t *io_handle, 59 | off64_t *extent_offset, 60 | size64_t *extent_size, 61 | uint32_t *extent_flags, 62 | libcerror_error_t **error ); 63 | 64 | #if defined( __cplusplus ) 65 | } 66 | #endif 67 | 68 | #endif /* !defined( _LIBFSHFS_EXTENT_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_extents_btree_key.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The extents (overflow) B-tree key functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_EXTENTS_BTREE_KEY_H ) 23 | #define _LIBFSHFS_EXTENTS_BTREE_KEY_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_extents_btree_key libfshfs_extents_btree_key_t; 35 | 36 | struct libfshfs_extents_btree_key 37 | { 38 | /* Data size 39 | */ 40 | size_t data_size; 41 | 42 | /* Fork type 43 | */ 44 | uint8_t fork_type; 45 | 46 | /* Identifier 47 | */ 48 | uint32_t identifier; 49 | 50 | /* Start block 51 | */ 52 | uint32_t start_block; 53 | 54 | /* Record data 55 | */ 56 | const uint8_t *record_data; 57 | 58 | /* Record data size 59 | */ 60 | size_t record_data_size; 61 | }; 62 | 63 | int libfshfs_extents_btree_key_initialize( 64 | libfshfs_extents_btree_key_t **extents_btree_key, 65 | libcerror_error_t **error ); 66 | 67 | int libfshfs_extents_btree_key_free( 68 | libfshfs_extents_btree_key_t **extents_btree_key, 69 | libcerror_error_t **error ); 70 | 71 | int libfshfs_extents_btree_key_read_data( 72 | libfshfs_extents_btree_key_t *extents_btree_key, 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( _LIBFSHFS_EXTENTS_BTREE_KEY_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_extents_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Extents record functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_EXTENTS_RECORD_H ) 23 | #define _LIBFSHFS_EXTENTS_RECORD_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_fork_descriptor.h" 29 | #include "libfshfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int libfshfs_extents_record_read_data( 36 | libfshfs_fork_descriptor_t *fork_descriptor, 37 | uint16_t extents_start_block_number, 38 | const uint8_t *data, 39 | size_t data_size, 40 | libcerror_error_t **error ); 41 | 42 | #if defined( __cplusplus ) 43 | } 44 | #endif 45 | 46 | #endif /* !defined( _LIBFSHFS_EXTENTS_RECORD_H ) */ 47 | 48 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_extern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal extern definition 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_INTERNAL_EXTERN_H ) 23 | #define _LIBFSHFS_INTERNAL_EXTERN_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFSHFS for local use of libfshfs 28 | */ 29 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 30 | 31 | #include 32 | 33 | #if defined( __CYGWIN__ ) || defined( __MINGW32__ ) 34 | #define LIBFSHFS_EXTERN_VARIABLE extern 35 | #else 36 | #define LIBFSHFS_EXTERN_VARIABLE LIBFSHFS_EXTERN 37 | #endif 38 | 39 | #else 40 | #define LIBFSHFS_EXTERN /* extern */ 41 | #define LIBFSHFS_EXTERN_VARIABLE extern 42 | 43 | #endif /* !defined( HAVE_LOCAL_LIBFSHFS ) */ 44 | 45 | #endif /* !defined( _LIBFSHFS_INTERNAL_EXTERN_H ) */ 46 | 47 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_huffman_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Huffman tree functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_HUFFMAN_TREE_H ) 23 | #define _LIBFSHFS_HUFFMAN_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_bit_stream.h" 29 | #include "libfshfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfshfs_huffman_tree libfshfs_huffman_tree_t; 36 | 37 | struct libfshfs_huffman_tree 38 | { 39 | /* The maximum number of bits allowed for a Huffman code 40 | */ 41 | uint8_t maximum_code_size; 42 | 43 | /* The symbols array 44 | */ 45 | uint16_t *symbols; 46 | 47 | /* The code size counts array 48 | */ 49 | int *code_size_counts; 50 | }; 51 | 52 | int libfshfs_huffman_tree_initialize( 53 | libfshfs_huffman_tree_t **huffman_tree, 54 | int number_of_symbols, 55 | uint8_t maximum_code_size, 56 | libcerror_error_t **error ); 57 | 58 | int libfshfs_huffman_tree_free( 59 | libfshfs_huffman_tree_t **huffman_tree, 60 | libcerror_error_t **error ); 61 | 62 | int libfshfs_huffman_tree_build( 63 | libfshfs_huffman_tree_t *huffman_tree, 64 | const uint8_t *code_sizes_array, 65 | int number_of_code_sizes, 66 | libcerror_error_t **error ); 67 | 68 | int libfshfs_huffman_tree_get_symbol_from_bit_stream( 69 | libfshfs_huffman_tree_t *huffman_tree, 70 | libfshfs_bit_stream_t *bit_stream, 71 | uint16_t *symbol, 72 | libcerror_error_t **error ); 73 | 74 | #if defined( __cplusplus ) 75 | } 76 | #endif 77 | 78 | #endif /* !defined( _LIBFSHFS_HUFFMAN_TREE_H ) */ 79 | 80 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_io_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Input/Output (IO) handle functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_IO_HANDLE_H ) 23 | #define _LIBFSHFS_IO_HANDLE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | #include "libfshfs_profiler.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfshfs_io_handle libfshfs_io_handle_t; 36 | 37 | struct libfshfs_io_handle 38 | { 39 | /* The file system type 40 | */ 41 | uint8_t file_system_type; 42 | 43 | /* The block size 44 | */ 45 | uint32_t block_size; 46 | 47 | #if defined( HAVE_PROFILER ) 48 | /* The profiler 49 | */ 50 | libfshfs_profiler_t *profiler; 51 | #endif 52 | 53 | /* Value to indicate if abort was signalled 54 | */ 55 | int abort; 56 | }; 57 | 58 | int libfshfs_io_handle_initialize( 59 | libfshfs_io_handle_t **io_handle, 60 | libcerror_error_t **error ); 61 | 62 | int libfshfs_io_handle_free( 63 | libfshfs_io_handle_t **io_handle, 64 | libcerror_error_t **error ); 65 | 66 | int libfshfs_io_handle_clear( 67 | libfshfs_io_handle_t *io_handle, 68 | libcerror_error_t **error ); 69 | 70 | #if defined( __cplusplus ) 71 | } 72 | #endif 73 | 74 | #endif /* !defined( _LIBFSHFS_IO_HANDLE_H ) */ 75 | 76 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBBFIO_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libcdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcdata header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBCDATA_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBCDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBCERROR_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBCLOCALE_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBCNOTIFY_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libcthreads.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcthreads header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBCTHREADS_H ) 23 | #define _LIBFSHFS_LIBCTHREADS_H 24 | 25 | #include 26 | 27 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBFSHFS ) 28 | #define HAVE_LIBFSHFS_MULTI_THREAD_SUPPORT 29 | #endif 30 | 31 | #if defined( HAVE_LIBFSHFS_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_LIBFSHFS_MULTI_THREAD_SUPPORT ) */ 62 | 63 | #endif /* !defined( _LIBFSHFS_LIBCTHREADS_H ) */ 64 | 65 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libfcache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfcache header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBFCACHE_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBFCACHE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBFDATA_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBFDATETIME_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBFGUID_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libfmos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfmos header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBFMOS_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBFMOS_H ) */ 51 | 52 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_LIBUNA_H ) 23 | #define _LIBFSHFS_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( _LIBFSHFS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Notification functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_NOTIFY_H ) 23 | #define _LIBFSHFS_NOTIFY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "libfshfs_extern.h" 30 | #include "libfshfs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 37 | 38 | LIBFSHFS_EXTERN \ 39 | void libfshfs_notify_set_verbose( 40 | int verbose ); 41 | 42 | LIBFSHFS_EXTERN \ 43 | int libfshfs_notify_set_stream( 44 | FILE *stream, 45 | libcerror_error_t **error ); 46 | 47 | LIBFSHFS_EXTERN \ 48 | int libfshfs_notify_stream_open( 49 | const char *filename, 50 | libcerror_error_t **error ); 51 | 52 | LIBFSHFS_EXTERN \ 53 | int libfshfs_notify_stream_close( 54 | libcerror_error_t **error ); 55 | 56 | #endif /* !defined( HAVE_LOCAL_LIBFSHFS ) */ 57 | 58 | #if defined( __cplusplus ) 59 | } 60 | #endif 61 | 62 | #endif /* !defined( _LIBFSHFS_NOTIFY_H ) */ 63 | 64 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_profiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The profiler functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_PROFILER_H ) 23 | #define _LIBFSHFS_PROFILER_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "libfshfs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | #if defined( HAVE_PROFILER ) 36 | 37 | typedef struct libfshfs_profiler libfshfs_profiler_t; 38 | 39 | struct libfshfs_profiler 40 | { 41 | /* The output stream 42 | */ 43 | FILE *output_stream; 44 | }; 45 | 46 | int libfshfs_profiler_initialize( 47 | libfshfs_profiler_t **profiler, 48 | libcerror_error_t **error ); 49 | 50 | int libfshfs_profiler_free( 51 | libfshfs_profiler_t **profiler, 52 | libcerror_error_t **error ); 53 | 54 | int libfshfs_profiler_open( 55 | libfshfs_profiler_t *profiler, 56 | const char *filename, 57 | libcerror_error_t **error ); 58 | 59 | int libfshfs_profiler_close( 60 | libfshfs_profiler_t *profiler, 61 | libcerror_error_t **error ); 62 | 63 | int libfshfs_profiler_start_timing( 64 | libfshfs_profiler_t *profiler, 65 | int64_t *start_timestamp, 66 | libcerror_error_t **error ); 67 | 68 | int libfshfs_profiler_stop_timing( 69 | libfshfs_profiler_t *profiler, 70 | int64_t start_timestamp, 71 | const char *name, 72 | off64_t offset, 73 | size64_t size, 74 | const char *cache_hit_or_miss, 75 | libcerror_error_t **error ); 76 | 77 | #endif /* defined( HAVE_PROFILER ) */ 78 | 79 | #if defined( __cplusplus ) 80 | } 81 | #endif 82 | 83 | #endif /* !defined( _LIBFSHFS_PROFILER_H ) */ 84 | 85 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Support functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_SUPPORT_H ) 23 | #define _LIBFSHFS_SUPPORT_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_extern.h" 29 | #include "libfshfs_libbfio.h" 30 | #include "libfshfs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | #if !defined( HAVE_LOCAL_LIBFSHFS ) 37 | 38 | LIBFSHFS_EXTERN \ 39 | const char *libfshfs_get_version( 40 | void ); 41 | 42 | LIBFSHFS_EXTERN \ 43 | int libfshfs_get_access_flags_read( 44 | void ); 45 | 46 | LIBFSHFS_EXTERN \ 47 | int libfshfs_get_codepage( 48 | int *codepage, 49 | libcerror_error_t **error ); 50 | 51 | LIBFSHFS_EXTERN \ 52 | int libfshfs_set_codepage( 53 | int codepage, 54 | libcerror_error_t **error ); 55 | 56 | #endif /* !defined( HAVE_LOCAL_LIBFSHFS ) */ 57 | 58 | LIBFSHFS_EXTERN \ 59 | int libfshfs_check_volume_signature( 60 | const char *filename, 61 | libcerror_error_t **error ); 62 | 63 | #if defined( HAVE_WIDE_CHARACTER_TYPE ) 64 | 65 | LIBFSHFS_EXTERN \ 66 | int libfshfs_check_volume_signature_wide( 67 | const wchar_t *filename, 68 | libcerror_error_t **error ); 69 | 70 | #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ 71 | 72 | LIBFSHFS_EXTERN \ 73 | int libfshfs_check_volume_signature_file_io_handle( 74 | libbfio_handle_t *file_io_handle, 75 | libcerror_error_t **error ); 76 | 77 | #if defined( __cplusplus ) 78 | } 79 | #endif 80 | 81 | #endif /* !defined( _LIBFSHFS_SUPPORT_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_thread_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Catalog B-tree file thread record functions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_THREAD_RECORD_H ) 23 | #define _LIBFSHFS_THREAD_RECORD_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfshfs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfshfs_thread_record libfshfs_thread_record_t; 35 | 36 | struct libfshfs_thread_record 37 | { 38 | /* Identifier 39 | */ 40 | uint32_t identifier; 41 | 42 | /* Parent identifier 43 | */ 44 | uint32_t parent_identifier; 45 | 46 | /* Name size 47 | */ 48 | uint16_t name_size; 49 | 50 | /* Name 51 | */ 52 | uint8_t *name; 53 | 54 | /* Codepage of the name 55 | */ 56 | int codepage; 57 | }; 58 | 59 | int libfshfs_thread_record_initialize( 60 | libfshfs_thread_record_t **thread_record, 61 | uint32_t identifier, 62 | libcerror_error_t **error ); 63 | 64 | int libfshfs_thread_record_free( 65 | libfshfs_thread_record_t **thread_record, 66 | libcerror_error_t **error ); 67 | 68 | int libfshfs_thread_record_read_data( 69 | libfshfs_thread_record_t *thread_record, 70 | const uint8_t *data, 71 | size_t data_size, 72 | libcerror_error_t **error ); 73 | 74 | #if defined( __cplusplus ) 75 | } 76 | #endif 77 | 78 | #endif /* !defined( _LIBFSHFS_THREAD_RECORD_H ) */ 79 | 80 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal type definitions 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_INTERNAL_TYPES_H ) 23 | #define _LIBFSHFS_INTERNAL_TYPES_H 24 | 25 | #include 26 | #include 27 | 28 | /* Define HAVE_LOCAL_LIBFSHFS for local use of libfshfs 29 | * The definitions in are copied here 30 | * for local use of libfshfs 31 | */ 32 | #if defined( HAVE_LOCAL_LIBFSHFS ) 33 | 34 | /* The following type definitions hide internal data structures 35 | */ 36 | #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) 37 | typedef struct libfshfs_data_stream {} libfshfs_data_stream_t; 38 | typedef struct libfshfs_extended_attribute {} libfshfs_extended_attribute_t; 39 | typedef struct libfshfs_file_entry {} libfshfs_file_entry_t; 40 | typedef struct libfshfs_volume {} libfshfs_volume_t; 41 | 42 | #else 43 | typedef intptr_t libfshfs_data_stream_t; 44 | typedef intptr_t libfshfs_extended_attribute_t; 45 | typedef intptr_t libfshfs_file_entry_t; 46 | typedef intptr_t libfshfs_volume_t; 47 | 48 | #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ 49 | 50 | #endif /* defined( HAVE_LOCAL_LIBFSHFS ) */ 51 | 52 | #endif /* !defined( _LIBFSHFS_INTERNAL_TYPES_H ) */ 53 | 54 | -------------------------------------------------------------------------------- /libfshfs/libfshfs_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2009-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( _LIBFSHFS_UNUSED_H ) 23 | #define _LIBFSHFS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( LIBFSHFS_ATTRIBUTE_UNUSED ) 28 | #if defined( __GNUC__ ) && __GNUC__ >= 3 29 | #define LIBFSHFS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 30 | #else 31 | #define LIBFSHFS_ATTRIBUTE_UNUSED 32 | #endif 33 | #endif 34 | 35 | #if defined( _MSC_VER ) 36 | #define LIBFSHFS_UNREFERENCED_PARAMETER( parameter ) \ 37 | UNREFERENCED_PARAMETER( parameter ); 38 | #else 39 | #define LIBFSHFS_UNREFERENCED_PARAMETER( parameter ) \ 40 | /* parameter */ 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSHFS_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 | fshfsinfo.1 \ 3 | fshfsmount.1 \ 4 | libfshfs.3 5 | 6 | EXTRA_DIST = \ 7 | fshfsinfo.1 \ 8 | fshfsmount.1 \ 9 | libfshfs.3 10 | 11 | DISTCLEANFILES = \ 12 | Makefile \ 13 | Makefile.in 14 | 15 | -------------------------------------------------------------------------------- /manuals/fshfsinfo.1: -------------------------------------------------------------------------------- 1 | .Dd July 28, 2022 2 | .Dt fshfsinfo 3 | .Os libfshfs 4 | .Sh NAME 5 | .Nm fshfsinfo 6 | .Nd determines information about a Hierarchical File System (HFS) volume 7 | .Sh SYNOPSIS 8 | .Nm fshfsinfo 9 | .Op Fl B Ar bodyfile 10 | .Op Fl E Ar identifier 11 | .Op Fl F Ar path 12 | .Op Fl o Ar offset 13 | .Op Fl dhHvV 14 | .Ar source 15 | .Sh DESCRIPTION 16 | .Nm fshfsinfo 17 | is a utility to determine information about a Hierarchical File System (HFS) volume 18 | .Pp 19 | .Nm fshfsinfo 20 | is part of the 21 | .Nm libfshfs 22 | package. 23 | .Nm libfshfs 24 | is a library to access the Hierarchical File System (HFS) 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 B Ar bodyfile 32 | output file system information as a bodyfile 33 | .It Fl d 34 | calculate a MD5 hash of a file entry to include in the bodyfile 35 | .It Fl E Ar identifier 36 | show information about a specific file system entry or "all" 37 | .It Fl f Ar file_system_index 38 | show information about a specific file system or "all" 39 | .It Fl F Ar path 40 | show information about a specific file entry path 41 | .It Fl h 42 | shows this help 43 | .It Fl H 44 | shows the file system hierarchy 45 | .It Fl o Ar offset 46 | specify the volume offset 47 | .It Fl v 48 | verbose output to stderr 49 | .It Fl V 50 | print version 51 | .El 52 | .Sh ENVIRONMENT 53 | None 54 | .Sh FILES 55 | None 56 | .Sh EXAMPLES 57 | .Bd -literal 58 | # fshfsinfo hfsplus.raw 59 | fshfsinfo 20220727 60 | .sp 61 | Hierarchical File System information: 62 | .sp 63 | Volume information: 64 | Name : hfsplus_test 65 | .sp 66 | .Ed 67 | .Sh DIAGNOSTICS 68 | Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. 69 | Verbose and debug output are only printed when enabled at compilation. 70 | .Sh BUGS 71 | Please report bugs of any kind to or on the project website: 72 | https://github.com/libyal/libfshfs/ 73 | .Sh AUTHOR 74 | These man pages were written by Joachim Metz. 75 | .Sh COPYRIGHT 76 | Copyright 2009-2022, Joachim Metz . 77 | This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 78 | .Sh SEE ALSO 79 | -------------------------------------------------------------------------------- /manuals/fshfsmount.1: -------------------------------------------------------------------------------- 1 | .Dd July 29, 2021 2 | .Dt fshfsmount 3 | .Os libfshfs 4 | .Sh NAME 5 | .Nm fshfsmount 6 | .Nd mounts a Hierarchical File System (HFS) volume 7 | .Sh SYNOPSIS 8 | .Nm fshfsmount 9 | .Op Fl o Ar offset 10 | .Op Fl hvV 11 | .Ar source 12 | .Sh DESCRIPTION 13 | .Nm fshfsmount 14 | is a utility to mount a Hierarchical File System (HFS) volume 15 | .Pp 16 | .Nm fshfsmount 17 | is part of the 18 | .Nm libfshfs 19 | package. 20 | .Nm libfshfs 21 | is a library to access the Hierarchical File System (HFS) format 22 | .Pp 23 | .Ar source 24 | is the source file. 25 | .Pp 26 | The options are as follows: 27 | .Bl -tag -width Ds 28 | .It Fl h 29 | shows this help 30 | .It Fl o Ar offset 31 | specify the volume offset in bytes 32 | .It Fl v 33 | verbose output to stderr 34 | .It Fl V 35 | print version 36 | .It Fl X Ar extended_options 37 | extended options to pass to sub system 38 | .El 39 | .Sh ENVIRONMENT 40 | None 41 | .Sh FILES 42 | None 43 | .Sh EXAMPLES 44 | .Bd -literal 45 | # fshfsmount /dev/sda1 46 | fshfsmount 20210729 47 | .sp 48 | .Ed 49 | .Sh DIAGNOSTICS 50 | Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. 51 | Verbose and debug output are only printed when enabled at compilation. 52 | .Sh BUGS 53 | Please report bugs of any kind to or on the project website: 54 | https://github.com/libyal/libfshfs/ 55 | .Sh AUTHOR 56 | These man pages were written by Joachim Metz. 57 | .Sh COPYRIGHT 58 | Copyright (C) 2009-2024, Joachim Metz . 59 | This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 60 | .Sh SEE ALSO 61 | .Xr fshfsinfo 1 62 | -------------------------------------------------------------------------------- /ossfuzz/Makefile.am: -------------------------------------------------------------------------------- 1 | if HAVE_LIB_FUZZING_ENGINE 2 | AM_CPPFLAGS = \ 3 | -I../include -I$(top_srcdir)/include \ 4 | -I../common -I$(top_srcdir)/common \ 5 | @LIBCERROR_CPPFLAGS@ \ 6 | @LIBCDATA_CPPFLAGS@ \ 7 | @LIBCLOCALE_CPPFLAGS@ \ 8 | @LIBCNOTIFY_CPPFLAGS@ \ 9 | @LIBUNA_CPPFLAGS@ \ 10 | @LIBCFILE_CPPFLAGS@ \ 11 | @LIBCPATH_CPPFLAGS@ \ 12 | @LIBBFIO_CPPFLAGS@ 13 | 14 | bin_PROGRAMS = \ 15 | extended_attribute_fuzzer \ 16 | file_entry_fuzzer \ 17 | volume_fuzzer 18 | 19 | extended_attribute_fuzzer_SOURCES = \ 20 | extended_attribute_fuzzer.cc \ 21 | ossfuzz_libbfio.h \ 22 | ossfuzz_libfshfs.h 23 | 24 | extended_attribute_fuzzer_LDADD = \ 25 | @LIB_FUZZING_ENGINE@ \ 26 | @LIBBFIO_LIBADD@ \ 27 | @LIBCPATH_LIBADD@ \ 28 | @LIBCFILE_LIBADD@ \ 29 | @LIBUNA_LIBADD@ \ 30 | @LIBCDATA_LIBADD@ \ 31 | ../libfshfs/libfshfs.la \ 32 | @LIBCNOTIFY_LIBADD@ \ 33 | @LIBCLOCALE_LIBADD@ \ 34 | @LIBCERROR_LIBADD@ \ 35 | @LIBINTL@ 36 | 37 | file_entry_fuzzer_SOURCES = \ 38 | file_entry_fuzzer.cc \ 39 | ossfuzz_libbfio.h \ 40 | ossfuzz_libfshfs.h 41 | 42 | file_entry_fuzzer_LDADD = \ 43 | @LIB_FUZZING_ENGINE@ \ 44 | @LIBBFIO_LIBADD@ \ 45 | @LIBCPATH_LIBADD@ \ 46 | @LIBCFILE_LIBADD@ \ 47 | @LIBUNA_LIBADD@ \ 48 | @LIBCDATA_LIBADD@ \ 49 | ../libfshfs/libfshfs.la \ 50 | @LIBCNOTIFY_LIBADD@ \ 51 | @LIBCLOCALE_LIBADD@ \ 52 | @LIBCERROR_LIBADD@ \ 53 | @LIBINTL@ 54 | 55 | volume_fuzzer_SOURCES = \ 56 | ossfuzz_libbfio.h \ 57 | ossfuzz_libfshfs.h \ 58 | volume_fuzzer.cc 59 | 60 | volume_fuzzer_LDADD = \ 61 | @LIB_FUZZING_ENGINE@ \ 62 | @LIBBFIO_LIBADD@ \ 63 | @LIBCPATH_LIBADD@ \ 64 | @LIBCFILE_LIBADD@ \ 65 | @LIBUNA_LIBADD@ \ 66 | @LIBCDATA_LIBADD@ \ 67 | ../libfshfs/libfshfs.la \ 68 | @LIBCNOTIFY_LIBADD@ \ 69 | @LIBCLOCALE_LIBADD@ \ 70 | @LIBCERROR_LIBADD@ \ 71 | @LIBINTL@ 72 | endif 73 | 74 | DISTCLEANFILES = \ 75 | Makefile \ 76 | Makefile.in 77 | 78 | splint-local: 79 | @echo "Running splint on extended_attribute_fuzzer ..." 80 | -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(extended_attribute_fuzzer_SOURCES) 81 | @echo "Running splint on file_entry_fuzzer ..." 82 | -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(file_entry_fuzzer_SOURCES) 83 | @echo "Running splint on volume_fuzzer ..." 84 | -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(volume_fuzzer_SOURCES) 85 | 86 | -------------------------------------------------------------------------------- /ossfuzz/ossfuzz_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2009-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_libfshfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfshfs header wrapper 3 | * 4 | * Copyright (C) 2009-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_LIBFSHFS_H ) 23 | #define _OSSFUZZ_LIBFSHFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _OSSFUZZ_LIBFSHFS_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 | -------------------------------------------------------------------------------- /pyfshfs/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 | @LIBFSHFS_DLL_IMPORT@ 14 | 15 | pyexec_LTLIBRARIES = pyfshfs.la 16 | 17 | pyfshfs_la_SOURCES = \ 18 | pyfshfs.c pyfshfs.h \ 19 | pyfshfs_data_stream.c pyfshfs_data_stream.h \ 20 | pyfshfs_datetime.c pyfshfs_datetime.h \ 21 | pyfshfs_error.c pyfshfs_error.h \ 22 | pyfshfs_extended_attribute.c pyfshfs_extended_attribute.h \ 23 | pyfshfs_extended_attributes.c pyfshfs_extended_attributes.h \ 24 | pyfshfs_file_entry.c pyfshfs_file_entry.h \ 25 | pyfshfs_file_entries.c pyfshfs_file_entries.h \ 26 | pyfshfs_file_object_io_handle.c pyfshfs_file_object_io_handle.h \ 27 | pyfshfs_integer.c pyfshfs_integer.h \ 28 | pyfshfs_libbfio.h \ 29 | pyfshfs_libcerror.h \ 30 | pyfshfs_libfshfs.h \ 31 | pyfshfs_python.h \ 32 | pyfshfs_unused.h \ 33 | pyfshfs_volume.c pyfshfs_volume.h 34 | 35 | pyfshfs_la_LIBADD = \ 36 | @LIBCERROR_LIBADD@ \ 37 | ../libfshfs/libfshfs.la \ 38 | @LIBCDATA_LIBADD@ \ 39 | @LIBCLOCALE_LIBADD@ \ 40 | @LIBCSPLIT_LIBADD@ \ 41 | @LIBUNA_LIBADD@ \ 42 | @LIBCFILE_LIBADD@ \ 43 | @LIBCPATH_LIBADD@ \ 44 | @LIBBFIO_LIBADD@ 45 | 46 | pyfshfs_la_CPPFLAGS = $(PYTHON_CPPFLAGS) 47 | pyfshfs_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) 48 | 49 | endif 50 | 51 | DISTCLEANFILES = \ 52 | Makefile \ 53 | Makefile.in 54 | 55 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Python bindings module for libfshfs (pyfshfs) 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_H ) 23 | #define _PYFSHFS_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfshfs_python.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | PyObject *pyfshfs_get_version( 35 | PyObject *self, 36 | PyObject *arguments ); 37 | 38 | PyObject *pyfshfs_check_volume_signature( 39 | PyObject *self, 40 | PyObject *arguments, 41 | PyObject *keywords ); 42 | 43 | PyObject *pyfshfs_check_volume_signature_file_object( 44 | PyObject *self, 45 | PyObject *arguments, 46 | PyObject *keywords ); 47 | 48 | PyObject *pyfshfs_open_new_volume( 49 | PyObject *self, 50 | PyObject *arguments, 51 | PyObject *keywords ); 52 | 53 | PyObject *pyfshfs_open_new_volume_with_file_object( 54 | PyObject *self, 55 | PyObject *arguments, 56 | PyObject *keywords ); 57 | 58 | #if PY_MAJOR_VERSION >= 3 59 | PyMODINIT_FUNC PyInit_pyfshfs( 60 | void ); 61 | #else 62 | PyMODINIT_FUNC initpyfshfs( 63 | void ); 64 | #endif 65 | 66 | #if defined( __cplusplus ) 67 | } 68 | #endif 69 | 70 | #endif /* !defined( _PYFSHFS_H ) */ 71 | 72 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_datetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Date and time functions 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_DATETIME_H ) 23 | #define _PYFSHFS_DATETIME_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfshfs_python.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | PyObject *pyfshfs_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 *pyfshfs_datetime_new_from_fat_date_time( 43 | uint32_t fat_date_time ); 44 | 45 | PyObject *pyfshfs_datetime_new_from_filetime( 46 | uint64_t filetime ); 47 | 48 | PyObject *pyfshfs_datetime_new_from_floatingtime( 49 | uint64_t floatingtime ); 50 | 51 | PyObject *pyfshfs_datetime_new_from_hfs_time( 52 | uint32_t hfs_time ); 53 | 54 | PyObject *pyfshfs_datetime_new_from_posix_time( 55 | int64_t posix_time ); 56 | 57 | PyObject *pyfshfs_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( _PYFSHFS_DATETIME_H ) */ 65 | 66 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_ERROR_H ) 23 | #define _PYFSHFS_ERROR_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfshfs_libcerror.h" 29 | #include "pyfshfs_python.h" 30 | 31 | #define PYFSHFS_ERROR_STRING_SIZE 2048 32 | 33 | #if defined( __cplusplus ) 34 | extern "C" { 35 | #endif 36 | 37 | void pyfshfs_error_fetch( 38 | libcerror_error_t **error, 39 | int error_domain, 40 | int error_code, 41 | const char *format_string, 42 | ... ); 43 | 44 | void pyfshfs_error_fetch_and_raise( 45 | PyObject *exception_object, 46 | const char *format_string, 47 | ... ); 48 | 49 | void pyfshfs_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( _PYFSHFS_ERROR_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Integer functions 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_INTEGER_H ) 23 | #define _PYFSHFS_INTEGER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "pyfshfs_libcerror.h" 29 | #include "pyfshfs_python.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | PyObject *pyfshfs_integer_signed_new_from_64bit( 36 | int64_t value_64bit ); 37 | 38 | PyObject *pyfshfs_integer_unsigned_new_from_64bit( 39 | uint64_t value_64bit ); 40 | 41 | int pyfshfs_integer_signed_copy_to_64bit( 42 | PyObject *integer_object, 43 | int64_t *value_64bit, 44 | libcerror_error_t **error ); 45 | 46 | int pyfshfs_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( _PYFSHFS_INTEGER_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_LIBBFIO_H ) 23 | #define _PYFSHFS_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( _PYFSHFS_LIBBFIO_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_LIBCERROR_H ) 23 | #define _PYFSHFS_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( _PYFSHFS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_libfshfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal libfshfs header 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_LIBFSHFS_H ) 23 | #define _PYFSHFS_LIBFSHFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _PYFSHFS_LIBFSHFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_python.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The python header wrapper 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_PYTHON_H ) 23 | #define _PYFSHFS_PYTHON_H 24 | 25 | #include 26 | 27 | #if PY_MAJOR_VERSION < 3 28 | 29 | /* Fix defines in pyconfig.h 30 | */ 31 | #undef _POSIX_C_SOURCE 32 | #undef _XOPEN_SOURCE 33 | 34 | /* Fix defines in pyport.h 35 | */ 36 | #undef HAVE_FSTAT 37 | #undef HAVE_STAT 38 | #undef HAVE_SSIZE_T 39 | #undef HAVE_INT32_T 40 | #undef HAVE_UINT32_T 41 | #undef HAVE_INT64_T 42 | #undef HAVE_UINT64_T 43 | 44 | #endif /* PY_MAJOR_VERSION < 3 */ 45 | 46 | /* Define PY_SSIZE_T_CLEAN to silence: 47 | * DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats 48 | * 49 | * PY_SSIZE_T_CLEAN was introduced in Python 2.5 50 | */ 51 | #define PY_SSIZE_T_CLEAN 52 | 53 | #include 54 | 55 | /* Python compatibility macros 56 | */ 57 | #if !defined( PyMODINIT_FUNC ) 58 | #if PY_MAJOR_VERSION >= 3 59 | #define PyMODINIT_FUNC PyObject * 60 | #else 61 | #define PyMODINIT_FUNC void 62 | #endif 63 | #endif /* !defined( PyMODINIT_FUNC ) */ 64 | 65 | #if !defined( PyVarObject_HEAD_INIT ) 66 | #define PyVarObject_HEAD_INIT( type, size ) \ 67 | PyObject_HEAD_INIT( type ) \ 68 | size, 69 | 70 | #endif /* !defined( PyVarObject_HEAD_INIT ) */ 71 | 72 | #if PY_MAJOR_VERSION >= 3 73 | #define Py_TPFLAGS_HAVE_ITER 0 74 | #endif 75 | 76 | #if !defined( Py_TYPE ) 77 | #define Py_TYPE( object ) \ 78 | ( ( (PyObject *) object )->ob_type ) 79 | 80 | #endif /* !defined( Py_TYPE ) */ 81 | 82 | #endif /* !defined( _PYFSHFS_PYTHON_H ) */ 83 | 84 | -------------------------------------------------------------------------------- /pyfshfs/pyfshfs_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2009-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( _PYFSHFS_UNUSED_H ) 23 | #define _PYFSHFS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( PYFSHFS_ATTRIBUTE_UNUSED ) 28 | #if defined( __GNUC__ ) && __GNUC__ >= 3 29 | #define PYFSHFS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 30 | #else 31 | #define PYFSHFS_ATTRIBUTE_UNUSED 32 | #endif 33 | #endif 34 | 35 | #if defined( _MSC_VER ) 36 | #define PYFSHFS_UNREFERENCED_PARAMETER( parameter ) \ 37 | UNREFERENCED_PARAMETER( parameter ); 38 | #else 39 | #define PYFSHFS_UNREFERENCED_PARAMETER( parameter ) \ 40 | /* parameter */ 41 | #endif 42 | 43 | #endif /* !defined( _PYFSHFS_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 = libfshfs-python 3 | version = @VERSION@ 4 | description = Python bindings module for libfshfs 5 | long_description = Python bindings module for libfshfs 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 = "hfsplus.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="hfsplus.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_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/tests/data/btree_header.1 -------------------------------------------------------------------------------- /tests/data/btree_node_descriptor.1: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/data/catalog_btree_key.1: -------------------------------------------------------------------------------- 1 | osx -------------------------------------------------------------------------------- /tests/data/directory_record.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/tests/data/directory_record.1 -------------------------------------------------------------------------------- /tests/data/file_record.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/tests/data/file_record.1 -------------------------------------------------------------------------------- /tests/data/master_directory_block.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/tests/data/master_directory_block.1 -------------------------------------------------------------------------------- /tests/data/thread_record.1: -------------------------------------------------------------------------------- 1 | live.0.indexHead -------------------------------------------------------------------------------- /tests/data/volume_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfshfs/1b26cec37ee05ce32707f69f4cececc753596c11/tests/data/volume_header.1 -------------------------------------------------------------------------------- /tests/fshfs_test_functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Functions for testing 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_FUNCTIONS_H ) 23 | #define _FSHFS_TEST_FUNCTIONS_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fshfs_test_libbfio.h" 29 | #include "fshfs_test_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fshfs_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 fshfs_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 fshfs_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 fshfs_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 fshfs_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( _FSHFS_TEST_FUNCTIONS_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /tests/fshfs_test_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_GETOPT_H ) 23 | #define _FSHFS_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 fshfs_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 fshfs_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( _FSHFS_TEST_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /tests/fshfs_test_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBBFIO_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /tests/fshfs_test_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBCERROR_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fshfs_test_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBCLOCALE_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fshfs_test_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBCNOTIFY_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fshfs_test_libcpath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcpath header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBCPATH_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBCPATH_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /tests/fshfs_test_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBFDATA_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /tests/fshfs_test_libfshfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfshfs header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBFSHFS_H ) 23 | #define _FSHFS_TEST_LIBFSHFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSHFS_TEST_LIBFSHFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /tests/fshfs_test_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_LIBUNA_H ) 23 | #define _FSHFS_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( _FSHFS_TEST_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /tests/fshfs_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Memory allocation functions for testing 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_MEMORY_H ) 23 | #define _FSHFS_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( LIBFSHFS_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __loongarch__ ) && !defined( __mips__ ) && !defined( __riscv ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) 32 | #define HAVE_FSHFS_TEST_MEMORY 1 33 | #endif 34 | 35 | #if defined( HAVE_FSHFS_TEST_MEMORY ) 36 | 37 | extern int fshfs_test_malloc_attempts_before_fail; 38 | 39 | extern int fshfs_test_memcpy_attempts_before_fail; 40 | 41 | extern int fshfs_test_memset_attempts_before_fail; 42 | 43 | extern int fshfs_test_realloc_attempts_before_fail; 44 | 45 | #endif /* defined( HAVE_FSHFS_TEST_MEMORY ) */ 46 | 47 | #if defined( __cplusplus ) 48 | } 49 | #endif 50 | 51 | #endif /* !defined( _FSHFS_TEST_MEMORY_H ) */ 52 | 53 | -------------------------------------------------------------------------------- /tests/fshfs_test_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The type definitions 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_TYPES_H ) 23 | #define _FSHFS_TEST_TYPES_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fshfs_test_libuna.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct fshfs_test_unicode_case_folding_mapping fshfs_test_unicode_case_folding_mapping_t; 35 | 36 | struct fshfs_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 fshfs_test_unicode_decomposition_mapping fshfs_test_unicode_decomposition_mapping_t; 48 | 49 | struct fshfs_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( _FSHFS_TEST_TYPES_H ) */ 69 | 70 | -------------------------------------------------------------------------------- /tests/fshfs_test_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2009-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( _FSHFS_TEST_UNUSED_H ) 23 | #define _FSHFS_TEST_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSHFS_TEST_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSHFS_TEST_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSHFS_TEST_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSHFS_TEST_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSHFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSHFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSHFS_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/libfshfs 10 | cp AUTHORS COPYING COPYING.LESSER NEWS README ${PWD}/osx-pkg/usr/share/doc/libfshfs 11 | 12 | VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` 13 | pkgbuild --root osx-pkg --identifier com.github.libyal.libfshfs --version ${VERSION} --ownership recommended ../libfshfs-${VERSION}.pkg 14 | 15 | -------------------------------------------------------------------------------- /tests/runtests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Script to run Python test scripts. 4 | # 5 | # Version: 20231024 6 | 7 | import glob 8 | import os 9 | import sys 10 | import unittest 11 | 12 | 13 | test_profile = ".pyfshfs" 14 | input_glob = "*" 15 | option_sets = ["offset"] 16 | 17 | 18 | def ReadIgnoreList(test_profile): 19 | """Reads the test profile ignore file if it exists. 20 | 21 | Args: 22 | test_profile (str): test profile. 23 | 24 | Returns: 25 | set[str]: ignore list. 26 | """ 27 | ignore_file_path = os.path.join("tests", "input", test_profile, "ignore") 28 | if os.path.isfile(ignore_file_path): 29 | with open(ignore_file_path, "r", encoding="utf-8") as file_object: 30 | return set([line.strip() for line in file_object.readlines()]) 31 | 32 | return set() 33 | 34 | 35 | if __name__ == "__main__": 36 | print(f"Using Python version {sys.version!s}") 37 | 38 | test_loader = unittest.TestLoader() 39 | test_runner = unittest.TextTestRunner(verbosity=2) 40 | 41 | test_scripts = test_loader.discover("tests", pattern="*.py") 42 | 43 | ignore_list = ReadIgnoreList(test_profile) 44 | 45 | test_set = None 46 | source_file = None 47 | 48 | for test_set in glob.glob(os.path.join("tests", "input", "*")): 49 | test_set = test_set.rsplit(os.path.sep, maxsplit=1)[-1] 50 | if not test_set or test_set[0] == '.' or test_set in ignore_list: 51 | continue 52 | 53 | source_files = glob.glob(os.path.join( 54 | "tests", "input", test_set, input_glob)) 55 | if source_files: 56 | source_file = source_files[0] 57 | break 58 | 59 | setattr(unittest, "source", source_file) 60 | 61 | if source_file: 62 | for option_set in option_sets: 63 | test_file = os.path.basename(source_file) 64 | test_options_file_path = os.path.join( 65 | "tests", "input", test_profile, test_set, 66 | f"{test_file:s}.{option_set:s}") 67 | if os.path.isfile(test_options_file_path): 68 | with open(test_options_file_path, "r", encoding="utf-8") as file_object: 69 | lines = [line.strip() for line in file_object.readlines()] 70 | if lines[0] == "# libyal test data options": 71 | for line in lines[1:]: 72 | key, value = line.split("=", maxsplit=1) 73 | if key == 'offset': 74 | value = int(value) 75 | 76 | setattr(unittest, key, value) 77 | 78 | test_results = test_runner.run(test_scripts) 79 | if not test_results.wasSuccessful(): 80 | sys.exit(1) 81 | -------------------------------------------------------------------------------- /tests/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script to run tests 3 | # 4 | # Version: 20201121 5 | 6 | if test -f ${PWD}/libfshfs/.libs/libfshfs.1.dylib && test -f ./pyfshfs/.libs/pyfshfs.so; 7 | then 8 | install_name_tool -change /usr/local/lib/libfshfs.1.dylib ${PWD}/libfshfs/.libs/libfshfs.1.dylib ./pyfshfs/.libs/pyfshfs.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"; 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 libfshfs-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 | --------------------------------------------------------------------------------