Skip to content

Commit

Permalink
Applied updates and code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Jul 9, 2023
1 parent 4364351 commit 1c853ae
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 73 deletions.
10 changes: 2 additions & 8 deletions appveyor.yml
Expand Up @@ -116,12 +116,6 @@ environment:
BUILD_ENVIRONMENT: python
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PYTHON: "C:\\Python311-x64\\python.exe"
- TARGET: macos-tox-py37
BUILD_ENVIRONMENT: python-tox
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
PYTHON_VERSION: 3.7
TOXENV: py37
- TARGET: macos-tox-py38
BUILD_ENVIRONMENT: python-tox
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
Expand Down Expand Up @@ -189,7 +183,7 @@ environment:
install:
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
Expand All @@ -199,7 +193,7 @@ install:
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P python3-devel )
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gcc gettext-devel libtool make )
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc )
- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) {
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libscca],
[20230424],
[20230709],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
14 changes: 4 additions & 10 deletions libscca.spec.in
Expand Up @@ -3,10 +3,9 @@ Version: @VERSION@
Release: 1
Summary: Library to access the Windows Prefetch File (PF) format
Group: System Environment/Libraries
License: LGPLv3+
License: LGPL-3.0-or-later
Source: %{name}-%{version}.tar.gz
URL: https://github.com/libyal/libscca
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@libscca_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_libfvalue_spec_requires@ @ax_libfwnt_spec_requires@ @ax_libuna_spec_requires@
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_libfvalue_spec_build_requires@ @ax_libfwnt_spec_build_requires@ @ax_libuna_spec_build_requires@

Expand Down Expand Up @@ -65,19 +64,16 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig

%files -n libscca
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.so.*
%{_libdir}/*.so.*

%files -n libscca-static
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.a
%{_libdir}/*.a

%files -n libscca-devel
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%{_libdir}/*.so
Expand All @@ -86,17 +82,15 @@ rm -rf %{buildroot}
%{_mandir}/man3/*

%files -n libscca-python3
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%{_libdir}/python3*/site-packages/*.a
%{_libdir}/python3*/site-packages/*.so

%files -n libscca-tools
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_bindir}/*
%{_bindir}/*
%{_mandir}/man1/*

%changelog
Expand Down
35 changes: 30 additions & 5 deletions libscca/libscca_file_information.c
Expand Up @@ -548,9 +548,7 @@ int libscca_file_information_read_data(
80,
LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
}
else if( ( io_handle->format_version == 26 )
|| ( ( io_handle->format_version == 30 )
&& ( file_information->metrics_array_offset == 0x00000130 ) ) )
else if( io_handle->format_version == 26 )
{
byte_stream_copy_to_uint32_little_endian(
( (scca_file_information_v26_t *) data )->unknown5a,
Expand All @@ -573,7 +571,34 @@ int libscca_file_information_read_data(
function );
libcnotify_print_data(
( (scca_file_information_v26_t *) data )->unknown6,
88,
84,
LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
}
else if( ( io_handle->format_version == 30 )
&& ( file_information->metrics_array_offset == 0x00000130 ) )
{
byte_stream_copy_to_uint32_little_endian(
( (scca_file_information_v30_1_t *) data )->unknown5a,
value_32bit );
libcnotify_printf(
"%s: unknown5a\t\t\t\t: 0x%08" PRIx32 "\n",
function,
value_32bit );

byte_stream_copy_to_uint32_little_endian(
( (scca_file_information_v30_1_t *) data )->unknown5b,
value_32bit );
libcnotify_printf(
"%s: unknown5b\t\t\t\t: 0x%08" PRIx32 "\n",
function,
value_32bit );

libcnotify_printf(
"%s: unknown6:\n",
function );
libcnotify_print_data(
( (scca_file_information_v30_1_t *) data )->unknown6,
84,
LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
}
else if( ( io_handle->format_version == 30 )
Expand All @@ -600,7 +625,7 @@ int libscca_file_information_read_data(
function );
libcnotify_print_data(
( (scca_file_information_v30_2_t *) data )->unknown6,
88,
84,
LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA );
}
}
Expand Down
94 changes: 90 additions & 4 deletions libscca/scca_file_information.h
Expand Up @@ -262,9 +262,95 @@ struct scca_file_information_v26
uint8_t unknown5b[ 4 ];

/* Unknown
* Consists of 88 bytes
* Consists of 84 bytes
*/
uint8_t unknown6[ 88 ];
uint8_t unknown6[ 84 ];
};

typedef struct scca_file_information_v30_1 scca_file_information_v30_1_t;

struct scca_file_information_v30_1
{
/* The offset of the metrics array
* Consists of 4 bytes
*/
uint8_t metrics_array_offset[ 4 ];

/* The number of file metrics array entries
* Consists of 4 bytes
*/
uint8_t number_of_file_metrics_entries[ 4 ];

/* The offset of the trace chain array
* Consists of 4 bytes
*/
uint8_t trace_chain_array_offset[ 4 ];

/* The number of trace chain array entries
* Consists of 4 bytes
*/
uint8_t number_of_trace_chain_array_entries[ 4 ];

/* The filename strings offset
* Consists of 4 bytes
*/
uint8_t filename_strings_offset[ 4 ];

/* The filename strings size
* Consists of 4 bytes
*/
uint8_t filename_strings_size[ 4 ];

/* The volumes information offset
* Consists of 4 bytes
*/
uint8_t volumes_information_offset[ 4 ];

/* The number of volumes
* Consists of 4 bytes
*/
uint8_t number_of_volumes[ 4 ];

/* The volumes information size
* Consists of 4 bytes
*/
uint8_t volumes_information_size[ 4 ];

/* Unknown
* Consists of 8 bytes
*/
uint8_t unknown3c[ 8 ];

/* The last run date and time
* Consists of 64 bytes
* Contains an array of FILETIME
*/
uint8_t last_run_time[ 64 ];

/* Unknown
* Consists of 16 bytes
*/
uint8_t unknown4[ 16 ];

/* The run count
* Consists of 4 bytes
*/
uint8_t run_count[ 4 ];

/* Unknown
* Consists of 4 bytes
*/
uint8_t unknown5a[ 4 ];

/* Unknown
* Consists of 4 bytes
*/
uint8_t unknown5b[ 4 ];

/* Unknown
* Consists of 84 bytes
*/
uint8_t unknown6[ 84 ];
};

typedef struct scca_file_information_v30_2 scca_file_information_v30_2_t;
Expand Down Expand Up @@ -348,9 +434,9 @@ struct scca_file_information_v30_2
uint8_t unknown5b[ 4 ];

/* Unknown
* Consists of 88 bytes
* Consists of 84 bytes
*/
uint8_t unknown6[ 88 ];
uint8_t unknown6[ 84 ];
};

#if defined( __cplusplus )
Expand Down

0 comments on commit 1c853ae

Please sign in to comment.