Portable libraries and utilities that manipulate HFS+ volumes and Apple's DMG images. This fork focuses on hfs extractall.
Перейти к файлу
Ben Hearsum (he/him) c631a40090
Merge pull request #12 from bhearsum/reproducible-tests
fix tests to be reproducible
2024-09-12 11:57:27 -04:00
.github/workflows add GHA workflow for cram tests 2024-09-11 16:01:19 -04:00
common Re-add changes from #4 2023-09-08 15:18:04 -04:00
dmg [attribute] When updating attribution, zero out the anchor/sentinel prior to placing the new value in 2023-09-19 13:05:28 -04:00
docs [attribute] Add `dmg build ... <sentinel>` and `dmg attribute ...`. 2023-09-19 13:05:28 -04:00
hdutil Install the binaries into the ./bin folder (usually `/usr/local/bin`) 2015-03-19 20:07:43 +01:00
hfs [xattr] Write xattr records with correct record lengths. 2023-09-19 13:05:27 -04:00
includes [attribute] Make attribution work when sentinel values cross `runs` 2023-09-19 13:05:28 -04:00
test fix tests to be reproducible 2024-09-11 16:34:16 -04:00
.gitignore [attribute] Add `dmg build ... <sentinel>` and `dmg attribute ...`. 2023-09-19 13:05:28 -04:00
CMakeLists.txt Updated from xpwn branch 2008-11-09 14:39:02 +00:00
LICENSE changed to GPL license 2008-05-16 13:11:30 -07:00
README.markdown fix tests to be reproducible 2024-09-11 16:34:16 -04:00

README.markdown

README

This project was first conceived to manipulate Apple's software restore packages (IPSWs) and hence much of it is geared specifically toward that format. Useful tools to read and manipulate the internal data structures of those files have been created to that end, and with minor changes, more generality can be achieved in the general utility. An inexhaustive list of such changes would be selectively enabling folder counts in HFS+, switching between case sensitivity and non-sensitivity, and more fine-grained control over the layout of created dmgs.

THE CODE HEREIN SHOULD BE CONSIDERED HIGHLY EXPERIMENTAL

Extensive testing have not been done, but comparatively simple tasks like adding and removing files from a mostly contiguous filesystem are well proven.

Please note that these tools and routines are currently only suitable to be accessed by other programs that know what they're doing. I.e., doing something you "shouldn't" be able to do, like removing non-existent files is probably not a very good idea.

LICENSE

This work is released under the terms of the GNU General Public License, version 3. The full text of the license can be found in the LICENSE file.

DEPENDENCIES

The HFS portion will work on any platform that supports GNU C and POSIX conventions. The dmg portion has dependencies on zlib (which is included) and libcrypto from openssl (which is not). If libcrypto is not available, remove the -DHAVE_CRYPT flags from the CFLAGS of the makefiles. All FileVault related actions will fail, but everything else should still work. I imagine most places have libcrypto, and probably statically compiled zlib was a dumb idea too.

USING

The targets of the current repository are three command-line utilities that demonstrate the usage of the library functions (except cmd_grow, which really ought to be moved to catalog.c). To make compilation simpler, a complete, unmodified copy of the zlib distribution is included. The dmg portion of the code has dependencies on the HFS+ portion of the code. The "hdutil" section contains a version of the HFS+ utility that supports directly reading from dmgs. It is separate from the HFS+ utility in order that the hfs directory does not have dependencies on the dmg directory.

The makefile in the root folder will make all utilities.

mkdir build && cd build
cmake ..
make # Or only make hfs / make dmg / ...
sudo make install

HFS+

cd hfs
make

DMG

cd dmg/zlib-1.2.3
./configure
make
cd ..
make

hdutil

cd hdiutil
make

TESTING

  • Configure in 'build': cmake -B build
  • Install cram: pipx install cram
  • Run tests: cram test/*.t