├── .codecov.yml ├── .github └── workflows │ ├── build.yml │ ├── build_freebsd.yml │ ├── build_ossfuzz.yml │ └── build_shared.yml ├── .gitignore ├── AUTHORS ├── COPYING ├── COPYING.LESSER ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── acinclude.m4 ├── appveyor.yml ├── autogen.ps1 ├── autogen.sh ├── build.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 └── Resilient File System (ReFS).asciidoc ├── dpkg ├── changelog.in ├── compat ├── control ├── copyright ├── libfsrefs-dev.install ├── libfsrefs-tools.install ├── libfsrefs.install ├── rules └── source │ └── format ├── fsrefstools ├── Makefile.am ├── fsrefsinfo.c ├── fsrefstools_getopt.c ├── fsrefstools_getopt.h ├── fsrefstools_i18n.h ├── fsrefstools_libbfio.h ├── fsrefstools_libcerror.h ├── fsrefstools_libclocale.h ├── fsrefstools_libcnotify.h ├── fsrefstools_libfcache.h ├── fsrefstools_libfdata.h ├── fsrefstools_libfdatetime.h ├── fsrefstools_libfguid.h ├── fsrefstools_libfsrefs.h ├── fsrefstools_libfwnt.h ├── fsrefstools_libuna.h ├── fsrefstools_output.c ├── fsrefstools_output.h ├── fsrefstools_signal.c ├── fsrefstools_signal.h ├── fsrefstools_unused.h ├── info_handle.c └── info_handle.h ├── include ├── Makefile.am ├── libfsrefs.h.in └── libfsrefs │ ├── codepage.h │ ├── definitions.h.in │ ├── error.h │ ├── extern.h │ ├── features.h.in │ └── types.h.in ├── libfsrefs.ini ├── libfsrefs.pc.in ├── libfsrefs.spec.in ├── libfsrefs ├── Makefile.am ├── fsrefs_checkpoint.h ├── fsrefs_directory_object.h ├── fsrefs_metadata_block.h ├── fsrefs_ministore_tree.h ├── fsrefs_superblock.h ├── fsrefs_volume_header.h ├── libfsrefs.c ├── libfsrefs.rc.in ├── libfsrefs_attribute_values.c ├── libfsrefs_attribute_values.h ├── libfsrefs_block_descriptor.c ├── libfsrefs_block_descriptor.h ├── libfsrefs_block_reference.c ├── libfsrefs_block_reference.h ├── libfsrefs_block_tree.c ├── libfsrefs_block_tree.h ├── libfsrefs_block_tree_node.c ├── libfsrefs_block_tree_node.h ├── libfsrefs_checkpoint.c ├── libfsrefs_checkpoint.h ├── libfsrefs_data_run.c ├── libfsrefs_data_run.h ├── libfsrefs_debug.c ├── libfsrefs_debug.h ├── libfsrefs_definitions.h.in ├── libfsrefs_directory_entry.c ├── libfsrefs_directory_entry.h ├── libfsrefs_directory_object.c ├── libfsrefs_directory_object.h ├── libfsrefs_error.c ├── libfsrefs_error.h ├── libfsrefs_extern.h ├── libfsrefs_file_entry.c ├── libfsrefs_file_entry.h ├── libfsrefs_file_system.c ├── libfsrefs_file_system.h ├── libfsrefs_io_handle.c ├── libfsrefs_io_handle.h ├── libfsrefs_libbfio.h ├── libfsrefs_libcdata.h ├── libfsrefs_libcerror.h ├── libfsrefs_libclocale.h ├── libfsrefs_libcnotify.h ├── libfsrefs_libcthreads.h ├── libfsrefs_libfcache.h ├── libfsrefs_libfdata.h ├── libfsrefs_libfdatetime.h ├── libfsrefs_libfguid.h ├── libfsrefs_libfwnt.h ├── libfsrefs_libuna.h ├── libfsrefs_metadata_block_header.c ├── libfsrefs_metadata_block_header.h ├── libfsrefs_ministore_node.c ├── libfsrefs_ministore_node.h ├── libfsrefs_node_header.c ├── libfsrefs_node_header.h ├── libfsrefs_node_record.c ├── libfsrefs_node_record.h ├── libfsrefs_notify.c ├── libfsrefs_notify.h ├── libfsrefs_objects_tree.c ├── libfsrefs_objects_tree.h ├── libfsrefs_superblock.c ├── libfsrefs_superblock.h ├── libfsrefs_support.c ├── libfsrefs_support.h ├── libfsrefs_tree_header.c ├── libfsrefs_tree_header.h ├── libfsrefs_types.h ├── libfsrefs_unused.h ├── libfsrefs_volume.c ├── libfsrefs_volume.h ├── libfsrefs_volume_header.c └── libfsrefs_volume_header.h ├── m4 ├── common.m4 ├── libbfio.m4 ├── libcdata.m4 ├── libcerror.m4 ├── libcfile.m4 ├── libclocale.m4 ├── libcnotify.m4 ├── libcpath.m4 ├── libcsplit.m4 ├── libcthreads.m4 ├── libfcache.m4 ├── libfdata.m4 ├── libfdatetime.m4 ├── libfguid.m4 ├── libfusn.m4 ├── libfwnt.m4 ├── libuna.m4 ├── pthread.m4 ├── tests.m4 └── types.m4 ├── manuals ├── Makefile.am ├── fsrefsinfo.1 └── libfsrefs.3 ├── msvscpp ├── Makefile.am ├── fsrefs_test_attribute_values │ └── fsrefs_test_attribute_values.vcproj ├── fsrefs_test_block_descriptor │ └── fsrefs_test_block_descriptor.vcproj ├── fsrefs_test_block_reference │ └── fsrefs_test_block_reference.vcproj ├── fsrefs_test_block_tree │ └── fsrefs_test_block_tree.vcproj ├── fsrefs_test_block_tree_node │ └── fsrefs_test_block_tree_node.vcproj ├── fsrefs_test_checkpoint │ └── fsrefs_test_checkpoint.vcproj ├── fsrefs_test_data_run │ └── fsrefs_test_data_run.vcproj ├── fsrefs_test_directory_entry │ └── fsrefs_test_directory_entry.vcproj ├── fsrefs_test_directory_object │ └── fsrefs_test_directory_object.vcproj ├── fsrefs_test_error │ └── fsrefs_test_error.vcproj ├── fsrefs_test_file_entry │ └── fsrefs_test_file_entry.vcproj ├── fsrefs_test_file_system │ └── fsrefs_test_file_system.vcproj ├── fsrefs_test_io_handle │ └── fsrefs_test_io_handle.vcproj ├── fsrefs_test_metadata_block_header │ └── fsrefs_test_metadata_block_header.vcproj ├── fsrefs_test_ministore_node │ └── fsrefs_test_ministore_node.vcproj ├── fsrefs_test_node_header │ └── fsrefs_test_node_header.vcproj ├── fsrefs_test_node_record │ └── fsrefs_test_node_record.vcproj ├── fsrefs_test_notify │ └── fsrefs_test_notify.vcproj ├── fsrefs_test_objects_tree │ └── fsrefs_test_objects_tree.vcproj ├── fsrefs_test_superblock │ └── fsrefs_test_superblock.vcproj ├── fsrefs_test_support │ └── fsrefs_test_support.vcproj ├── fsrefs_test_tools_info_handle │ └── fsrefs_test_tools_info_handle.vcproj ├── fsrefs_test_tools_output │ └── fsrefs_test_tools_output.vcproj ├── fsrefs_test_tools_signal │ └── fsrefs_test_tools_signal.vcproj ├── fsrefs_test_tree_header │ └── fsrefs_test_tree_header.vcproj ├── fsrefs_test_volume │ └── fsrefs_test_volume.vcproj ├── fsrefs_test_volume_header │ └── fsrefs_test_volume_header.vcproj ├── fsrefsinfo │ └── fsrefsinfo.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 ├── libfsrefs.sln ├── libfsrefs │ └── libfsrefs.vcproj ├── libfusn │ └── libfusn.vcproj ├── libfwnt │ └── libfwnt.vcproj └── libuna │ └── libuna.vcproj ├── ossfuzz ├── Makefile.am ├── ossfuzz_libbfio.h ├── ossfuzz_libfsrefs.h └── volume_fuzzer.cc ├── po ├── ChangeLog ├── Makevars.in └── POTFILES.in ├── runtests.ps1 ├── runtests.sh ├── synclibs.ps1 ├── synclibs.sh └── tests ├── Makefile.am ├── build.sh ├── data ├── block_descriptor.1 ├── block_descriptor.2 ├── checkpoint.1 ├── checkpoint.2 ├── data_run.1 ├── node_header.1 ├── node_record.1 ├── superblock.1 ├── superblock.2 ├── tree_header.1 └── volume_header.1 ├── fsrefs_test_attribute_values.c ├── fsrefs_test_block_descriptor.c ├── fsrefs_test_block_reference.c ├── fsrefs_test_block_tree.c ├── fsrefs_test_block_tree_node.c ├── fsrefs_test_checkpoint.c ├── fsrefs_test_data_run.c ├── fsrefs_test_directory_entry.c ├── fsrefs_test_directory_object.c ├── fsrefs_test_error.c ├── fsrefs_test_file_entry.c ├── fsrefs_test_file_system.c ├── fsrefs_test_functions.c ├── fsrefs_test_functions.h ├── fsrefs_test_getopt.c ├── fsrefs_test_getopt.h ├── fsrefs_test_io_handle.c ├── fsrefs_test_libbfio.h ├── fsrefs_test_libcerror.h ├── fsrefs_test_libclocale.h ├── fsrefs_test_libcnotify.h ├── fsrefs_test_libfsrefs.h ├── fsrefs_test_libuna.h ├── fsrefs_test_macros.h ├── fsrefs_test_memory.c ├── fsrefs_test_memory.h ├── fsrefs_test_metadata_block_header.c ├── fsrefs_test_ministore_node.c ├── fsrefs_test_ministore_tree.c ├── fsrefs_test_node_header.c ├── fsrefs_test_node_record.c ├── fsrefs_test_notify.c ├── fsrefs_test_objects_tree.c ├── fsrefs_test_superblock.c ├── fsrefs_test_support.c ├── fsrefs_test_tools_info_handle.c ├── fsrefs_test_tools_output.c ├── fsrefs_test_tools_signal.c ├── fsrefs_test_tree_header.c ├── fsrefs_test_unused.h ├── fsrefs_test_volume.c ├── fsrefs_test_volume_header.c ├── lsan.suppressions ├── pkgbuild.sh ├── runtests.sh ├── syncsharedlibs.sh ├── test_fsrefsinfo.ps1 ├── test_fsrefsinfo.sh ├── test_library.ps1 ├── test_library.sh ├── test_manpage.sh ├── test_runner.sh ├── test_tools.ps1 └── test_tools.sh /.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 | - "libfusn/*" 24 | - "libfwnt/*" 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 gettext git libtool 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/libfsrefs 28 | cp projects/libyal/build.sh projects/libfsrefs/ 29 | cp projects/libyal/project.yaml projects/libfsrefs/ 30 | head -n 20 projects/libyal/Dockerfile > projects/libfsrefs/Dockerfile 31 | echo "RUN git clone --depth 1 https://github.com/libyal/libfsrefs.git libfsrefs" >> projects/libfsrefs/Dockerfile 32 | tail -n 3 projects/libyal/Dockerfile >> projects/libfsrefs/Dockerfile 33 | python3 infra/helper.py build_image --pull libfsrefs 34 | python3 infra/helper.py build_fuzzers --sanitizer address libfsrefs 35 | python3 infra/helper.py check_build libfsrefs 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 libtool pkg-config 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 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Acknowledgements: libfsrefs 2 | 3 | Copyright (C) 2012-2024, Joachim Metz 4 | 5 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | TODO 2 | 3 | Format support 4 | * Use checkpoint in determining block offsets 5 | * Rename metadata block header to block header ? 6 | * Rename metadata block size to page size ? 7 | * Use directory object name records in determining directory entries and lookup detailed entry record on demand 8 | * Add support for multi node file values ministore tree 9 | 10 | API 11 | * add function to retrieve container size 12 | 13 | 20141011 14 | * see `git log' for more recent change log 15 | * removed README.macosx 16 | * updated dependencies 17 | * changes for project site move 18 | 19 | 20140529 20 | * updated dependencies 21 | 22 | 20140118 23 | * 2014 update 24 | * updated dependencies 25 | 26 | 20131109 27 | * updated dependencies 28 | * code clean up 29 | 30 | 20130915 31 | * code clean up 32 | 33 | 20130914 34 | * updated dependencies 35 | * added libcthreads build support 36 | 37 | 20130224 38 | * updated dependencies 39 | * 2013 update 40 | 41 | 20120930 42 | * worked on format 43 | 44 | 20120929 45 | * updated dependencies 46 | * worked on format 47 | 48 | 20120528 49 | * worked on format 50 | 51 | 20120527 52 | * initial version based on libfsntfs 53 | 54 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | SUBDIRS = \ 4 | include \ 5 | common \ 6 | libcerror \ 7 | libcthreads \ 8 | libcdata \ 9 | libclocale \ 10 | libcnotify \ 11 | libcsplit \ 12 | libuna \ 13 | libcfile \ 14 | libcpath \ 15 | libbfio \ 16 | libfcache \ 17 | libfdata \ 18 | libfdatetime \ 19 | libfguid \ 20 | libfwnt \ 21 | libfsrefs \ 22 | libfusn \ 23 | fsrefstools \ 24 | po \ 25 | manuals \ 26 | tests \ 27 | ossfuzz \ 28 | msvscpp 29 | 30 | DPKG_FILES = \ 31 | dpkg/changelog \ 32 | dpkg/changelog.in \ 33 | dpkg/compat \ 34 | dpkg/control \ 35 | dpkg/copyright \ 36 | dpkg/rules \ 37 | dpkg/libfsrefs-dev.install \ 38 | dpkg/libfsrefs.install \ 39 | dpkg/libfsrefs-tools.install \ 40 | dpkg/source/format 41 | 42 | GETTEXT_FILES = \ 43 | config.rpath \ 44 | po/Makevars.in 45 | 46 | PKGCONFIG_FILES = \ 47 | libfsrefs.pc.in 48 | 49 | SPEC_FILES = \ 50 | libfsrefs.spec \ 51 | libfsrefs.spec.in 52 | 53 | EXTRA_DIST = \ 54 | $(DPKG_FILES) \ 55 | $(GETTEXT_FILES) \ 56 | $(PKGCONFIG_FILES) \ 57 | $(SPEC_FILES) 58 | 59 | DISTCLEANFILES = \ 60 | config.status \ 61 | config.cache \ 62 | config.log \ 63 | libfsrefs.pc \ 64 | libfsrefs.spec \ 65 | Makefile \ 66 | Makefile.in \ 67 | po/Makevars 68 | 69 | pkgconfigdir = $(libdir)/pkgconfig 70 | 71 | pkgconfig_DATA = \ 72 | libfsrefs.pc 73 | 74 | libtool: @LIBTOOL_DEPS@ 75 | cd $(srcdir) && $(SHELL) ./config.status --recheck 76 | 77 | lib: library 78 | 79 | library: 80 | (cd $(srcdir)/common && $(MAKE) $(AM_MAKEFLAGS)) 81 | (cd $(srcdir)/libcerror && $(MAKE) $(AM_MAKEFLAGS)) 82 | (cd $(srcdir)/libcthreads && $(MAKE) $(AM_MAKEFLAGS)) 83 | (cd $(srcdir)/libcdata && $(MAKE) $(AM_MAKEFLAGS)) 84 | (cd $(srcdir)/libclocale && $(MAKE) $(AM_MAKEFLAGS)) 85 | (cd $(srcdir)/libcnotify && $(MAKE) $(AM_MAKEFLAGS)) 86 | (cd $(srcdir)/libcsplit && $(MAKE) $(AM_MAKEFLAGS)) 87 | (cd $(srcdir)/libuna && $(MAKE) $(AM_MAKEFLAGS)) 88 | (cd $(srcdir)/libcfile && $(MAKE) $(AM_MAKEFLAGS)) 89 | (cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS)) 90 | (cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS)) 91 | (cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS)) 92 | (cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS)) 93 | (cd $(srcdir)/libfdatetime && $(MAKE) $(AM_MAKEFLAGS)) 94 | (cd $(srcdir)/libfguid && $(MAKE) $(AM_MAKEFLAGS)) 95 | (cd $(srcdir)/libfwnt && $(MAKE) $(AM_MAKEFLAGS)) 96 | (cd $(srcdir)/libfsrefs && $(MAKE) $(AM_MAKEFLAGS)) 97 | (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) 98 | 99 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | libfsrefs is a library to access the Resilient File System (ReFS). 2 | 3 | Note that this project currently only focuses on the analysis of the format. 4 | 5 | Project information: 6 | 7 | * Status: experimental 8 | * Licence: LGPLv3+ 9 | 10 | Read-only supported ReFS formats: 11 | 12 | * version 1 13 | 14 | Unsupported ReFS format features: 15 | 16 | * ReFS version 2 17 | * ReFS version 3 18 | 19 | Planned: 20 | 21 | * Finish library 22 | 23 | For more information see: 24 | 25 | * Project documentation: https://github.com/libyal/libfsrefs/wiki/Home 26 | * How to build from source: https://github.com/libyal/libfsrefs/wiki/Building 27 | 28 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl Checks for required headers and functions 2 | dnl 3 | dnl Version: 20200713 4 | 5 | dnl Function to detect if libfsrefs dependencies are available 6 | AC_DEFUN([AX_LIBFSREFS_CHECK_LOCAL], 7 | [dnl Check for internationalization functions in libfsrefs/libfsrefs_i18n.c 8 | AC_CHECK_FUNCS([bindtextdomain]) 9 | ]) 10 | 11 | dnl Function to detect if fsrefstools dependencies are available 12 | AC_DEFUN([AX_FSREFSTOOLS_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 | 25 | dnl Function to check if DLL support is needed 26 | AC_DEFUN([AX_LIBFSREFS_CHECK_DLL_SUPPORT], 27 | [AS_IF( 28 | [test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno], 29 | [AS_CASE( 30 | [$host], 31 | [*cygwin* | *mingw* | *msys*], 32 | [AC_DEFINE( 33 | [HAVE_DLLMAIN], 34 | [1], 35 | [Define to 1 to enable the DllMain function.]) 36 | AC_SUBST( 37 | [HAVE_DLLMAIN], 38 | [1]) 39 | 40 | AC_SUBST( 41 | [LIBFSREFS_DLL_EXPORT], 42 | ["-DLIBFSREFS_DLL_EXPORT"]) 43 | 44 | AC_SUBST( 45 | [LIBFSREFS_DLL_IMPORT], 46 | ["-DLIBFSREFS_DLL_IMPORT"]) 47 | ]) 48 | ]) 49 | ]) 50 | 51 | -------------------------------------------------------------------------------- /autogen.ps1: -------------------------------------------------------------------------------- 1 | # Script to generate the necessary files for a msvscpp build 2 | # 3 | # Version: 20240306 4 | 5 | $WinFlex = "..\win_flex_bison\win_flex.exe" 6 | $WinBison = "..\win_flex_bison\win_bison.exe" 7 | 8 | $Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" } 9 | $Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" } 10 | $Prefix = ${Library}.Substring(3) 11 | 12 | Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h" 13 | Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "include\${Library}\definitions.h" 14 | Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\features.h" 15 | Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\types.h" 16 | Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } | Out-File -Encoding ascii "common\types.h" 17 | Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}_definitions.h" 18 | Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}.rc" 19 | 20 | If (Test-Path "setup.cfg.in") 21 | { 22 | Get-Content -Path "setup.cfg.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "setup.cfg" 23 | } 24 | 25 | If (Test-Path "${Prefix}.net") 26 | { 27 | Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Prefix}.net\${Prefix}.net.rc" 28 | } 29 | 30 | $NamePrefix = "" 31 | 32 | ForEach (${Library} in Get-ChildItem -Directory -Path "lib*") 33 | { 34 | ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l") 35 | { 36 | $OutputFile = ${DirectoryElement} -Replace ".l$",".c" 37 | 38 | $NamePrefix = Split-Path -path ${DirectoryElement} -leaf 39 | $NamePrefix = ${NamePrefix} -Replace ".l$","_" 40 | 41 | Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}" 42 | 43 | # PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr 44 | # therefore 2>&1 is added and the output is stored in a variable. 45 | $Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1" 46 | Write-Host ${Output} 47 | 48 | # Moving manually since `win_flex -o filename' does not provide the expected behavior. 49 | Move-Item "lex.yy.c" ${OutputFile} -force 50 | } 51 | 52 | ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y") 53 | { 54 | $OutputFile = ${DirectoryElement} -Replace ".y$",".c" 55 | 56 | Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}" 57 | 58 | # PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr 59 | # therefore 2>&1 is added and the output is stored in a variable. 60 | $Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1" 61 | Write-Host ${Output} 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /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) 2012-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) 2012-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) 2012-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 | -------------------------------------------------------------------------------- /common/config_winapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Configuration file for WINAPI 3 | * 4 | * Copyright (C) 2012-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_WINAPI_H ) 23 | #define _CONFIG_WINAPI_H 24 | 25 | /* Define the earliest supported WINAPI version 26 | #define WINVER 0x0501 27 | */ 28 | 29 | /* If necessary make sure WINAPI is defined 30 | */ 31 | #if defined( HAVE_WINDOWS_H ) || defined( __BORLANDC__ ) || defined( _MSC_VER ) 32 | #include 33 | #endif 34 | 35 | #if defined( WINAPI ) 36 | 37 | /* Define to the address where bug reports for this package should be sent. 38 | */ 39 | #define PACKAGE_BUGREPORT "joachim.metz@gmail.com" 40 | 41 | /* Define the size of the integer for WINAPI 42 | */ 43 | #if !defined( SIZEOF_INT ) 44 | #define SIZEOF_INT 4 45 | #endif 46 | 47 | /* Define the size of size_t for WINAPI 48 | * Do not define when pyconfig.h has been included via python.h 49 | */ 50 | #if !defined( HAVE_PYCONFIG_H ) 51 | 52 | #if !defined( SIZEOF_SIZE_T ) 53 | #if __WORDSIZE == 64 54 | #define SIZEOF_SIZE_T 8 55 | #else 56 | #define SIZEOF_SIZE_T 4 57 | #endif 58 | #endif 59 | 60 | #endif /* !defined( HAVE_PYCONFIG_H ) */ 61 | 62 | /* Define the size of the wide character for WINAPI 63 | */ 64 | #if !defined( SIZEOF_WCHAR_T ) 65 | #define SIZEOF_WCHAR_T 2 66 | #endif 67 | 68 | /* Enable the DllMain function 69 | */ 70 | #define HAVE_DLLMAIN 1 71 | 72 | /* Enable verbose output 73 | #define HAVE_VERBOSE_OUTPUT 1 74 | */ 75 | 76 | /* Enable debug output 77 | #define HAVE_DEBUG_OUTPUT 1 78 | */ 79 | 80 | /* Enable both the narrow and wide character functions 81 | */ 82 | #if !defined( HAVE_WIDE_CHARACTER_TYPE ) 83 | #define HAVE_WIDE_CHARACTER_TYPE 1 84 | #endif 85 | 86 | /* If not controlled by config.h enable multi-thread support 87 | */ 88 | #if !defined( HAVE_CONFIG_H ) && !defined( HAVE_MULTI_THREAD_SUPPORT ) 89 | #define HAVE_MULTI_THREAD_SUPPORT 1 90 | #endif 91 | 92 | #endif /* defined( WINAPI ) */ 93 | 94 | #endif /* !defined( _CONFIG_WINAPI_H ) */ 95 | 96 | -------------------------------------------------------------------------------- /dpkg/changelog.in: -------------------------------------------------------------------------------- 1 | libfsrefs (@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: libfsrefs 2 | Priority: extra 3 | Maintainer: Joachim Metz 4 | Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config 5 | Standards-Version: 4.1.4 6 | Section: libs 7 | Homepage: https://github.com/libyal/libfsrefs 8 | Vcs-Git: https://github.com/libyal/libfsrefs.git 9 | 10 | Package: libfsrefs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${misc:Depends} 13 | Conflicts: libfsrefs1 14 | Replaces: libfsrefs1 15 | Suggests: libfsrefs-dbg 16 | Description: Library to access the Resiliant File System (ReFS) format 17 | libfsrefs is a library to access the Resiliant File System (ReFS) format. 18 | 19 | Package: libfsrefs-dbg 20 | Architecture: any 21 | Section: debug 22 | Depends: libfsrefs (= ${binary:Version}), ${misc:Depends} 23 | Description: Debugging symbols for libfsrefs 24 | Debugging symbols for libfsrefs. 25 | 26 | Package: libfsrefs-dev 27 | Section: libdevel 28 | Architecture: any 29 | Depends: libfsrefs (= ${binary:Version}), ${misc:Depends} 30 | Description: Header files and libraries for developing applications for libfsrefs 31 | Header files and libraries for developing applications for libfsrefs. 32 | 33 | Package: libfsrefs-tools 34 | Section: utils 35 | Architecture: any 36 | Depends: libfsrefs (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} 37 | Conflicts: libfsrefs-utils 38 | Replaces: libfsrefs-utils 39 | Description: Several tools for reading Resiliant File System (ReFS) volumes 40 | Several tools for reading Resiliant File System (ReFS) volumes. 41 | 42 | Package: libfsrefs-tools-dbg 43 | Section: debug 44 | Architecture: any 45 | Depends: libfsrefs-tools (= ${binary:Version}), ${misc:Depends} 46 | Description: Debugging symbols for libfsrefs-tools 47 | Debugging symbols for libfsrefs-tools. 48 | 49 | -------------------------------------------------------------------------------- /dpkg/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: libfsrefs 3 | Source: https://github.com/libyal/libfsrefs 4 | 5 | Files: * 6 | Copyright: 2012-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/libfsrefs-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/libfsrefs-tools.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | -------------------------------------------------------------------------------- /dpkg/libfsrefs.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 | %: 8 | dh $@ --buildsystem=autoconf --with=autoreconf 9 | 10 | .PHONY: override_dh_auto_configure 11 | override_dh_auto_configure: 12 | dh_auto_configure -- CFLAGS="-g" 13 | 14 | .PHONY: override_dh_install 15 | override_dh_install: 16 | dh_install --fail-missing -X.la 17 | 18 | .PHONY: override_dh_strip 19 | override_dh_strip: 20 | ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) 21 | dh_strip -plibfsrefs --dbg-package=libfsrefs-dbg 22 | dh_strip -plibfsrefs-tools --dbg-package=libfsrefs-tools-dbg 23 | endif 24 | 25 | -------------------------------------------------------------------------------- /dpkg/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /fsrefstools/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I../include -I$(top_srcdir)/include \ 3 | -I../common -I$(top_srcdir)/common \ 4 | @LIBCERROR_CPPFLAGS@ \ 5 | @LIBCDATA_CPPFLAGS@ \ 6 | @LIBCLOCALE_CPPFLAGS@ \ 7 | @LIBCNOTIFY_CPPFLAGS@ \ 8 | @LIBCSPLIT_CPPFLAGS@ \ 9 | @LIBUNA_CPPFLAGS@ \ 10 | @LIBCFILE_CPPFLAGS@ \ 11 | @LIBCPATH_CPPFLAGS@ \ 12 | @LIBBFIO_CPPFLAGS@ \ 13 | @LIBFCACHE_CPPFLAGS@ \ 14 | @LIBFDATA_CPPFLAGS@ \ 15 | @LIBFDATETIME_CPPFLAGS@ \ 16 | @LIBFGUID_CPPFLAGS@ \ 17 | @LIBFWNT_CPPFLAGS@ \ 18 | @LIBFSREFS_DLL_IMPORT@ 19 | 20 | AM_LDFLAGS = @STATIC_LDFLAGS@ 21 | 22 | bin_PROGRAMS = \ 23 | fsrefsinfo 24 | 25 | fsrefsinfo_SOURCES = \ 26 | fsrefsinfo.c \ 27 | fsrefstools_getopt.c fsrefstools_getopt.h \ 28 | fsrefstools_i18n.h \ 29 | fsrefstools_libbfio.h \ 30 | fsrefstools_libcerror.h \ 31 | fsrefstools_libclocale.h \ 32 | fsrefstools_libcnotify.h \ 33 | fsrefstools_libfcache.h \ 34 | fsrefstools_libfdata.h \ 35 | fsrefstools_libfdatetime.h \ 36 | fsrefstools_libfguid.h \ 37 | fsrefstools_libfsrefs.h \ 38 | fsrefstools_libfwnt.h \ 39 | fsrefstools_libuna.h \ 40 | fsrefstools_output.c fsrefstools_output.h \ 41 | fsrefstools_signal.c fsrefstools_signal.h \ 42 | fsrefstools_unused.h \ 43 | info_handle.c info_handle.h 44 | 45 | fsrefsinfo_LDADD = \ 46 | @LIBBFIO_LIBADD@ \ 47 | @LIBCPATH_LIBADD@ \ 48 | @LIBCFILE_LIBADD@ \ 49 | @LIBUNA_LIBADD@ \ 50 | @LIBCSPLIT_LIBADD@ \ 51 | @LIBCNOTIFY_LIBADD@ \ 52 | @LIBCLOCALE_LIBADD@ \ 53 | @LIBCDATA_LIBADD@ \ 54 | ../libfsrefs/libfsrefs.la \ 55 | @LIBCERROR_LIBADD@ \ 56 | @LIBINTL@ 57 | 58 | DISTCLEANFILES = \ 59 | Makefile \ 60 | Makefile.in 61 | 62 | splint-local: 63 | @echo "Running splint on fsrefsinfo ..." 64 | -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(fsrefsinfo_SOURCES) 65 | 66 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_GETOPT_H ) 23 | #define _FSREFSTOOLS_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 fsrefstools_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 fsrefstools_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( _FSREFSTOOLS_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_i18n.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Internationalization (i18n) functions 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_I18N_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_I18N_H ) */ 48 | 49 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBBFIO_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBCERROR_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBCLOCALE_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBCNOTIFY_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfcache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfcache header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFCACHE_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBFCACHE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFDATA_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFDATETIME_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFGUID_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfsrefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsrefs header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFSREFS_H ) 23 | #define _FSREFSTOOLS_LIBFSREFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSREFSTOOLS_LIBFSREFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libfwnt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfwnt header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBFWNT_H ) 23 | #define _FSREFSTOOLS_LIBFWNT_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFWNT for local use of libfwnt 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFWNT ) 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 | 44 | #else 45 | 46 | /* If libtool DLL support is enabled set LIBFWNT_DLL_IMPORT 47 | * before including libfwnt.h 48 | */ 49 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) 50 | #define LIBFWNT_DLL_IMPORT 51 | #endif 52 | 53 | #include 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBFWNT ) */ 56 | 57 | #endif /* !defined( _FSREFSTOOLS_LIBFWNT_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_LIBUNA_H ) 23 | #define _FSREFSTOOLS_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( _FSREFSTOOLS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Common output functions for the fsrefstools 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_OUTPUT_H ) 23 | #define _FSREFSTOOLS_OUTPUT_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "fsrefstools_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fsrefstools_output_initialize( 36 | int stdio_mode, 37 | libcerror_error_t **error ); 38 | 39 | void fsrefstools_output_copyright_fprint( 40 | FILE *stream ); 41 | 42 | void fsrefstools_output_version_fprint( 43 | FILE *stream, 44 | const char *program ); 45 | 46 | void fsrefstools_output_version_detailed_fprint( 47 | FILE *stream, 48 | const char *program ); 49 | 50 | #if defined( __cplusplus ) 51 | } 52 | #endif 53 | 54 | #endif /* !defined( _FSREFSTOOLS_OUTPUT_H ) */ 55 | 56 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Signal handling functions 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_SIGNAL_H ) 23 | #define _FSREFSTOOLS_SIGNAL_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsrefstools_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 fsrefstools_signal_t; 40 | 41 | #else 42 | typedef int fsrefstools_signal_t; 43 | 44 | #endif /* defined( WINAPI ) */ 45 | 46 | #if defined( WINAPI ) 47 | 48 | BOOL WINAPI fsrefstools_signal_handler( 49 | fsrefstools_signal_t signal ); 50 | 51 | #if defined( _MSC_VER ) 52 | 53 | void fsrefstools_signal_initialize_memory_debug( 54 | void ); 55 | 56 | #endif /* defined( _MSC_VER ) */ 57 | 58 | #endif /* defined( WINAPI ) */ 59 | 60 | int fsrefstools_signal_attach( 61 | void (*signal_handler)( fsrefstools_signal_t ), 62 | libcerror_error_t **error ); 63 | 64 | int fsrefstools_signal_detach( 65 | libcerror_error_t **error ); 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _FSREFSTOOLS_SIGNAL_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /fsrefstools/fsrefstools_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2012-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( _FSREFSTOOLS_UNUSED_H ) 23 | #define _FSREFSTOOLS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSREFSTOOLS_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSREFSTOOLS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSREFSTOOLS_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSREFSTOOLS_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSREFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSREFSTOOLS_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSREFSTOOLS_UNUSED_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = \ 2 | libfsrefs.h 3 | 4 | pkginclude_HEADERS = \ 5 | libfsrefs/codepage.h \ 6 | libfsrefs/definitions.h \ 7 | libfsrefs/error.h \ 8 | libfsrefs/extern.h \ 9 | libfsrefs/features.h \ 10 | libfsrefs/types.h 11 | 12 | EXTRA_DIST = \ 13 | libfsrefs.h.in \ 14 | libfsrefs/definitions.h.in \ 15 | libfsrefs/features.h.in \ 16 | libfsrefs/types.h.in 17 | 18 | DISTCLEANFILES = \ 19 | libfsrefs.h \ 20 | libfsrefs/definitions.h \ 21 | libfsrefs/features.h \ 22 | libfsrefs/types.h \ 23 | Makefile \ 24 | Makefile.in 25 | 26 | -------------------------------------------------------------------------------- /include/libfsrefs/definitions.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions for libfsrefs 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_DEFINITIONS_H ) 23 | #define _LIBFSREFS_DEFINITIONS_H 24 | 25 | #include 26 | 27 | #define LIBFSREFS_VERSION @VERSION@ 28 | 29 | /* The version string 30 | */ 31 | #define LIBFSREFS_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 LIBFSREFS_ACCESS_FLAGS 39 | { 40 | LIBFSREFS_ACCESS_FLAG_READ = 0x01, 41 | /* Reserved: not supported yet */ 42 | LIBFSREFS_ACCESS_FLAG_WRITE = 0x02 43 | }; 44 | 45 | /* The file access macros 46 | */ 47 | #define LIBFSREFS_OPEN_READ ( LIBFSREFS_ACCESS_FLAG_READ ) 48 | /* Reserved: not supported yet */ 49 | #define LIBFSREFS_OPEN_WRITE ( LIBFSREFS_ACCESS_FLAG_WRITE ) 50 | /* Reserved: not supported yet */ 51 | #define LIBFSREFS_OPEN_READ_WRITE ( LIBFSREFS_ACCESS_FLAG_READ | LIBFSREFS_ACCESS_FLAG_WRITE ) 52 | 53 | /* The path segment separator 54 | */ 55 | #define LIBFSREFS_SEPARATOR '\\' 56 | 57 | /* The file attribute flags 58 | */ 59 | enum LIBFSREFS_FILE_ATTRIBUTE_FLAGS 60 | { 61 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_READ_ONLY = 0x00000001UL, 62 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_HIDDEN = 0x00000002UL, 63 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_SYSTEM = 0x00000004UL, 64 | 65 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_DIRECTORY = 0x00000010UL, 66 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_ARCHIVE = 0x00000020UL, 67 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_DEVICE = 0x00000040UL, 68 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_NORMAL = 0x00000080UL, 69 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_TEMPORARY = 0x00000100UL, 70 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_SPARSE_FILE = 0x00000200UL, 71 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_REPARSE_POINT = 0x00000400UL, 72 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_COMPRESSED = 0x00000800UL, 73 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_OFFLINE = 0x00001000UL, 74 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_NOT_CONTENT_INDEXED = 0x00002000UL, 75 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_ENCRYPTED = 0x00004000UL, 76 | 77 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_VIRTUAL = 0x00010000UL 78 | }; 79 | 80 | #endif /* !defined( _LIBFSREFS_DEFINITIONS_H ) */ 81 | 82 | -------------------------------------------------------------------------------- /include/libfsrefs/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) 2012-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( _LIBFSREFS_EXTERN_H ) 26 | #define _LIBFSREFS_EXTERN_H 27 | 28 | /* To export functions from the libfsrefs DLL define LIBFSREFS_DLL_EXPORT 29 | * To import functions from the libfsrefs DLL define LIBFSREFS_DLL_IMPORT 30 | * Otherwise use default extern statement 31 | */ 32 | #if defined( LIBFSREFS_DLL_EXPORT ) 33 | #define LIBFSREFS_EXTERN __declspec(dllexport) 34 | 35 | #elif defined( LIBFSREFS_DLL_IMPORT ) 36 | #define LIBFSREFS_EXTERN extern __declspec(dllimport) 37 | 38 | #else 39 | #define LIBFSREFS_EXTERN extern 40 | 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSREFS_EXTERN_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /include/libfsrefs/features.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Features of libfsrefs 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_FEATURES_H ) 23 | #define _LIBFSREFS_FEATURES_H 24 | 25 | /* The libfsrefs type support features 26 | */ 27 | #if defined( WINAPI ) || @HAVE_WIDE_CHARACTER_TYPE@ 28 | #define LIBFSREFS_HAVE_WIDE_CHARACTER_TYPE 1 29 | #endif 30 | 31 | #if defined( WINAPI ) || @HAVE_MULTI_THREAD_SUPPORT@ 32 | #define LIBFSREFS_HAVE_MULTI_THREAD_SUPPORT 1 33 | #endif 34 | 35 | #if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && @HAVE_LIBBFIO@ ) 36 | #define LIBFSREFS_HAVE_BFIO 1 37 | #endif 38 | 39 | #if !defined( LIBFSREFS_DEPRECATED ) 40 | #if defined( __GNUC__ ) && __GNUC__ >= 3 41 | #define LIBFSREFS_DEPRECATED __attribute__ ((__deprecated__)) 42 | #elif defined( _MSC_VER ) 43 | #define LIBFSREFS_DEPRECATED __declspec(deprecated) 44 | #else 45 | #define LIBFSREFS_DEPRECATED 46 | #endif 47 | #endif 48 | 49 | #endif /* !defined( _LIBFSREFS_FEATURES_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsrefs.ini: -------------------------------------------------------------------------------- 1 | [project] 2 | description: "libfsrefs is a library to access the Resilient File System (ReFS)." 3 | name: "libfsrefs" 4 | status: "experimental" 5 | year_of_creation: "2012" 6 | documentation_url: "https://github.com/libyal/libfsrefs/tree/main/documentation" 7 | features: ["debug_output", "ossfuzz", "tools"] 8 | 9 | [library] 10 | description: "Library to access the Resiliant File System (ReFS) format" 11 | features: ["pthread", "wide_character_type"] 12 | public_types: ["file_entry", "volume"] 13 | 14 | [tools] 15 | description: "Several tools for reading Resiliant File System (ReFS) volumes" 16 | names: ["fsrefsinfo"] 17 | 18 | [info_tool] 19 | source_description: "a Resiliant File System (ReFS) volume" 20 | source_type: "volume" 21 | 22 | [tests] 23 | profiles: ["libfsrefs", "fsrefsinfo"] 24 | option_sets: ["offset"] 25 | info_tool_option_sets: ["offset"] 26 | info_tool_options_per_profile: [""] 27 | info_tool_profiles: ["fsrefsinfo"] 28 | 29 | -------------------------------------------------------------------------------- /libfsrefs.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libfsrefs 7 | Description: Library to access the Resiliant File System (ReFS) format 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lfsrefs 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_libfwnt_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ 11 | Cflags: -I${includedir} 12 | 13 | -------------------------------------------------------------------------------- /libfsrefs.spec.in: -------------------------------------------------------------------------------- 1 | Name: libfsrefs 2 | Version: @VERSION@ 3 | Release: 1 4 | Summary: Library to access the Resiliant File System (ReFS) format 5 | Group: System Environment/Libraries 6 | License: LGPL-3.0-or-later 7 | Source: %{name}-%{version}.tar.gz 8 | URL: https://github.com/libyal/libfsrefs 9 | @libfsrefs_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfdata_spec_requires@ @ax_libfdatetime_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfwnt_spec_requires@ @ax_libuna_spec_requires@ 10 | BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfdatetime_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfwnt_spec_build_requires@ @ax_libuna_spec_build_requires@ 11 | 12 | %description -n libfsrefs 13 | Library to access the Resiliant File System (ReFS) format 14 | 15 | %package -n libfsrefs-static 16 | Summary: Library to access the Resiliant File System (ReFS) format 17 | Group: Development/Libraries 18 | Requires: libfsrefs = %{version}-%{release} 19 | 20 | %description -n libfsrefs-static 21 | Static library version of libfsrefs. 22 | 23 | %package -n libfsrefs-devel 24 | Summary: Header files and libraries for developing applications for libfsrefs 25 | Group: Development/Libraries 26 | Requires: libfsrefs = %{version}-%{release} 27 | 28 | %description -n libfsrefs-devel 29 | Header files and libraries for developing applications for libfsrefs. 30 | 31 | %package -n libfsrefs-tools 32 | Summary: Several tools for reading Resiliant File System (ReFS) volumes 33 | Group: Applications/System 34 | Requires: libfsrefs = %{version}-%{release} @ax_libfusn_spec_requires@ 35 | @libfsrefs_spec_tools_build_requires@ @ax_libfusn_spec_build_requires@ 36 | 37 | %description -n libfsrefs-tools 38 | Several tools for reading Resiliant File System (ReFS) volumes 39 | 40 | %prep 41 | %setup -q 42 | 43 | %build 44 | %configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} 45 | make %{?_smp_mflags} 46 | 47 | %install 48 | rm -rf %{buildroot} 49 | %make_install 50 | 51 | %clean 52 | rm -rf %{buildroot} 53 | 54 | %post -p /sbin/ldconfig 55 | 56 | %postun -p /sbin/ldconfig 57 | 58 | %files -n libfsrefs 59 | %license COPYING COPYING.LESSER 60 | %doc AUTHORS README 61 | %{_libdir}/*.so.* 62 | 63 | %files -n libfsrefs-static 64 | %license COPYING COPYING.LESSER 65 | %doc AUTHORS README 66 | %{_libdir}/*.a 67 | 68 | %files -n libfsrefs-devel 69 | %license COPYING COPYING.LESSER 70 | %doc AUTHORS README 71 | %{_libdir}/*.so 72 | %{_libdir}/pkgconfig/libfsrefs.pc 73 | %{_includedir}/* 74 | %{_mandir}/man3/* 75 | 76 | %files -n libfsrefs-tools 77 | %license COPYING COPYING.LESSER 78 | %doc AUTHORS README 79 | %{_bindir}/* 80 | %{_mandir}/man1/* 81 | 82 | %changelog 83 | * @SPEC_DATE@ Joachim Metz @VERSION@-1 84 | - Auto-generated 85 | 86 | -------------------------------------------------------------------------------- /libfsrefs/fsrefs_checkpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The ReFS checkpoint definition 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_CHECKPOINT_H ) 23 | #define _FSREFS_CHECKPOINT_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsrefs_checkpoint_header fsrefs_checkpoint_header_t; 33 | 34 | struct fsrefs_checkpoint_header 35 | { 36 | /* Unknown 37 | * Consists of 4 bytes 38 | */ 39 | uint8_t unknown1[ 4 ]; 40 | 41 | /* Major format version 42 | * Consists of 2 bytes 43 | */ 44 | uint8_t major_format_version[ 2 ]; 45 | 46 | /* Minor format version 47 | * Consists of 2 bytes 48 | */ 49 | uint8_t minor_format_version[ 2 ]; 50 | 51 | /* Self reference data offset 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t self_reference_data_offset[ 4 ]; 55 | 56 | /* Self reference data size 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t self_reference_data_size[ 4 ]; 60 | }; 61 | 62 | typedef struct fsrefs_checkpoint_trailer_v1 fsrefs_checkpoint_trailer_v1_t; 63 | 64 | struct fsrefs_checkpoint_trailer_v1 65 | { 66 | /* Unknown 67 | * Consists of 8 bytes 68 | */ 69 | uint8_t unknown2[ 8 ]; 70 | 71 | /* Unknown 72 | * Consists of 4 bytes 73 | */ 74 | uint8_t unknown3[ 4 ]; 75 | 76 | /* Unknown 77 | * Consists of 4 bytes 78 | */ 79 | uint8_t unknown4[ 4 ]; 80 | 81 | /* Unknown 82 | * Consists of 8 bytes 83 | */ 84 | uint8_t unknown5[ 8 ]; 85 | 86 | /* Number of offsets 87 | * Consists of 4 bytes 88 | */ 89 | uint8_t number_of_offsets[ 4 ]; 90 | }; 91 | 92 | typedef struct fsrefs_checkpoint_trailer_v3 fsrefs_checkpoint_trailer_v3_t; 93 | 94 | struct fsrefs_checkpoint_trailer_v3 95 | { 96 | /* Unknown 97 | * Consists of 8 bytes 98 | */ 99 | uint8_t unknown2[ 8 ]; 100 | 101 | /* Unknown 102 | * Consists of 8 bytes 103 | */ 104 | uint8_t unknown3[ 8 ]; 105 | 106 | /* Unknown 107 | * Consists of 4 bytes 108 | */ 109 | uint8_t unknown4[ 4 ]; 110 | 111 | /* Unknown 112 | * Consists of 4 bytes 113 | */ 114 | uint8_t unknown5[ 4 ]; 115 | 116 | /* Unknown 117 | * Consists of 8 bytes 118 | */ 119 | uint8_t unknown6[ 8 ]; 120 | 121 | /* Unknown 122 | * Consists of 8 bytes 123 | */ 124 | uint8_t unknown7[ 8 ]; 125 | 126 | /* Unknown 127 | * Consists of 4 bytes 128 | */ 129 | uint8_t unknown8[ 4 ]; 130 | 131 | /* Unknown 132 | * Consists of 4 bytes 133 | */ 134 | uint8_t unknown9[ 4 ]; 135 | 136 | /* Number of offsets 137 | * Consists of 4 bytes 138 | */ 139 | uint8_t number_of_offsets[ 4 ]; 140 | }; 141 | 142 | #if defined( __cplusplus ) 143 | } 144 | #endif 145 | 146 | #endif /* !defined( _FSREFS_CHECKPOINT_H ) */ 147 | 148 | -------------------------------------------------------------------------------- /libfsrefs/fsrefs_superblock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The ReFS superblock definition 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_SUPERBLOCK_H ) 23 | #define _FSREFS_SUPERBLOCK_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsrefs_superblock fsrefs_superblock_t; 33 | 34 | struct fsrefs_superblock 35 | { 36 | /* The volume identifier 37 | * Consists of 16 bytes 38 | */ 39 | uint8_t volume_identifier[ 16 ]; 40 | 41 | /* Unknown 42 | * Consists of 8 bytes 43 | */ 44 | uint8_t unknown1[ 8 ]; 45 | 46 | /* Unknown 47 | * Consists of 8 bytes 48 | */ 49 | uint8_t unknown2[ 8 ]; 50 | 51 | /* Checkpoints data offset 52 | * Consists of 4 bytes 53 | */ 54 | uint8_t checkpoints_data_offset[ 4 ]; 55 | 56 | /* Number of checkpoints 57 | * Consists of 4 bytes 58 | */ 59 | uint8_t number_of_checkpoints[ 4 ]; 60 | 61 | /* Self reference data offset 62 | * Consists of 4 bytes 63 | */ 64 | uint8_t self_reference_data_offset[ 4 ]; 65 | 66 | /* Self reference data size 67 | * Consists of 4 bytes 68 | */ 69 | uint8_t self_reference_data_size[ 4 ]; 70 | }; 71 | 72 | #if defined( __cplusplus ) 73 | } 74 | #endif 75 | 76 | #endif /* !defined( _FSREFS_SUPERBLOCK_H ) */ 77 | 78 | -------------------------------------------------------------------------------- /libfsrefs/fsrefs_volume_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The ReFS volume header definition 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_VOLUME_HEADER_H ) 23 | #define _FSREFS_VOLUME_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #if defined( __cplusplus ) 29 | extern "C" { 30 | #endif 31 | 32 | typedef struct fsrefs_volume_header fsrefs_volume_header_t; 33 | 34 | struct fsrefs_volume_header 35 | { 36 | /* Unknown 37 | * Consists of 3 bytes 38 | */ 39 | uint8_t unknown1[ 3 ]; 40 | 41 | /* The file system signature 42 | * Consists of 4 bytes 43 | * Contains: "ReFS" 44 | */ 45 | uint8_t file_system_signature[ 4 ]; 46 | 47 | /* Unknown 48 | * Consists of 9 bytes 49 | */ 50 | uint8_t unknown2[ 9 ]; 51 | 52 | /* Unknown 53 | * Consists of 4 bytes 54 | * Contains: "FSRS" 55 | */ 56 | uint8_t unknown3[ 4 ]; 57 | 58 | /* Unknown 59 | * Consists of 2 bytes 60 | */ 61 | uint8_t unknown4[ 2 ]; 62 | 63 | /* Checksum 64 | * Consists of 2 bytes 65 | */ 66 | uint8_t checksum[ 2 ]; 67 | 68 | /* The number of sectors 69 | * Consists of 8 bytes 70 | */ 71 | uint8_t number_of_sectors[ 8 ]; 72 | 73 | /* The number of bytes per sector 74 | * Consists of 4 bytes 75 | */ 76 | uint8_t bytes_per_sector[ 4 ]; 77 | 78 | /* The number of sectors per cluster block 79 | * Consists of 4 bytes 80 | */ 81 | uint8_t sectors_per_cluster_block[ 4 ]; 82 | 83 | /* Major format version 84 | * Consists of 1 byte 85 | */ 86 | uint8_t major_format_version; 87 | 88 | /* Minor format version 89 | * Consists of 1 byte 90 | */ 91 | uint8_t minor_format_version; 92 | 93 | /* Unknown 94 | * Consists of 2 bytes 95 | */ 96 | uint8_t unknown7[ 2 ]; 97 | 98 | /* Unknown 99 | * Consists of 4 bytes 100 | */ 101 | uint8_t unknown8[ 4 ]; 102 | 103 | /* Unknown 104 | * Consists of 8 bytes 105 | */ 106 | uint8_t unknown9[ 8 ]; 107 | 108 | /* Volume serial number 109 | * Consists of 8 bytes 110 | */ 111 | uint8_t volume_serial_number[ 8 ]; 112 | 113 | /* Container size 114 | * Consists of 8 bytes 115 | */ 116 | uint8_t container_size[ 8 ]; 117 | 118 | /* Unknown 119 | * Consists of 440 bytes 120 | */ 121 | uint8_t unknown11[ 440 ]; 122 | }; 123 | 124 | #if defined( __cplusplus ) 125 | } 126 | #endif 127 | 128 | #endif /* !defined( _FSREFS_VOLUME_HEADER_H ) */ 129 | 130 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Library to access the Resiliant File System (ReFS) format 3 | * 4 | * Copyright (C) 2012-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 "libfsrefs_unused.h" 29 | 30 | /* Define HAVE_LOCAL_LIBFSREFS for local use of libfsrefs 31 | */ 32 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 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 | LIBFSREFS_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 libfsrefs_is_dll( 72 | void ) 73 | { 74 | return( 1 ); 75 | } 76 | 77 | #endif /* defined( WINAPI ) && defined( HAVE_DLLMAIN ) */ 78 | 79 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 80 | 81 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs.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 Resiliant File System (ReFS) format\0" 25 | VALUE "FileVersion", "@VERSION@" "\0" 26 | VALUE "InternalName", "libfsrefs.dll\0" 27 | VALUE "LegalCopyright", "(C) 2012-2024, Joachim Metz \0" 28 | VALUE "OriginalFilename", "libfsrefs.dll\0" 29 | VALUE "ProductName", "libfsrefs\0" 30 | VALUE "ProductVersion", "@VERSION@" "\0" 31 | VALUE "Comments", "For more information visit https://github.com/libyal/libfsrefs/\0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x0409, 1200 37 | END 38 | END 39 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_block_descriptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Block descriptor functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_BLOCK_DESCRIPTOR_H ) 23 | #define _LIBFSREFS_BLOCK_DESCRIPTOR_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsrefs_block_descriptor libfsrefs_block_descriptor_t; 35 | 36 | struct libfsrefs_block_descriptor 37 | { 38 | /* The block number 39 | */ 40 | uint64_t block_number; 41 | }; 42 | 43 | int libfsrefs_block_descriptor_initialize( 44 | libfsrefs_block_descriptor_t **block_descriptor, 45 | libcerror_error_t **error ); 46 | 47 | int libfsrefs_block_descriptor_free( 48 | libfsrefs_block_descriptor_t **block_descriptor, 49 | libcerror_error_t **error ); 50 | 51 | #if defined( __cplusplus ) 52 | } 53 | #endif 54 | 55 | #endif /* !defined( _LIBFSREFS_BLOCK_DESCRIPTOR_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_block_reference.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Block reference functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_BLOCK_REFRENCE_H ) 23 | #define _LIBFSREFS_BLOCK_REFRENCE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_io_handle.h" 29 | #include "libfsrefs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsrefs_block_reference libfsrefs_block_reference_t; 36 | 37 | struct libfsrefs_block_reference 38 | { 39 | /* The block numbers 40 | */ 41 | uint64_t block_numbers[ 4 ]; 42 | 43 | /* The checksum 44 | */ 45 | uint64_t checksum; 46 | 47 | /* The block offsets 48 | */ 49 | off64_t block_offsets[ 4 ]; 50 | }; 51 | 52 | int libfsrefs_block_reference_initialize( 53 | libfsrefs_block_reference_t **block_reference, 54 | libcerror_error_t **error ); 55 | 56 | int libfsrefs_block_reference_free( 57 | libfsrefs_block_reference_t **block_reference, 58 | libcerror_error_t **error ); 59 | 60 | int libfsrefs_block_reference_read_data( 61 | libfsrefs_block_reference_t *block_reference, 62 | libfsrefs_io_handle_t *io_handle, 63 | const uint8_t *data, 64 | size_t data_size, 65 | libcerror_error_t **error ); 66 | 67 | #if defined( __cplusplus ) 68 | } 69 | #endif 70 | 71 | #endif /* !defined( _LIBFSREFS_BLOCK_REFRENCE_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_block_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Block tree functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_BLOCK_TREE_H ) 23 | #define _LIBFSREFS_BLOCK_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_block_descriptor.h" 29 | #include "libfsrefs_block_tree_node.h" 30 | #include "libfsrefs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct libfsrefs_block_tree libfsrefs_block_tree_t; 37 | 38 | struct libfsrefs_block_tree 39 | { 40 | /* The block tree root node 41 | */ 42 | libfsrefs_block_tree_node_t *root_node; 43 | 44 | /* The leaf value size 45 | */ 46 | size64_t leaf_value_size; 47 | }; 48 | 49 | int libfsrefs_block_tree_initialize( 50 | libfsrefs_block_tree_t **block_tree, 51 | size64_t size, 52 | size64_t leaf_value_size, 53 | libcerror_error_t **error ); 54 | 55 | int libfsrefs_block_tree_free( 56 | libfsrefs_block_tree_t **block_tree, 57 | int (*value_free_function)( 58 | intptr_t **value, 59 | libcerror_error_t **error ), 60 | libcerror_error_t **error ); 61 | 62 | int libfsrefs_block_tree_get_block_descriptor_by_offset( 63 | libfsrefs_block_tree_t *block_tree, 64 | off64_t offset, 65 | libfsrefs_block_descriptor_t **block_descriptor, 66 | off64_t *block_offset, 67 | libcerror_error_t **error ); 68 | 69 | int libfsrefs_block_tree_insert_block_descriptor_by_offset( 70 | libfsrefs_block_tree_t *block_tree, 71 | off64_t offset, 72 | libfsrefs_block_descriptor_t *block_descriptor, 73 | int *leaf_value_index, 74 | libfsrefs_block_tree_node_t **leaf_block_tree_node, 75 | libfsrefs_block_descriptor_t **existing_block_descriptor, 76 | libcerror_error_t **error ); 77 | 78 | #if defined( __cplusplus ) 79 | } 80 | #endif 81 | 82 | #endif /* !defined( _LIBFSREFS_BLOCK_TREE_H ) */ 83 | 84 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_block_tree_node.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Block tree node functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_BLOCK_TREE_NODE_H ) 23 | #define _LIBFSREFS_BLOCK_TREE_NODE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_block_descriptor.h" 29 | #include "libfsrefs_libcerror.h" 30 | #include "libfsrefs_libcdata.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct libfsrefs_block_tree_node libfsrefs_block_tree_node_t; 37 | 38 | struct libfsrefs_block_tree_node 39 | { 40 | /* The (range) start offset 41 | */ 42 | off64_t start_offset; 43 | 44 | /* The (range) end offset 45 | */ 46 | off64_t end_offset; 47 | 48 | /* The (range) size 49 | */ 50 | off64_t size; 51 | 52 | /* The sub node size 53 | */ 54 | size64_t sub_node_size; 55 | 56 | /* Sub branch or leaf nodes array 57 | */ 58 | libcdata_array_t *sub_nodes_array; 59 | 60 | /* Value to indicate the node is a leaf node 61 | */ 62 | uint8_t is_leaf_node; 63 | }; 64 | 65 | int libfsrefs_block_tree_node_initialize( 66 | libfsrefs_block_tree_node_t **block_tree_node, 67 | off64_t offset, 68 | size64_t size, 69 | size64_t leaf_value_size, 70 | libcerror_error_t **error ); 71 | 72 | int libfsrefs_block_tree_node_free( 73 | libfsrefs_block_tree_node_t **block_tree_node, 74 | int (*value_free_function)( 75 | intptr_t **value, 76 | libcerror_error_t **error ), 77 | libcerror_error_t **error ); 78 | 79 | int libfsrefs_block_tree_node_get_sub_node_at_offset( 80 | libfsrefs_block_tree_node_t *block_tree_node, 81 | off64_t offset, 82 | libfsrefs_block_tree_node_t **sub_block_tree_node, 83 | libcerror_error_t **error ); 84 | 85 | int libfsrefs_block_tree_node_set_sub_node_at_offset( 86 | libfsrefs_block_tree_node_t *block_tree_node, 87 | off64_t offset, 88 | libfsrefs_block_tree_node_t *sub_block_tree_node, 89 | libcerror_error_t **error ); 90 | 91 | int libfsrefs_block_tree_node_get_leaf_value_at_offset( 92 | libfsrefs_block_tree_node_t *block_tree_node, 93 | off64_t offset, 94 | libfsrefs_block_descriptor_t **block_descriptor, 95 | off64_t *block_offset, 96 | libcerror_error_t **error ); 97 | 98 | int libfsrefs_block_tree_node_set_leaf_value_at_offset( 99 | libfsrefs_block_tree_node_t *block_tree_node, 100 | off64_t offset, 101 | libfsrefs_block_descriptor_t *block_descriptor, 102 | libcerror_error_t **error ); 103 | 104 | #if defined( __cplusplus ) 105 | } 106 | #endif 107 | 108 | #endif /* !defined( _LIBFSREFS_BLOCK_TREE_NODE_H ) */ 109 | 110 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_checkpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Checkpoint (or level 1 metadata) functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_CHECKPOINT_H ) 23 | #define _LIBFSREFS_CHECKPOINT_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_block_reference.h" 29 | #include "libfsrefs_io_handle.h" 30 | #include "libfsrefs_libbfio.h" 31 | #include "libfsrefs_libcdata.h" 32 | #include "libfsrefs_libcerror.h" 33 | 34 | #if defined( __cplusplus ) 35 | extern "C" { 36 | #endif 37 | 38 | typedef struct libfsrefs_checkpoint libfsrefs_checkpoint_t; 39 | 40 | struct libfsrefs_checkpoint 41 | { 42 | /* The sequence number 43 | */ 44 | uint64_t sequence_number; 45 | 46 | /* The (ministore tree) block references array 47 | */ 48 | libcdata_array_t *block_references_array; 49 | }; 50 | 51 | int libfsrefs_checkpoint_initialize( 52 | libfsrefs_checkpoint_t **checkpoint, 53 | libcerror_error_t **error ); 54 | 55 | int libfsrefs_checkpoint_free( 56 | libfsrefs_checkpoint_t **checkpoint, 57 | libcerror_error_t **error ); 58 | 59 | int libfsrefs_checkpoint_read_data( 60 | libfsrefs_checkpoint_t *checkpoint, 61 | libfsrefs_io_handle_t *io_handle, 62 | const uint8_t *data, 63 | size_t data_size, 64 | libcerror_error_t **error ); 65 | 66 | int libfsrefs_checkpoint_read_file_io_handle( 67 | libfsrefs_checkpoint_t *checkpoint, 68 | libfsrefs_io_handle_t *io_handle, 69 | libbfio_handle_t *file_io_handle, 70 | off64_t file_offset, 71 | libcerror_error_t **error ); 72 | 73 | int libfsrefs_checkpoint_get_number_of_ministore_tree_block_references( 74 | libfsrefs_checkpoint_t *checkpoint, 75 | int *number_of_block_references, 76 | libcerror_error_t **error ); 77 | 78 | int libfsrefs_checkpoint_get_ministore_tree_block_reference_by_index( 79 | libfsrefs_checkpoint_t *checkpoint, 80 | int block_reference_index, 81 | libfsrefs_block_reference_t **block_reference, 82 | libcerror_error_t **error ); 83 | 84 | #if defined( __cplusplus ) 85 | } 86 | #endif 87 | 88 | #endif /* !defined( _LIBFSREFS_CHECKPOINT_H ) */ 89 | 90 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_data_run.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Data run functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_DATA_RUN_H ) 23 | #define _LIBFSREFS_DATA_RUN_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_io_handle.h" 29 | #include "libfsrefs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsrefs_data_run libfsrefs_data_run_t; 36 | 37 | struct libfsrefs_data_run 38 | { 39 | /* The start block number 40 | */ 41 | uint64_t start_block_number; 42 | 43 | /* The number of blocks 44 | */ 45 | uint64_t number_of_blocks; 46 | }; 47 | 48 | int libfsrefs_data_run_initialize( 49 | libfsrefs_data_run_t **data_run, 50 | libcerror_error_t **error ); 51 | 52 | int libfsrefs_data_run_free( 53 | libfsrefs_data_run_t **data_run, 54 | libcerror_error_t **error ); 55 | 56 | int libfsrefs_data_run_read_data( 57 | libfsrefs_data_run_t *data_run, 58 | libfsrefs_io_handle_t *io_handle, 59 | const uint8_t *data, 60 | size_t data_size, 61 | libcerror_error_t **error ); 62 | 63 | #if defined( __cplusplus ) 64 | } 65 | #endif 66 | 67 | #endif /* !defined( _LIBFSREFS_DATA_RUN_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Debug functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_DEBUG_H ) 23 | #define _LIBFSREFS_DEBUG_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libbfio.h" 29 | #include "libfsrefs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | #if defined( HAVE_DEBUG_OUTPUT ) 36 | 37 | void libfsrefs_debug_print_file_attribute_flags( 38 | uint32_t file_attribute_flags ); 39 | 40 | void libfsrefs_debug_print_node_record_flags( 41 | uint16_t node_record_flags ); 42 | 43 | void libfsrefs_debug_print_node_type_flags( 44 | uint8_t node_type_flags ); 45 | 46 | int libfsrefs_debug_print_filetime_value( 47 | const char *function_name, 48 | const char *value_name, 49 | const uint8_t *byte_stream, 50 | size_t byte_stream_size, 51 | int byte_order, 52 | uint32_t string_format_flags, 53 | libcerror_error_t **error ); 54 | 55 | int libfsrefs_debug_print_guid_value( 56 | const char *function_name, 57 | const char *value_name, 58 | const uint8_t *byte_stream, 59 | size_t byte_stream_size, 60 | int byte_order, 61 | uint32_t string_format_flags, 62 | libcerror_error_t **error ); 63 | 64 | int libfsrefs_debug_print_utf16_string_value( 65 | const char *function_name, 66 | const char *value_name, 67 | const uint8_t *byte_stream, 68 | size_t byte_stream_size, 69 | int byte_order, 70 | libcerror_error_t **error ); 71 | 72 | int libfsrefs_debug_print_read_offsets( 73 | libbfio_handle_t *file_io_handle, 74 | libcerror_error_t **error ); 75 | 76 | #endif /* defined( HAVE_DEBUG_OUTPUT ) */ 77 | 78 | #if defined( __cplusplus ) 79 | } 80 | #endif 81 | 82 | #endif /* !defined( _LIBFSREFS_DEBUG_H ) */ 83 | 84 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_definitions.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal definitions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_INTERNAL_DEFINITIONS_H ) 23 | #define _LIBFSREFS_INTERNAL_DEFINITIONS_H 24 | 25 | #include 26 | #include 27 | 28 | #define LIBFSREFS_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG 29 | #define LIBFSREFS_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE 30 | 31 | /* Define HAVE_LOCAL_LIBFSREFS for local use of libfsrefs 32 | */ 33 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 34 | #include 35 | 36 | /* The definitions in are copied here 37 | * for local use of libfsrefs 38 | */ 39 | #else 40 | #define LIBFSREFS_VERSION @VERSION@ 41 | 42 | /* The version string 43 | */ 44 | #define LIBFSREFS_VERSION_STRING "@VERSION@" 45 | 46 | /* The file access 47 | * bit 1 set to 1 for read access 48 | * bit 2 set to 1 for write access 49 | * bit 3-8 not used 50 | */ 51 | enum LIBFSREFS_ACCESS_FLAGS 52 | { 53 | LIBFSREFS_ACCESS_FLAG_READ = 0x01, 54 | /* Reserved: not supported yet */ 55 | LIBFSREFS_ACCESS_FLAG_WRITE = 0x02 56 | }; 57 | 58 | /* The file access macros 59 | */ 60 | #define LIBFSREFS_OPEN_READ ( LIBFSREFS_ACCESS_FLAG_READ ) 61 | /* Reserved: not supported yet */ 62 | #define LIBFSREFS_OPEN_WRITE ( LIBFSREFS_ACCESS_FLAG_WRITE ) 63 | /* Reserved: not supported yet */ 64 | #define LIBFSREFS_OPEN_READ_WRITE ( LIBFSREFS_ACCESS_FLAG_READ | LIBFSREFS_ACCESS_FLAG_WRITE ) 65 | 66 | /* The path segment separator 67 | */ 68 | #define LIBFSREFS_SEPARATOR '\\' 69 | 70 | /* The file attribute flags 71 | */ 72 | enum LIBFSREFS_FILE_ATTRIBUTE_FLAGS 73 | { 74 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_READ_ONLY = 0x00000001UL, 75 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_HIDDEN = 0x00000002UL, 76 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_SYSTEM = 0x00000004UL, 77 | 78 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_DIRECTORY = 0x00000010UL, 79 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_ARCHIVE = 0x00000020UL, 80 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_DEVICE = 0x00000040UL, 81 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_NORMAL = 0x00000080UL, 82 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_TEMPORARY = 0x00000100UL, 83 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_SPARSE_FILE = 0x00000200UL, 84 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_REPARSE_POINT = 0x00000400UL, 85 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_COMPRESSED = 0x00000800UL, 86 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_OFFLINE = 0x00001000UL, 87 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_NOT_CONTENT_INDEXED = 0x00002000UL, 88 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_ENCRYPTED = 0x00004000UL, 89 | 90 | LIBFSREFS_FILE_ATTRIBUTE_FLAG_VIRTUAL = 0x00010000UL 91 | }; 92 | 93 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 94 | 95 | #define LIBFSREFS_BLOCK_TREE_NUMBER_OF_SUB_NODES 256 96 | 97 | #endif /* !defined( _LIBFSREFS_INTERNAL_DEFINITIONS_H ) */ 98 | 99 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2012-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 | #include 24 | #include 25 | 26 | #include "libfsrefs_error.h" 27 | #include "libfsrefs_libcerror.h" 28 | 29 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 30 | 31 | /* Free an error and its elements 32 | */ 33 | void libfsrefs_error_free( 34 | libfsrefs_error_t **error ) 35 | { 36 | libcerror_error_free( 37 | (libcerror_error_t **) error ); 38 | } 39 | 40 | /* Prints a descriptive string of the error to the stream 41 | * Returns the number of printed characters if successful or -1 on error 42 | */ 43 | int libfsrefs_error_fprint( 44 | libfsrefs_error_t *error, 45 | FILE *stream ) 46 | { 47 | int print_count = 0; 48 | 49 | print_count = libcerror_error_fprint( 50 | (libcerror_error_t *) error, 51 | stream ); 52 | 53 | return( print_count ); 54 | } 55 | 56 | /* Prints a descriptive string of the error to the string 57 | * The end-of-string character is not included in the return value 58 | * Returns the number of printed characters if successful or -1 on error 59 | */ 60 | int libfsrefs_error_sprint( 61 | libfsrefs_error_t *error, 62 | char *string, 63 | size_t size ) 64 | { 65 | int print_count = 0; 66 | 67 | print_count = libcerror_error_sprint( 68 | (libcerror_error_t *) error, 69 | string, 70 | size ); 71 | 72 | return( print_count ); 73 | } 74 | 75 | /* Prints a backtrace of the error to the stream 76 | * Returns the number of printed characters if successful or -1 on error 77 | */ 78 | int libfsrefs_error_backtrace_fprint( 79 | libfsrefs_error_t *error, 80 | FILE *stream ) 81 | { 82 | int print_count = 0; 83 | 84 | print_count = libcerror_error_backtrace_fprint( 85 | (libcerror_error_t *) error, 86 | stream ); 87 | 88 | return( print_count ); 89 | } 90 | 91 | /* Prints a backtrace of the error to the string 92 | * The end-of-string character is not included in the return value 93 | * Returns the number of printed characters if successful or -1 on error 94 | */ 95 | int libfsrefs_error_backtrace_sprint( 96 | libfsrefs_error_t *error, 97 | char *string, 98 | size_t size ) 99 | { 100 | int print_count = 0; 101 | 102 | print_count = libcerror_error_backtrace_sprint( 103 | (libcerror_error_t *) error, 104 | string, 105 | size ); 106 | 107 | return( print_count ); 108 | } 109 | 110 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 111 | 112 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Error functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_INTERNAL_ERROR_H ) 23 | #define _LIBFSREFS_INTERNAL_ERROR_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 30 | #include 31 | #endif 32 | 33 | #include "libfsrefs_extern.h" 34 | 35 | #if defined( __cplusplus ) 36 | extern "C" { 37 | #endif 38 | 39 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 40 | 41 | LIBFSREFS_EXTERN \ 42 | void libfsrefs_error_free( 43 | libfsrefs_error_t **error ); 44 | 45 | LIBFSREFS_EXTERN \ 46 | int libfsrefs_error_fprint( 47 | libfsrefs_error_t *error, 48 | FILE *stream ); 49 | 50 | LIBFSREFS_EXTERN \ 51 | int libfsrefs_error_sprint( 52 | libfsrefs_error_t *error, 53 | char *string, 54 | size_t size ); 55 | 56 | LIBFSREFS_EXTERN \ 57 | int libfsrefs_error_backtrace_fprint( 58 | libfsrefs_error_t *error, 59 | FILE *stream ); 60 | 61 | LIBFSREFS_EXTERN \ 62 | int libfsrefs_error_backtrace_sprint( 63 | libfsrefs_error_t *error, 64 | char *string, 65 | size_t size ); 66 | 67 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 68 | 69 | #if defined( __cplusplus ) 70 | } 71 | #endif 72 | 73 | #endif /* !defined( _LIBFSREFS_INTERNAL_ERROR_H ) */ 74 | 75 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_extern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal extern definition 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_INTERNAL_EXTERN_H ) 23 | #define _LIBFSREFS_INTERNAL_EXTERN_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFSREFS for local use of libfsrefs 28 | */ 29 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 30 | 31 | #include 32 | 33 | #if defined( __CYGWIN__ ) || defined( __MINGW32__ ) 34 | #define LIBFSREFS_EXTERN_VARIABLE extern 35 | #else 36 | #define LIBFSREFS_EXTERN_VARIABLE LIBFSREFS_EXTERN 37 | #endif 38 | 39 | #else 40 | #define LIBFSREFS_EXTERN /* extern */ 41 | #define LIBFSREFS_EXTERN_VARIABLE extern 42 | 43 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 44 | 45 | #endif /* !defined( _LIBFSREFS_INTERNAL_EXTERN_H ) */ 46 | 47 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_file_system.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File system functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_FILE_SYSTEM_H ) 23 | #define _LIBFSREFS_FILE_SYSTEM_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_block_reference.h" 29 | #include "libfsrefs_checkpoint.h" 30 | #include "libfsrefs_io_handle.h" 31 | #include "libfsrefs_libcerror.h" 32 | #include "libfsrefs_ministore_node.h" 33 | #include "libfsrefs_superblock.h" 34 | 35 | #if defined( __cplusplus ) 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct libfsrefs_file_system libfsrefs_file_system_t; 40 | 41 | struct libfsrefs_file_system 42 | { 43 | /* The superblock 44 | */ 45 | libfsrefs_superblock_t *superblock; 46 | 47 | /* The (latest) checkpoint 48 | */ 49 | libfsrefs_checkpoint_t *checkpoint; 50 | 51 | /* The containers (ministore) root node 52 | */ 53 | libfsrefs_ministore_node_t *containers_root_node; 54 | }; 55 | 56 | int libfsrefs_file_system_initialize( 57 | libfsrefs_file_system_t **file_system, 58 | libcerror_error_t **error ); 59 | 60 | int libfsrefs_file_system_free( 61 | libfsrefs_file_system_t **file_system, 62 | libcerror_error_t **error ); 63 | 64 | int libfsrefs_file_system_read_superblock( 65 | libfsrefs_file_system_t *file_system, 66 | libfsrefs_io_handle_t *io_handle, 67 | libbfio_handle_t *file_io_handle, 68 | off64_t file_offset, 69 | libcerror_error_t **error ); 70 | 71 | int libfsrefs_file_system_read_checkpoints( 72 | libfsrefs_file_system_t *file_system, 73 | libfsrefs_io_handle_t *io_handle, 74 | libbfio_handle_t *file_io_handle, 75 | libcerror_error_t **error ); 76 | 77 | int libfsrefs_file_system_read_container_trees( 78 | libfsrefs_file_system_t *file_system, 79 | libfsrefs_io_handle_t *io_handle, 80 | libbfio_handle_t *file_io_handle, 81 | libcerror_error_t **error ); 82 | 83 | int libfsrefs_file_system_get_block_offsets( 84 | libfsrefs_file_system_t *file_system, 85 | libfsrefs_io_handle_t *io_handle, 86 | libfsrefs_block_reference_t *block_reference, 87 | libcerror_error_t **error ); 88 | 89 | int libfsrefs_file_system_get_number_of_ministore_trees( 90 | libfsrefs_file_system_t *file_system, 91 | int *number_of_ministore_trees, 92 | libcerror_error_t **error ); 93 | 94 | int libfsrefs_file_system_get_ministore_tree( 95 | libfsrefs_file_system_t *file_system, 96 | libfsrefs_io_handle_t *io_handle, 97 | libbfio_handle_t *file_io_handle, 98 | int ministore_tree_index, 99 | libfsrefs_ministore_node_t **root_node, 100 | libcerror_error_t **error ); 101 | 102 | #if defined( __cplusplus ) 103 | } 104 | #endif 105 | 106 | #endif /* !defined( _LIBFSREFS_FILE_SYSTEM_H ) */ 107 | 108 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_io_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Input/Output (IO) handle functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_IO_HANDLE_H ) 23 | #define _LIBFSREFS_IO_HANDLE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | extern const char fsrefs_volume_file_system_signature[ 8 ]; 35 | 36 | typedef struct libfsrefs_io_handle libfsrefs_io_handle_t; 37 | 38 | struct libfsrefs_io_handle 39 | { 40 | /* The number of bytes per sector 41 | */ 42 | uint32_t bytes_per_sector; 43 | 44 | /* The volume size 45 | */ 46 | size64_t volume_size; 47 | 48 | /* The major format version 49 | */ 50 | uint8_t major_format_version; 51 | 52 | /* The minor format version 53 | */ 54 | uint8_t minor_format_version; 55 | 56 | /* The cluster block size 57 | */ 58 | size32_t cluster_block_size; 59 | 60 | /* The metadata block size 61 | */ 62 | size32_t metadata_block_size; 63 | 64 | /* The container size 65 | */ 66 | size64_t container_size; 67 | 68 | /* Value to indicate if abort was signalled 69 | */ 70 | int abort; 71 | }; 72 | 73 | int libfsrefs_io_handle_initialize( 74 | libfsrefs_io_handle_t **io_handle, 75 | libcerror_error_t **error ); 76 | 77 | int libfsrefs_io_handle_free( 78 | libfsrefs_io_handle_t **io_handle, 79 | libcerror_error_t **error ); 80 | 81 | int libfsrefs_io_handle_clear( 82 | libfsrefs_io_handle_t *io_handle, 83 | libcerror_error_t **error ); 84 | 85 | #if defined( __cplusplus ) 86 | } 87 | #endif 88 | 89 | #endif /* !defined( _LIBFSREFS_IO_HANDLE_H ) */ 90 | 91 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBBFIO_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libcdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcdata header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBCDATA_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBCDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBCERROR_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBCLOCALE_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBCNOTIFY_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libcthreads.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcthreads header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBCTHREADS_H ) 23 | #define _LIBFSREFS_LIBCTHREADS_H 24 | 25 | #include 26 | 27 | #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBFSREFS ) 28 | #define HAVE_LIBFSREFS_MULTI_THREAD_SUPPORT 29 | #endif 30 | 31 | #if defined( HAVE_LIBFSREFS_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_LIBFSREFS_MULTI_THREAD_SUPPORT ) */ 62 | 63 | #endif /* !defined( _LIBFSREFS_LIBCTHREADS_H ) */ 64 | 65 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libfcache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfcache header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBFCACHE_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBFCACHE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libfdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdata header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBFDATA_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBFDATA_H ) */ 54 | 55 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libfdatetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfdatetime header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBFDATETIME_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBFDATETIME_H ) */ 56 | 57 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libfguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfguid header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBFGUID_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBFGUID_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libfwnt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfwnt header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBFWNT_H ) 23 | #define _LIBFSREFS_LIBFWNT_H 24 | 25 | #include 26 | 27 | /* Define HAVE_LOCAL_LIBFWNT for local use of libfwnt 28 | */ 29 | #if defined( HAVE_LOCAL_LIBFWNT ) 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 | 44 | #else 45 | 46 | /* If libtool DLL support is enabled set LIBFWNT_DLL_IMPORT 47 | * before including libfwnt.h 48 | */ 49 | #if defined( _WIN32 ) && defined( DLL_IMPORT ) 50 | #define LIBFWNT_DLL_IMPORT 51 | #endif 52 | 53 | #include 54 | 55 | #endif /* defined( HAVE_LOCAL_LIBFWNT ) */ 56 | 57 | #endif /* !defined( _LIBFSREFS_LIBFWNT_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_LIBUNA_H ) 23 | #define _LIBFSREFS_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( _LIBFSREFS_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_metadata_block_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The REFS metadata block header functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_METADATA_BLOCK_HEADER_H ) 23 | #define _LIBFSREFS_METADATA_BLOCK_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_io_handle.h" 29 | #include "libfsrefs_libbfio.h" 30 | #include "libfsrefs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct libfsrefs_metadata_block_header libfsrefs_metadata_block_header_t; 37 | 38 | struct libfsrefs_metadata_block_header 39 | { 40 | /* The signature 41 | */ 42 | uint8_t signature[ 4 ]; 43 | 44 | /* The block numbers 45 | */ 46 | uint64_t block_numbers[ 4 ]; 47 | }; 48 | 49 | int libfsrefs_metadata_block_header_initialize( 50 | libfsrefs_metadata_block_header_t **metadata_block_header, 51 | libcerror_error_t **error ); 52 | 53 | int libfsrefs_metadata_block_header_free( 54 | libfsrefs_metadata_block_header_t **metadata_block_header, 55 | libcerror_error_t **error ); 56 | 57 | int libfsrefs_metadata_block_header_read_data( 58 | libfsrefs_metadata_block_header_t *metadata_block_header, 59 | libfsrefs_io_handle_t *io_handle, 60 | const uint8_t *data, 61 | size_t data_size, 62 | libcerror_error_t **error ); 63 | 64 | int libfsrefs_metadata_block_header_read_file_io_handle( 65 | libfsrefs_metadata_block_header_t *metadata_block_header, 66 | libfsrefs_io_handle_t *io_handle, 67 | libbfio_handle_t *file_io_handle, 68 | off64_t file_offset, 69 | libcerror_error_t **error ); 70 | 71 | #if defined( __cplusplus ) 72 | } 73 | #endif 74 | 75 | #endif /* !defined( _LIBFSREFS_METADATA_BLOCK_HEADER_H ) */ 76 | 77 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_node_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Ministore node header functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_NODE_HEADER_H ) 23 | #define _LIBFSREFS_NODE_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsrefs_node_header libfsrefs_node_header_t; 35 | 36 | struct libfsrefs_node_header 37 | { 38 | /* The data area start offset 39 | */ 40 | uint32_t data_area_start_offset; 41 | 42 | /* The data area end offset 43 | */ 44 | uint32_t data_area_end_offset; 45 | 46 | /* The record offsets start offset 47 | */ 48 | uint32_t record_offsets_start_offset; 49 | 50 | /* The record offsets end offset 51 | */ 52 | uint32_t record_offsets_end_offset; 53 | 54 | /* The number of record offsets 55 | */ 56 | uint32_t number_of_record_offsets; 57 | 58 | /* The node type flags 59 | */ 60 | uint8_t node_type_flags; 61 | }; 62 | 63 | int libfsrefs_node_header_initialize( 64 | libfsrefs_node_header_t **node_header, 65 | libcerror_error_t **error ); 66 | 67 | int libfsrefs_node_header_free( 68 | libfsrefs_node_header_t **node_header, 69 | libcerror_error_t **error ); 70 | 71 | int libfsrefs_node_header_read_data( 72 | libfsrefs_node_header_t *node_header, 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( _LIBFSREFS_NODE_HEADER_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_node_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Ministore node record functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_NODE_RECORD_H ) 23 | #define _LIBFSREFS_NODE_RECORD_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsrefs_node_record libfsrefs_node_record_t; 35 | 36 | struct libfsrefs_node_record 37 | { 38 | /* The size 39 | */ 40 | uint32_t size; 41 | 42 | /* The flags 43 | */ 44 | uint16_t flags; 45 | 46 | /* The key data 47 | */ 48 | const uint8_t *key_data; 49 | 50 | /* The key data size 51 | */ 52 | uint16_t key_data_size; 53 | 54 | /* The value data 55 | */ 56 | const uint8_t *value_data; 57 | 58 | /* The value data size 59 | */ 60 | uint16_t value_data_size; 61 | }; 62 | 63 | int libfsrefs_node_record_initialize( 64 | libfsrefs_node_record_t **node_record, 65 | libcerror_error_t **error ); 66 | 67 | int libfsrefs_node_record_free( 68 | libfsrefs_node_record_t **node_record, 69 | libcerror_error_t **error ); 70 | 71 | int libfsrefs_node_record_read_data( 72 | libfsrefs_node_record_t *node_record, 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( _LIBFSREFS_NODE_RECORD_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_notify.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Notification functions 3 | * 4 | * Copyright (C) 2012-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 | #include 24 | #include 25 | 26 | #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) 27 | #include 28 | #endif 29 | 30 | #include "libfsrefs_libcerror.h" 31 | #include "libfsrefs_libcnotify.h" 32 | #include "libfsrefs_notify.h" 33 | 34 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 35 | 36 | /* Sets the verbose notification 37 | */ 38 | void libfsrefs_notify_set_verbose( 39 | int verbose ) 40 | { 41 | libcnotify_verbose_set( 42 | verbose ); 43 | } 44 | 45 | /* Sets the notification stream 46 | * Returns 1 if successful or -1 on error 47 | */ 48 | int libfsrefs_notify_set_stream( 49 | FILE *stream, 50 | libcerror_error_t **error ) 51 | { 52 | static char *function = "libfsrefs_notify_set_stream"; 53 | 54 | if( libcnotify_stream_set( 55 | stream, 56 | error ) != 1 ) 57 | { 58 | libcerror_error_set( 59 | error, 60 | LIBCERROR_ERROR_DOMAIN_RUNTIME, 61 | LIBCERROR_RUNTIME_ERROR_SET_FAILED, 62 | "%s: unable to set stream.", 63 | function ); 64 | 65 | return( -1 ); 66 | } 67 | return( 1 ); 68 | } 69 | 70 | /* Opens the notification stream using a filename 71 | * The stream is opened in append mode 72 | * Returns 1 if successful or -1 on error 73 | */ 74 | int libfsrefs_notify_stream_open( 75 | const char *filename, 76 | libcerror_error_t **error ) 77 | { 78 | static char *function = "libfsrefs_notify_stream_open"; 79 | 80 | if( libcnotify_stream_open( 81 | filename, 82 | error ) != 1 ) 83 | { 84 | libcerror_error_set( 85 | error, 86 | LIBCERROR_ERROR_DOMAIN_IO, 87 | LIBCERROR_IO_ERROR_OPEN_FAILED, 88 | "%s: unable to open stream.", 89 | function ); 90 | 91 | return( -1 ); 92 | } 93 | return( 1 ); 94 | } 95 | 96 | /* Closes the notification stream if opened using a filename 97 | * Returns 0 if successful or -1 on error 98 | */ 99 | int libfsrefs_notify_stream_close( 100 | libcerror_error_t **error ) 101 | { 102 | static char *function = "libfsrefs_notify_stream_close"; 103 | 104 | if( libcnotify_stream_close( 105 | error ) != 0 ) 106 | { 107 | libcerror_error_set( 108 | error, 109 | LIBCERROR_ERROR_DOMAIN_IO, 110 | LIBCERROR_IO_ERROR_OPEN_FAILED, 111 | "%s: unable to open stream.", 112 | function ); 113 | 114 | return( -1 ); 115 | } 116 | return( 0 ); 117 | } 118 | 119 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 120 | 121 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_notify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Notification functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_NOTIFY_H ) 23 | #define _LIBFSREFS_NOTIFY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "libfsrefs_extern.h" 30 | #include "libfsrefs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 37 | 38 | LIBFSREFS_EXTERN \ 39 | void libfsrefs_notify_set_verbose( 40 | int verbose ); 41 | 42 | LIBFSREFS_EXTERN \ 43 | int libfsrefs_notify_set_stream( 44 | FILE *stream, 45 | libcerror_error_t **error ); 46 | 47 | LIBFSREFS_EXTERN \ 48 | int libfsrefs_notify_stream_open( 49 | const char *filename, 50 | libcerror_error_t **error ); 51 | 52 | LIBFSREFS_EXTERN \ 53 | int libfsrefs_notify_stream_close( 54 | libcerror_error_t **error ); 55 | 56 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 57 | 58 | #if defined( __cplusplus ) 59 | } 60 | #endif 61 | 62 | #endif /* !defined( _LIBFSREFS_NOTIFY_H ) */ 63 | 64 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_objects_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Objects tree functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_OBJECTS_TREE_H ) 23 | #define _LIBFSREFS_OBJECTS_TREE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_block_reference.h" 29 | #include "libfsrefs_file_system.h" 30 | #include "libfsrefs_io_handle.h" 31 | #include "libfsrefs_libbfio.h" 32 | #include "libfsrefs_libcerror.h" 33 | #include "libfsrefs_ministore_node.h" 34 | 35 | #if defined( __cplusplus ) 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct libfsrefs_objects_tree libfsrefs_objects_tree_t; 40 | 41 | struct libfsrefs_objects_tree 42 | { 43 | /* File system 44 | */ 45 | libfsrefs_file_system_t *file_system; 46 | 47 | /* Ministore root node 48 | */ 49 | libfsrefs_ministore_node_t *root_node; 50 | }; 51 | 52 | int libfsrefs_objects_tree_initialize( 53 | libfsrefs_objects_tree_t **objects_tree, 54 | libfsrefs_file_system_t *file_system, 55 | libcerror_error_t **error ); 56 | 57 | int libfsrefs_objects_tree_free( 58 | libfsrefs_objects_tree_t **objects_tree, 59 | libcerror_error_t **error ); 60 | 61 | int libfsrefs_objects_tree_read( 62 | libfsrefs_objects_tree_t *objects_tree, 63 | libfsrefs_io_handle_t *io_handle, 64 | libbfio_handle_t *file_io_handle, 65 | libcerror_error_t **error ); 66 | 67 | int libfsrefs_objects_tree_get_ministore_tree_by_identifier( 68 | libfsrefs_objects_tree_t *objects_tree, 69 | libfsrefs_io_handle_t *io_handle, 70 | libbfio_handle_t *file_io_handle, 71 | uint64_t object_identifier, 72 | libfsrefs_ministore_node_t **root_node, 73 | libcerror_error_t **error ); 74 | 75 | #if defined( __cplusplus ) 76 | } 77 | #endif 78 | 79 | #endif /* !defined( _LIBFSREFS_OBJECTS_TREE_H ) */ 80 | 81 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_superblock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Superblock (or level 0 metadata) functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_SUPERBLOCK_H ) 23 | #define _LIBFSREFS_SUPERBLOCK_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_io_handle.h" 29 | #include "libfsrefs_libbfio.h" 30 | #include "libfsrefs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct libfsrefs_superblock libfsrefs_superblock_t; 37 | 38 | struct libfsrefs_superblock 39 | { 40 | /* The volume identifier 41 | */ 42 | uint8_t volume_identifier[ 16 ]; 43 | 44 | /* The primary checkpoint block number 45 | */ 46 | uint64_t primary_checkpoint_block_number; 47 | 48 | /* The secondary checkpoint block number 49 | */ 50 | uint64_t secondary_checkpoint_block_number; 51 | }; 52 | 53 | int libfsrefs_superblock_initialize( 54 | libfsrefs_superblock_t **superblock, 55 | libcerror_error_t **error ); 56 | 57 | int libfsrefs_superblock_free( 58 | libfsrefs_superblock_t **superblock, 59 | libcerror_error_t **error ); 60 | 61 | int libfsrefs_superblock_read_data( 62 | libfsrefs_superblock_t *superblock, 63 | libfsrefs_io_handle_t *io_handle, 64 | const uint8_t *data, 65 | size_t data_size, 66 | libcerror_error_t **error ); 67 | 68 | int libfsrefs_superblock_read_file_io_handle( 69 | libfsrefs_superblock_t *superblock, 70 | libfsrefs_io_handle_t *io_handle, 71 | libbfio_handle_t *file_io_handle, 72 | off64_t file_offset, 73 | libcerror_error_t **error ); 74 | 75 | #if defined( __cplusplus ) 76 | } 77 | #endif 78 | 79 | #endif /* !defined( _LIBFSREFS_SUPERBLOCK_H ) */ 80 | 81 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Support functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_SUPPORT_H ) 23 | #define _LIBFSREFS_SUPPORT_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_extern.h" 29 | #include "libfsrefs_libbfio.h" 30 | #include "libfsrefs_libcerror.h" 31 | 32 | #if defined( __cplusplus ) 33 | extern "C" { 34 | #endif 35 | 36 | #if !defined( HAVE_LOCAL_LIBFSREFS ) 37 | 38 | LIBFSREFS_EXTERN \ 39 | const char *libfsrefs_get_version( 40 | void ); 41 | 42 | LIBFSREFS_EXTERN \ 43 | int libfsrefs_get_access_flags_read( 44 | void ); 45 | 46 | LIBFSREFS_EXTERN \ 47 | int libfsrefs_get_codepage( 48 | int *codepage, 49 | libcerror_error_t **error ); 50 | 51 | LIBFSREFS_EXTERN \ 52 | int libfsrefs_set_codepage( 53 | int codepage, 54 | libcerror_error_t **error ); 55 | 56 | #endif /* !defined( HAVE_LOCAL_LIBFSREFS ) */ 57 | 58 | LIBFSREFS_EXTERN \ 59 | int libfsrefs_check_volume_signature( 60 | const char *filename, 61 | libcerror_error_t **error ); 62 | 63 | #if defined( HAVE_WIDE_CHARACTER_TYPE ) 64 | 65 | LIBFSREFS_EXTERN \ 66 | int libfsrefs_check_volume_signature_wide( 67 | const wchar_t *filename, 68 | libcerror_error_t **error ); 69 | 70 | #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ 71 | 72 | LIBFSREFS_EXTERN \ 73 | int libfsrefs_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( _LIBFSREFS_SUPPORT_H ) */ 82 | 83 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_tree_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Ministore tree header functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_TREE_HEADER_H ) 23 | #define _LIBFSREFS_TREE_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libcerror.h" 29 | 30 | #if defined( __cplusplus ) 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct libfsrefs_tree_header libfsrefs_tree_header_t; 35 | 36 | struct libfsrefs_tree_header 37 | { 38 | /* The table data offset 39 | */ 40 | uint16_t table_data_offset; 41 | }; 42 | 43 | int libfsrefs_tree_header_initialize( 44 | libfsrefs_tree_header_t **tree_header, 45 | libcerror_error_t **error ); 46 | 47 | int libfsrefs_tree_header_free( 48 | libfsrefs_tree_header_t **tree_header, 49 | libcerror_error_t **error ); 50 | 51 | int libfsrefs_tree_header_read_data( 52 | libfsrefs_tree_header_t *tree_header, 53 | const uint8_t *data, 54 | size_t data_size, 55 | libcerror_error_t **error ); 56 | 57 | #if defined( __cplusplus ) 58 | } 59 | #endif 60 | 61 | #endif /* !defined( _LIBFSREFS_TREE_HEADER_H ) */ 62 | 63 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The internal type definitions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_INTERNAL_TYPES_H ) 23 | #define _LIBFSREFS_INTERNAL_TYPES_H 24 | 25 | #include 26 | #include 27 | 28 | /* Define HAVE_LOCAL_LIBFSREFS for local use of libfsrefs 29 | * The definitions in are copied here 30 | * for local use of libfsrefs 31 | */ 32 | #if defined( HAVE_LOCAL_LIBFSREFS ) 33 | 34 | /* The following type definitions hide internal data structures 35 | */ 36 | #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) 37 | typedef struct libfsrefs_file_entry {} libfsrefs_file_entry_t; 38 | typedef struct libfsrefs_volume {} libfsrefs_volume_t; 39 | 40 | #else 41 | typedef intptr_t libfsrefs_file_entry_t; 42 | typedef intptr_t libfsrefs_volume_t; 43 | 44 | #endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ 45 | 46 | #endif /* defined( HAVE_LOCAL_LIBFSREFS ) */ 47 | 48 | #endif /* !defined( _LIBFSREFS_INTERNAL_TYPES_H ) */ 49 | 50 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_UNUSED_H ) 23 | #define _LIBFSREFS_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( LIBFSREFS_ATTRIBUTE_UNUSED ) 28 | #if defined( __GNUC__ ) && __GNUC__ >= 3 29 | #define LIBFSREFS_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 30 | #else 31 | #define LIBFSREFS_ATTRIBUTE_UNUSED 32 | #endif 33 | #endif 34 | 35 | #if defined( _MSC_VER ) 36 | #define LIBFSREFS_UNREFERENCED_PARAMETER( parameter ) \ 37 | UNREFERENCED_PARAMETER( parameter ); 38 | #else 39 | #define LIBFSREFS_UNREFERENCED_PARAMETER( parameter ) \ 40 | /* parameter */ 41 | #endif 42 | 43 | #endif /* !defined( _LIBFSREFS_UNUSED_H ) */ 44 | 45 | -------------------------------------------------------------------------------- /libfsrefs/libfsrefs_volume_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The REFS volume header functions 3 | * 4 | * Copyright (C) 2012-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( _LIBFSREFS_VOLUME_HEADER_H ) 23 | #define _LIBFSREFS_VOLUME_HEADER_H 24 | 25 | #include 26 | #include 27 | 28 | #include "libfsrefs_libbfio.h" 29 | #include "libfsrefs_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | typedef struct libfsrefs_volume_header libfsrefs_volume_header_t; 36 | 37 | struct libfsrefs_volume_header 38 | { 39 | /* The number of bytes per sector 40 | */ 41 | uint32_t bytes_per_sector; 42 | 43 | /* The volume size 44 | */ 45 | size64_t volume_size; 46 | 47 | /* The major format version 48 | */ 49 | uint8_t major_format_version; 50 | 51 | /* The minor format version 52 | */ 53 | uint8_t minor_format_version; 54 | 55 | /* The volume serial number 56 | */ 57 | uint64_t volume_serial_number; 58 | 59 | /* The cluster block size 60 | */ 61 | size32_t cluster_block_size; 62 | 63 | /* The metadata block size 64 | */ 65 | size32_t metadata_block_size; 66 | 67 | /* The container size 68 | */ 69 | size64_t container_size; 70 | }; 71 | 72 | int libfsrefs_volume_header_initialize( 73 | libfsrefs_volume_header_t **volume_header, 74 | libcerror_error_t **error ); 75 | 76 | int libfsrefs_volume_header_free( 77 | libfsrefs_volume_header_t **volume_header, 78 | libcerror_error_t **error ); 79 | 80 | int libfsrefs_volume_header_read_data( 81 | libfsrefs_volume_header_t *volume_header, 82 | const uint8_t *data, 83 | size_t data_size, 84 | libcerror_error_t **error ); 85 | 86 | int libfsrefs_volume_header_read_file_io_handle( 87 | libfsrefs_volume_header_t *volume_header, 88 | libbfio_handle_t *file_io_handle, 89 | off64_t file_offset, 90 | libcerror_error_t **error ); 91 | 92 | int libfsrefs_volume_header_get_bytes_per_sector( 93 | libfsrefs_volume_header_t *volume_header, 94 | uint16_t *bytes_per_sector, 95 | libcerror_error_t **error ); 96 | 97 | int libfsrefs_volume_header_get_cluster_block_size( 98 | libfsrefs_volume_header_t *volume_header, 99 | size32_t *cluster_block_size, 100 | libcerror_error_t **error ); 101 | 102 | int libfsrefs_volume_header_get_volume_size( 103 | libfsrefs_volume_header_t *volume_header, 104 | size64_t *volume_size, 105 | libcerror_error_t **error ); 106 | 107 | int libfsrefs_volume_header_get_volume_serial_number( 108 | libfsrefs_volume_header_t *volume_header, 109 | uint64_t *volume_serial_number, 110 | libcerror_error_t **error ); 111 | 112 | #if defined( __cplusplus ) 113 | } 114 | #endif 115 | 116 | #endif /* !defined( _LIBFSREFS_VOLUME_HEADER_H ) */ 117 | 118 | -------------------------------------------------------------------------------- /m4/pthread.m4: -------------------------------------------------------------------------------- 1 | dnl Functions for pthread 2 | dnl 3 | dnl Version: 20240513 4 | 5 | dnl Function to detect if pthread is available 6 | AC_DEFUN([AX_PTHREAD_CHECK_LIB], 7 | [AS_IF( 8 | [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_pthread" = xno], 9 | [ac_cv_pthread=no], 10 | [ac_cv_pthread=check 11 | dnl Check if parameters were provided 12 | dnl For both --with-pthread which returns "yes" and --with-pthread= which returns "" 13 | dnl treat them as auto-detection. 14 | AS_IF( 15 | [test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xauto-detect && test "x$ac_cv_with_pthread" != xyes], 16 | [AX_CHECK_LIB_DIRECTORY_EXISTS([pthread])]) 17 | ]) 18 | 19 | AS_IF( 20 | [test "x$ac_cv_pthread" = xcheck], 21 | [dnl Check for headers 22 | AC_CHECK_HEADERS([pthread.h]) 23 | 24 | AS_IF( 25 | [test "x$ac_cv_header_pthread_h" = xno], 26 | [ac_cv_pthread=no], 27 | [ac_cv_pthread=yes 28 | 29 | AX_CHECK_LIB_FUNCTIONS( 30 | [pthread], 31 | [pthread], 32 | [[pthread_create], 33 | [pthread_exit], 34 | [pthread_join], 35 | [pthread_cond_init], 36 | [pthread_cond_destroy], 37 | [pthread_cond_broadcast], 38 | [pthread_cond_signal], 39 | [pthread_cond_wait], 40 | [pthread_mutex_init], 41 | [pthread_mutex_destroy], 42 | [pthread_mutex_lock], 43 | [pthread_mutex_trylock], 44 | [pthread_mutex_unlock], 45 | [pthread_rwlock_init], 46 | [pthread_rwlock_destroy], 47 | [pthread_rwlock_rdlock], 48 | [pthread_rwlock_wrlock], 49 | [pthread_rwlock_unlock]]) 50 | 51 | ac_cv_pthread_LIBADD="-lpthread" 52 | ]) 53 | 54 | AX_CHECK_LIB_DIRECTORY_MSG_ON_FAILURE([pthread]) 55 | ]) 56 | 57 | AS_IF( 58 | [test "x$ac_cv_pthread" = xpthread], 59 | [AC_DEFINE( 60 | [HAVE_PTHREAD], 61 | [1], 62 | [Define to 1 if you have the 'pthread' library (-lpthread).]) 63 | ]) 64 | 65 | AS_IF( 66 | [test "x$ac_cv_pthread" != xno], 67 | [AC_SUBST( 68 | [HAVE_PTHREAD], 69 | [1]) ], 70 | [AC_SUBST( 71 | [HAVE_PTHREAD], 72 | [0]) 73 | ]) 74 | ]) 75 | 76 | dnl Function to detect how to enable pthread 77 | AC_DEFUN([AX_PTHREAD_CHECK_ENABLE], 78 | [AX_COMMON_ARG_WITH( 79 | [pthread], 80 | [pthread], 81 | [search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread], 82 | [auto-detect], 83 | [DIR]) 84 | 85 | dnl Check for a shared library version 86 | AX_PTHREAD_CHECK_LIB 87 | 88 | AS_IF( 89 | [test "x$ac_cv_pthread_CPPFLAGS" != "x"], 90 | [AC_SUBST( 91 | [PTHREAD_CPPFLAGS], 92 | [$ac_cv_pthread_CPPFLAGS]) 93 | ]) 94 | AS_IF( 95 | [test "x$ac_cv_pthread_LIBADD" != "x"], 96 | [AC_SUBST( 97 | [PTHREAD_LIBADD], 98 | [$ac_cv_pthread_LIBADD]) 99 | ]) 100 | 101 | AS_IF( 102 | [test "x$ac_cv_pthread" = xpthread], 103 | [AC_SUBST( 104 | [ax_pthread_pc_libs_private], 105 | [-lpthread]) 106 | ]) 107 | ]) 108 | 109 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /m4/types.m4: -------------------------------------------------------------------------------- 1 | dnl Functions for type definitions 2 | dnl 3 | dnl Version: 20180727 4 | 5 | dnl Function to detect if type definitions are available 6 | AC_DEFUN([AX_TYPES_CHECK_LOCAL], 7 | [AS_IF( 8 | [test "x$ac_cv_enable_winapi" = xyes], 9 | [ac_cv_enable_wide_character_type=yes]) 10 | 11 | AS_IF( 12 | [test "x$ac_cv_enable_wide_character_type" = xyes], 13 | [AC_DEFINE( 14 | [HAVE_WIDE_CHARACTER_TYPE], 15 | [1], 16 | [Define to 1 if wide character type should be used.]) 17 | AC_SUBST( 18 | [HAVE_WIDE_CHARACTER_TYPE], 19 | [1]) ], 20 | [AC_SUBST( 21 | [HAVE_WIDE_CHARACTER_TYPE], 22 | [0]) 23 | ]) 24 | 25 | AC_CHECK_HEADERS([sys/types.h inttypes.h stdint.h wchar.h]) 26 | 27 | AS_IF( 28 | [test "x$ac_cv_header_sys_types_h" = xyes], 29 | [AC_SUBST( 30 | [HAVE_SYS_TYPES_H], 31 | [1])], 32 | [AC_SUBST( 33 | [HAVE_SYS_TYPES_H], 34 | [0]) 35 | ]) 36 | 37 | AS_IF( 38 | [test "x$ac_cv_header_inttypes_h" = xyes], 39 | [AC_SUBST( 40 | [HAVE_INTTYPES_H], 41 | [1])], 42 | [AC_SUBST( 43 | [HAVE_INTTYPES_H], 44 | [0]) 45 | ]) 46 | 47 | AS_IF( 48 | [test "x$ac_cv_header_stdint_h" = xyes], 49 | [AC_SUBST( 50 | [HAVE_STDINT_H], 51 | [1])], 52 | [AC_SUBST( 53 | [HAVE_STDINT_H], 54 | [0]) 55 | ]) 56 | 57 | AS_IF( 58 | [test "x$ac_cv_header_wchar_h" = xyes], 59 | [AC_SUBST( 60 | [HAVE_WCHAR_H], 61 | [1]) ], 62 | [AC_SUBST( 63 | [HAVE_WCHAR_H], 64 | [0]) 65 | ]) 66 | 67 | AC_TYPE_MODE_T 68 | AC_TYPE_OFF_T 69 | AC_TYPE_SIZE_T 70 | 71 | AC_CHECK_TYPE( 72 | [size32_t], 73 | [AC_SUBST( 74 | [HAVE_SIZE32_T], 75 | [1])], 76 | [AC_SUBST( 77 | [HAVE_SIZE32_T], 78 | [0]) 79 | ]) 80 | 81 | AC_CHECK_TYPE( 82 | [ssize32_t], 83 | [AC_SUBST( 84 | [HAVE_SSIZE32_T], 85 | [1])], 86 | [AC_SUBST( 87 | [HAVE_SSIZE32_T], 88 | [0]) 89 | ]) 90 | 91 | AC_CHECK_TYPE( 92 | [size64_t], 93 | [AC_SUBST( 94 | [HAVE_SIZE64_T], 95 | [1])], 96 | [AC_SUBST( 97 | [HAVE_SIZE64_T], 98 | [0]) 99 | ]) 100 | 101 | AC_CHECK_TYPE( 102 | [ssize64_t], 103 | [AC_SUBST( 104 | [HAVE_SSIZE64_T], 105 | [1])], 106 | [AC_SUBST( 107 | [HAVE_SSIZE64_T], 108 | [0]) 109 | ]) 110 | 111 | AC_CHECK_TYPE( 112 | [off64_t], 113 | [AC_SUBST( 114 | [HAVE_OFF64_T], 115 | [1])], 116 | [AC_SUBST( 117 | [HAVE_OFF64_T], 118 | [0]) 119 | ]) 120 | 121 | AC_CHECK_TYPE([ssize_t]) 122 | AC_CHECK_TYPE([u64]) 123 | 124 | AC_CHECK_SIZEOF([int]) 125 | AC_CHECK_SIZEOF([long]) 126 | AC_CHECK_SIZEOF([off_t]) 127 | AC_CHECK_SIZEOF([size_t]) 128 | 129 | AS_IF( 130 | [test "x$ac_cv_header_wchar_h" = xyes], 131 | [AC_CHECK_SIZEOF([wchar_t])]) 132 | ]) 133 | 134 | -------------------------------------------------------------------------------- /manuals/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = \ 2 | fsrefsinfo.1 \ 3 | libfsrefs.3 4 | 5 | EXTRA_DIST = \ 6 | fsrefsinfo.1 \ 7 | libfsrefs.3 8 | 9 | DISTCLEANFILES = \ 10 | Makefile \ 11 | Makefile.in 12 | 13 | -------------------------------------------------------------------------------- /manuals/fsrefsinfo.1: -------------------------------------------------------------------------------- 1 | .Dd June 28, 2023 2 | .Dt fsrefsinfo 3 | .Os libfsrefs 4 | .Sh NAME 5 | .Nm fsrefsinfo 6 | .Nd determines information about a Resiliant File System (ReFS) 7 | .Sh SYNOPSIS 8 | .Nm fsrefsinfo 9 | .Op Fl ahvV 10 | .Va Ar source 11 | .Sh DESCRIPTION 12 | .Nm fsrefsinfo 13 | is a utility to determine information about a Resiliant File System (ReFS) 14 | .Pp 15 | .Nm fsrefsinfo 16 | is part of the 17 | .Nm libfsrefs 18 | package. 19 | .Nm libfsrefs 20 | is a library to access the Resiliant File System (ReFS) format 21 | .Pp 22 | .Ar source 23 | is the source file. 24 | .Pp 25 | The options are as follows: 26 | .Bl -tag -width Ds 27 | .It Fl a 28 | shows allocation information 29 | .It Fl h 30 | shows this help 31 | .It Fl v 32 | verbose output to stderr 33 | .It Fl V 34 | print version 35 | .El 36 | .Sh ENVIRONMENT 37 | None 38 | .Sh FILES 39 | None 40 | .Sh EXAMPLES 41 | .Bd -literal 42 | # fsrefsinfo /dev/sda1 43 | fsrefsinfo 20130915 44 | 45 | Resiliant File System (ReFS) volume information: 46 | .Dl ... 47 | 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/libfsrefs/ 55 | .Sh AUTHOR 56 | These man pages were written by Joachim Metz. 57 | .Sh COPYRIGHT 58 | Copyright 2012-2013, 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 | -------------------------------------------------------------------------------- /msvscpp/Makefile.am: -------------------------------------------------------------------------------- 1 | MSVSCPP_FILES = \ 2 | fsrefs_test_attribute_values/fsrefs_test_attribute_values.vcproj \ 3 | fsrefs_test_block_descriptor/fsrefs_test_block_descriptor.vcproj \ 4 | fsrefs_test_block_reference/fsrefs_test_block_reference.vcproj \ 5 | fsrefs_test_block_tree/fsrefs_test_block_tree.vcproj \ 6 | fsrefs_test_block_tree_node/fsrefs_test_block_tree_node.vcproj \ 7 | fsrefs_test_checkpoint/fsrefs_test_checkpoint.vcproj \ 8 | fsrefs_test_data_run/fsrefs_test_data_run.vcproj \ 9 | fsrefs_test_directory_entry/fsrefs_test_directory_entry.vcproj \ 10 | fsrefs_test_directory_object/fsrefs_test_directory_object.vcproj \ 11 | fsrefs_test_error/fsrefs_test_error.vcproj \ 12 | fsrefs_test_file_entry/fsrefs_test_file_entry.vcproj \ 13 | fsrefs_test_file_system/fsrefs_test_file_system.vcproj \ 14 | fsrefs_test_io_handle/fsrefs_test_io_handle.vcproj \ 15 | fsrefs_test_metadata_block_header/fsrefs_test_metadata_block_header.vcproj \ 16 | fsrefs_test_ministore_node/fsrefs_test_ministore_node.vcproj \ 17 | fsrefs_test_node_header/fsrefs_test_node_header.vcproj \ 18 | fsrefs_test_node_record/fsrefs_test_node_record.vcproj \ 19 | fsrefs_test_notify/fsrefs_test_notify.vcproj \ 20 | fsrefs_test_objects_tree/fsrefs_test_objects_tree.vcproj \ 21 | fsrefs_test_superblock/fsrefs_test_superblock.vcproj \ 22 | fsrefs_test_support/fsrefs_test_support.vcproj \ 23 | fsrefs_test_tools_info_handle/fsrefs_test_tools_info_handle.vcproj \ 24 | fsrefs_test_tools_output/fsrefs_test_tools_output.vcproj \ 25 | fsrefs_test_tools_signal/fsrefs_test_tools_signal.vcproj \ 26 | fsrefs_test_tree_header/fsrefs_test_tree_header.vcproj \ 27 | fsrefs_test_volume/fsrefs_test_volume.vcproj \ 28 | fsrefs_test_volume_header/fsrefs_test_volume_header.vcproj \ 29 | fsrefsinfo/fsrefsinfo.vcproj \ 30 | libbfio/libbfio.vcproj \ 31 | libcdata/libcdata.vcproj \ 32 | libcerror/libcerror.vcproj \ 33 | libcfile/libcfile.vcproj \ 34 | libclocale/libclocale.vcproj \ 35 | libcnotify/libcnotify.vcproj \ 36 | libcpath/libcpath.vcproj \ 37 | libcsplit/libcsplit.vcproj \ 38 | libcthreads/libcthreads.vcproj \ 39 | libfcache/libfcache.vcproj \ 40 | libfdata/libfdata.vcproj \ 41 | libfdatetime/libfdatetime.vcproj \ 42 | libfguid/libfguid.vcproj \ 43 | libfsrefs/libfsrefs.vcproj \ 44 | libfusn/libfusn.vcproj \ 45 | libfwnt/libfwnt.vcproj \ 46 | libuna/libuna.vcproj \ 47 | libfsrefs.sln 48 | 49 | EXTRA_DIST = \ 50 | $(MSVSCPP_FILES) 51 | 52 | DISTCLEANFILES = \ 53 | Makefile \ 54 | Makefile.in 55 | 56 | -------------------------------------------------------------------------------- /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 | volume_fuzzer 16 | 17 | volume_fuzzer_SOURCES = \ 18 | ossfuzz_libbfio.h \ 19 | ossfuzz_libfsrefs.h \ 20 | volume_fuzzer.cc 21 | 22 | volume_fuzzer_LDADD = \ 23 | @LIB_FUZZING_ENGINE@ \ 24 | @LIBBFIO_LIBADD@ \ 25 | @LIBCPATH_LIBADD@ \ 26 | @LIBCFILE_LIBADD@ \ 27 | @LIBUNA_LIBADD@ \ 28 | @LIBCDATA_LIBADD@ \ 29 | ../libfsrefs/libfsrefs.la \ 30 | @LIBCNOTIFY_LIBADD@ \ 31 | @LIBCLOCALE_LIBADD@ \ 32 | @LIBCERROR_LIBADD@ \ 33 | @LIBINTL@ 34 | endif 35 | 36 | DISTCLEANFILES = \ 37 | Makefile \ 38 | Makefile.in 39 | 40 | splint-local: 41 | @echo "Running splint on volume_fuzzer ..." 42 | -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(volume_fuzzer_SOURCES) 43 | 44 | -------------------------------------------------------------------------------- /ossfuzz/ossfuzz_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2012-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_libfsrefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsrefs header wrapper 3 | * 4 | * Copyright (C) 2012-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_LIBFSREFS_H ) 23 | #define _OSSFUZZ_LIBFSREFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _OSSFUZZ_LIBFSREFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /ossfuzz/volume_fuzzer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * OSS-Fuzz target for libfsrefs volume type 3 | * 4 | * Copyright (C) 2012-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 | #include 24 | 25 | /* Note that some of the OSS-Fuzz engines use C++ 26 | */ 27 | extern "C" { 28 | 29 | #include "ossfuzz_libbfio.h" 30 | #include "ossfuzz_libfsrefs.h" 31 | 32 | #if !defined( LIBFSREFS_HAVE_BFIO ) 33 | 34 | /* Opens a volume using a Basic File IO (bfio) handle 35 | * Returns 1 if successful or -1 on error 36 | */ 37 | LIBFSREFS_EXTERN \ 38 | int libfsrefs_volume_open_file_io_handle( 39 | libfsrefs_volume_t *volume, 40 | libbfio_handle_t *file_io_handle, 41 | int access_flags, 42 | libfsrefs_error_t **error ); 43 | 44 | #endif /* !defined( LIBFSREFS_HAVE_BFIO ) */ 45 | 46 | int LLVMFuzzerTestOneInput( 47 | const uint8_t *data, 48 | size_t size ) 49 | { 50 | libbfio_handle_t *file_io_handle = NULL; 51 | libfsrefs_volume_t *volume = NULL; 52 | 53 | if( libbfio_memory_range_initialize( 54 | &file_io_handle, 55 | NULL ) != 1 ) 56 | { 57 | return( 0 ); 58 | } 59 | if( libbfio_memory_range_set( 60 | file_io_handle, 61 | (uint8_t *) data, 62 | size, 63 | NULL ) != 1 ) 64 | { 65 | goto on_error_libbfio; 66 | } 67 | if( libfsrefs_volume_initialize( 68 | &volume, 69 | NULL ) != 1 ) 70 | { 71 | goto on_error_libbfio; 72 | } 73 | if( libfsrefs_volume_open_file_io_handle( 74 | volume, 75 | file_io_handle, 76 | LIBFSREFS_OPEN_READ, 77 | NULL ) != 1 ) 78 | { 79 | goto on_error_libfsrefs; 80 | } 81 | libfsrefs_volume_close( 82 | volume, 83 | NULL ); 84 | 85 | on_error_libfsrefs: 86 | libfsrefs_volume_free( 87 | &volume, 88 | NULL ); 89 | 90 | on_error_libbfio: 91 | libbfio_handle_free( 92 | &file_io_handle, 93 | NULL ); 94 | 95 | return( 0 ); 96 | } 97 | 98 | } /* extern "C" */ 99 | 100 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/block_descriptor.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/block_descriptor.1 -------------------------------------------------------------------------------- /tests/data/block_descriptor.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/block_descriptor.2 -------------------------------------------------------------------------------- /tests/data/checkpoint.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/checkpoint.1 -------------------------------------------------------------------------------- /tests/data/checkpoint.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/checkpoint.2 -------------------------------------------------------------------------------- /tests/data/data_run.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/data_run.1 -------------------------------------------------------------------------------- /tests/data/node_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/node_header.1 -------------------------------------------------------------------------------- /tests/data/node_record.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/node_record.1 -------------------------------------------------------------------------------- /tests/data/superblock.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/superblock.1 -------------------------------------------------------------------------------- /tests/data/superblock.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/superblock.2 -------------------------------------------------------------------------------- /tests/data/tree_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/tree_header.1 -------------------------------------------------------------------------------- /tests/data/volume_header.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/libyal/libfsrefs/9382ef681d234881cccf8cebae18dacc96f176d4/tests/data/volume_header.1 -------------------------------------------------------------------------------- /tests/fsrefs_test_file_entry.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Library file_entry type test program 3 | * 4 | * Copyright (C) 2012-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 | #include 24 | #include 25 | 26 | #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) 27 | #include 28 | #endif 29 | 30 | #include "fsrefs_test_libcerror.h" 31 | #include "fsrefs_test_libfsrefs.h" 32 | #include "fsrefs_test_macros.h" 33 | #include "fsrefs_test_memory.h" 34 | #include "fsrefs_test_unused.h" 35 | 36 | #include "../libfsrefs/libfsrefs_file_entry.h" 37 | 38 | #if defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) 39 | 40 | /* Tests the libfsrefs_file_entry_free function 41 | * Returns 1 if successful or 0 if not 42 | */ 43 | int fsrefs_test_file_entry_free( 44 | void ) 45 | { 46 | libcerror_error_t *error = NULL; 47 | int result = 0; 48 | 49 | /* Test error cases 50 | */ 51 | result = libfsrefs_file_entry_free( 52 | NULL, 53 | &error ); 54 | 55 | FSREFS_TEST_ASSERT_EQUAL_INT( 56 | "result", 57 | result, 58 | -1 ); 59 | 60 | FSREFS_TEST_ASSERT_IS_NOT_NULL( 61 | "error", 62 | error ); 63 | 64 | libcerror_error_free( 65 | &error ); 66 | 67 | return( 1 ); 68 | 69 | on_error: 70 | if( error != NULL ) 71 | { 72 | libcerror_error_free( 73 | &error ); 74 | } 75 | return( 0 ); 76 | } 77 | 78 | #endif /* defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) */ 79 | 80 | /* The main program 81 | */ 82 | #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) 83 | int wmain( 84 | int argc FSREFS_TEST_ATTRIBUTE_UNUSED, 85 | wchar_t * const argv[] FSREFS_TEST_ATTRIBUTE_UNUSED ) 86 | #else 87 | int main( 88 | int argc FSREFS_TEST_ATTRIBUTE_UNUSED, 89 | char * const argv[] FSREFS_TEST_ATTRIBUTE_UNUSED ) 90 | #endif 91 | { 92 | FSREFS_TEST_UNREFERENCED_PARAMETER( argc ) 93 | FSREFS_TEST_UNREFERENCED_PARAMETER( argv ) 94 | 95 | #if defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) 96 | 97 | /* TODO add test for libfsrefs_file_entry_initialize */ 98 | 99 | FSREFS_TEST_RUN( 100 | "libfsrefs_file_entry_free", 101 | fsrefs_test_file_entry_free ); 102 | 103 | #endif /* defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) */ 104 | 105 | return( EXIT_SUCCESS ); 106 | 107 | #if defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) 108 | 109 | on_error: 110 | return( EXIT_FAILURE ); 111 | 112 | #endif /* defined( __GNUC__ ) && !defined( LIBFSREFS_DLL_IMPORT ) */ 113 | } 114 | 115 | -------------------------------------------------------------------------------- /tests/fsrefs_test_functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Functions for testing 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_FUNCTIONS_H ) 23 | #define _FSREFS_TEST_FUNCTIONS_H 24 | 25 | #include 26 | #include 27 | 28 | #include "fsrefs_test_libbfio.h" 29 | #include "fsrefs_test_libcerror.h" 30 | 31 | #if defined( __cplusplus ) 32 | extern "C" { 33 | #endif 34 | 35 | int fsrefs_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 fsrefs_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 fsrefs_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 fsrefs_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 fsrefs_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( _FSREFS_TEST_FUNCTIONS_H ) */ 72 | 73 | -------------------------------------------------------------------------------- /tests/fsrefs_test_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GetOpt functions 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_GETOPT_H ) 23 | #define _FSREFS_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 fsrefs_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 fsrefs_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( _FSREFS_TEST_GETOPT_H ) */ 68 | 69 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libbfio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libbfio header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBBFIO_H ) 23 | #define _FSREFS_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( _FSREFS_TEST_LIBBFIO_H ) */ 58 | 59 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libcerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcerror header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBCERROR_H ) 23 | #define _FSREFS_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( _FSREFS_TEST_LIBCERROR_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libclocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libclocale header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBCLOCALE_H ) 23 | #define _FSREFS_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( _FSREFS_TEST_LIBCLOCALE_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libcnotify.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libcnotify header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBCNOTIFY_H ) 23 | #define _FSREFS_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( _FSREFS_TEST_LIBCNOTIFY_H ) */ 50 | 51 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libfsrefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libfsrefs header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBFSREFS_H ) 23 | #define _FSREFS_TEST_LIBFSREFS_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #endif /* !defined( _FSREFS_TEST_LIBFSREFS_H ) */ 30 | 31 | -------------------------------------------------------------------------------- /tests/fsrefs_test_libuna.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The libuna header wrapper 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_LIBUNA_H ) 23 | #define _FSREFS_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( _FSREFS_TEST_LIBUNA_H ) */ 60 | 61 | -------------------------------------------------------------------------------- /tests/fsrefs_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Memory allocation functions for testing 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_MEMORY_H ) 23 | #define _FSREFS_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( LIBFSREFS_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __loongarch__ ) && !defined( __mips__ ) && !defined( __riscv ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) 32 | #define HAVE_FSREFS_TEST_MEMORY 1 33 | #endif 34 | 35 | #if defined( HAVE_FSREFS_TEST_MEMORY ) 36 | 37 | extern int fsrefs_test_malloc_attempts_before_fail; 38 | 39 | extern int fsrefs_test_memcpy_attempts_before_fail; 40 | 41 | extern int fsrefs_test_memset_attempts_before_fail; 42 | 43 | extern int fsrefs_test_realloc_attempts_before_fail; 44 | 45 | #endif /* defined( HAVE_FSREFS_TEST_MEMORY ) */ 46 | 47 | #if defined( __cplusplus ) 48 | } 49 | #endif 50 | 51 | #endif /* !defined( _FSREFS_TEST_MEMORY_H ) */ 52 | 53 | -------------------------------------------------------------------------------- /tests/fsrefs_test_tools_output.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Tools output functions test program 3 | * 4 | * Copyright (C) 2012-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 | #include 24 | #include 25 | 26 | #include 27 | 28 | #if defined( HAVE_IO_H ) || defined( WINAPI ) 29 | #include 30 | #endif 31 | 32 | #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) 33 | #include 34 | #endif 35 | 36 | #include "fsrefs_test_libcerror.h" 37 | #include "fsrefs_test_macros.h" 38 | #include "fsrefs_test_unused.h" 39 | 40 | #include "../fsrefstools/fsrefstools_output.h" 41 | 42 | /* Tests the fsrefstools_output_initialize and function 43 | * Returns 1 if successful or 0 if not 44 | */ 45 | int fsrefs_test_tools_output_initialize( 46 | void ) 47 | { 48 | libcerror_error_t *error = NULL; 49 | int result = 0; 50 | 51 | result = fsrefstools_output_initialize( 52 | _IONBF, 53 | &error ); 54 | 55 | FSREFS_TEST_ASSERT_EQUAL_INT( 56 | "result", 57 | result, 58 | 1 ); 59 | 60 | FSREFS_TEST_ASSERT_IS_NULL( 61 | "error", 62 | error ); 63 | 64 | return( 1 ); 65 | 66 | on_error: 67 | if( error != NULL ) 68 | { 69 | libcerror_error_free( 70 | &error ); 71 | } 72 | return( 0 ); 73 | } 74 | 75 | /* The main program 76 | */ 77 | #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) 78 | int wmain( 79 | int argc FSREFS_TEST_ATTRIBUTE_UNUSED, 80 | wchar_t * const argv[] FSREFS_TEST_ATTRIBUTE_UNUSED ) 81 | #else 82 | int main( 83 | int argc FSREFS_TEST_ATTRIBUTE_UNUSED, 84 | char * const argv[] FSREFS_TEST_ATTRIBUTE_UNUSED ) 85 | #endif 86 | { 87 | FSREFS_TEST_UNREFERENCED_PARAMETER( argc ) 88 | FSREFS_TEST_UNREFERENCED_PARAMETER( argv ) 89 | 90 | FSREFS_TEST_RUN( 91 | "fsrefstools_output_initialize", 92 | fsrefs_test_tools_output_initialize ) 93 | 94 | /* TODO add tests for fsrefstools_output_copyright_fprint */ 95 | 96 | /* TODO add tests for fsrefstools_output_version_fprint */ 97 | 98 | /* TODO add tests for fsrefstools_output_version_detailed_fprint */ 99 | 100 | return( EXIT_SUCCESS ); 101 | 102 | on_error: 103 | return( EXIT_FAILURE ); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /tests/fsrefs_test_unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Definitions to silence compiler warnings about unused function attributes/parameters. 3 | * 4 | * Copyright (C) 2012-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( _FSREFS_TEST_UNUSED_H ) 23 | #define _FSREFS_TEST_UNUSED_H 24 | 25 | #include 26 | 27 | #if !defined( FSREFS_TEST_ATTRIBUTE_UNUSED ) 28 | 29 | #if defined( __GNUC__ ) && __GNUC__ >= 3 30 | #define FSREFS_TEST_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 31 | 32 | #else 33 | #define FSREFS_TEST_ATTRIBUTE_UNUSED 34 | 35 | #endif /* defined( __GNUC__ ) && __GNUC__ >= 3 */ 36 | 37 | #endif /* !defined( FSREFS_TEST_ATTRIBUTE_UNUSED ) */ 38 | 39 | #if defined( _MSC_VER ) 40 | #define FSREFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 41 | UNREFERENCED_PARAMETER( parameter ); 42 | 43 | #else 44 | #define FSREFS_TEST_UNREFERENCED_PARAMETER( parameter ) \ 45 | /* parameter */ 46 | 47 | #endif /* defined( _MSC_VER ) */ 48 | 49 | #endif /* !defined( _FSREFS_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/libfsrefs 10 | cp AUTHORS COPYING COPYING.LESSER NEWS README ${PWD}/osx-pkg/usr/share/doc/libfsrefs 11 | 12 | VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` 13 | pkgbuild --root osx-pkg --identifier com.github.libyal.libfsrefs --version ${VERSION} --ownership recommended ../libfsrefs-${VERSION}.pkg 14 | 15 | -------------------------------------------------------------------------------- /tests/runtests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Script to run tests 3 | # 4 | # Version: 20201121 5 | 6 | if test -f ${PWD}/libfsrefs/.libs/libfsrefs.1.dylib && test -f ./pyfsrefs/.libs/pyfsrefs.so; 7 | then 8 | install_name_tool -change /usr/local/lib/libfsrefs.1.dylib ${PWD}/libfsrefs/.libs/libfsrefs.1.dylib ./pyfsrefs/.libs/pyfsrefs.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 libfwnt"; 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 | --------------------------------------------------------------------------------