├── createjavadoc.bat ├── .gitignore ├── resview.bat ├── unhfs.bat ├── netbeans ├── HFSExplorer │ ├── .gitignore │ ├── nbproject │ │ ├── .gitignore │ │ ├── genfiles.properties │ │ └── project.xml │ └── manifest.mf └── HFSExplorerNative │ └── nbproject │ ├── project.properties │ ├── .gitignore │ ├── project.xml │ ├── Makefile-variables.mk │ ├── Package-Debug.bash │ └── Package-Release.bash ├── wbuildall.bat ├── src ├── META-INF │ ├── hfs-jfuse_libhfs │ │ └── MANIFEST.MF │ ├── mkapm │ │ └── MANIFEST.MF │ ├── jparted │ │ └── MANIFEST.MF │ └── MANIFEST.MF ├── java │ └── org │ │ └── catacombae │ │ ├── hfs │ │ ├── types │ │ │ ├── carbon │ │ │ │ ├── OSType.struct │ │ │ │ ├── Point.struct │ │ │ │ └── Rect.struct │ │ │ ├── hfs │ │ │ │ ├── ExtDataRec.struct │ │ │ │ ├── ExtDescriptor.struct │ │ │ │ ├── CatDataRec.struct │ │ │ │ ├── HFSVolumeFinderInfo.struct │ │ │ │ ├── ExtKeyRec.struct │ │ │ │ ├── CdrFThdRec.struct │ │ │ │ ├── CatKeyRec.struct │ │ │ │ ├── CdrThdRec.struct │ │ │ │ ├── NodeDescriptor.struct │ │ │ │ ├── BTHdrRec.struct │ │ │ │ ├── CdrDirRec.struct │ │ │ │ ├── MacLegacyEncoding.java │ │ │ │ ├── HFSDateField.java │ │ │ │ ├── BootBlkHdr.struct │ │ │ │ ├── CdrFilRec.struct │ │ │ │ ├── HFSPlusWrapperMDB.struct │ │ │ │ └── MasterDirectoryBlock.struct │ │ │ ├── hfsplus │ │ │ │ ├── HFSUniStr255.struct │ │ │ │ ├── BlockInfo.struct │ │ │ │ ├── HFSPlusExtentRecord.struct │ │ │ │ ├── HFSPlusExtentLeafRecord.struct │ │ │ │ ├── HFSPlusExtentDescriptor.struct │ │ │ │ ├── HFSPlusAttributesForkData.struct │ │ │ │ ├── HFSPlusCatalogKey.struct │ │ │ │ ├── BlockListHeader.struct │ │ │ │ ├── HFSPlusAttributesExtents.struct │ │ │ │ ├── JournalInfoBlock.struct │ │ │ │ ├── HFSPlusBSDInfo.struct │ │ │ │ ├── HFSPlusCatalogThread.struct │ │ │ │ ├── HFSPlusForkData.struct │ │ │ │ ├── HFSPlusExtentKey.struct │ │ │ │ ├── JournalHeader.struct │ │ │ │ ├── HFSPlusAttributesData.struct │ │ │ │ ├── HFSPlusAttributesKey.struct │ │ │ │ ├── HFSPlusCatalogFolder.struct │ │ │ │ ├── HFSPlusCatalogFile.struct │ │ │ │ ├── BTLeafNode.java │ │ │ │ ├── HFSPlusAttributesIndexNode.java │ │ │ │ ├── HFSPlusExtentIndexNode.java │ │ │ │ ├── BTNode.java │ │ │ │ ├── BTKey.java │ │ │ │ ├── BTIndexRecord.java │ │ │ │ ├── HFSPlusCatalogLeafRecordData.java │ │ │ │ └── HFSPlusCatalogIndexNode.java │ │ │ ├── decmpfs │ │ │ │ └── DecmpfsHeader.struct │ │ │ ├── finder │ │ │ │ ├── FolderInfo.struct │ │ │ │ ├── ExtendedFileInfo.struct │ │ │ │ ├── ExtendedFolderInfo.struct │ │ │ │ ├── FileInfo.struct │ │ │ │ ├── DInfo.struct │ │ │ │ ├── FInfo.struct │ │ │ │ ├── FXInfo.struct │ │ │ │ └── DXInfo.struct │ │ │ ├── hfsx │ │ │ │ ├── HFSXKeyCompareType.java │ │ │ │ ├── HFSXCatalogLeafRecord.java │ │ │ │ ├── HFSXCatalogLeafNode.java │ │ │ │ └── HFSXCatalogIndexNode.java │ │ │ └── hfscommon │ │ │ │ ├── CommonHFSForkType.java │ │ │ │ ├── CommonBTLeafRecord.java │ │ │ │ ├── StringComparator.java │ │ │ │ ├── CommonBTKeyedRecord.java │ │ │ │ ├── CommonHFSCatalogThread.java │ │ │ │ ├── CommonBTRecord.java │ │ │ │ ├── CommonHFSCatalogThreadRecord.java │ │ │ │ ├── CommonBTKey.java │ │ │ │ ├── CommonBTKeyedNode.java │ │ │ │ ├── CommonBTGenericDataRecord.java │ │ │ │ └── CommonHFSAttributesIndexNode.java │ │ ├── HotFilesFile.java │ │ ├── VolumeHeader.java │ │ ├── ProgressMonitor.java │ │ ├── HFSInvalidDataException.java │ │ ├── Limits.java │ │ ├── HFSException.java │ │ └── HFSNotEnoughDataException.java │ │ ├── bplist │ │ └── types │ │ │ ├── BinaryPlistHeader.struct │ │ │ └── BinaryPlistFooter.struct │ │ ├── hfsexplorer │ │ ├── types │ │ │ ├── resff │ │ │ │ ├── ResourceName.struct │ │ │ │ ├── ResourceType.struct │ │ │ │ ├── ResourceHeader.struct │ │ │ │ ├── ReferenceListEntry.struct │ │ │ │ └── ResourceMap.struct │ │ │ ├── applesingle │ │ │ │ ├── EntryDescriptor.struct │ │ │ │ ├── AttributeEntry.struct │ │ │ │ ├── AppleSingleHeader.struct │ │ │ │ └── AttributeHeader.struct │ │ │ ├── dsstore │ │ │ │ ├── DSStoreTableOfContents.struct │ │ │ │ ├── DSStoreTableOfContentsEntry.struct │ │ │ │ ├── DSStoreRootBlock.struct │ │ │ │ ├── DSStoreTreeBlock.struct │ │ │ │ └── DSStoreHeader.struct │ │ │ └── alias │ │ │ │ └── AliasHeader.struct │ │ ├── Util.java │ │ ├── GUIUtil.java │ │ ├── SpeedUnitUtils.java │ │ ├── unfinished │ │ │ └── ErrorMessageException.java │ │ ├── BuildNumber.java │ │ ├── testcode │ │ │ ├── TestRegexp.java │ │ │ ├── editgpt │ │ │ │ └── EditGPT.form │ │ │ ├── ParseExtentLeafNode.java │ │ │ ├── PrintGPTHeader.java │ │ │ └── PrintGPTEntry.java │ │ ├── io │ │ │ ├── WritableRandomAccessChannel.java │ │ │ └── RandomAccessChannel.java │ │ ├── gui │ │ │ ├── ChainedPanel.java │ │ │ ├── HFSExplorerJFrame.java │ │ │ └── StructViewPanel.form │ │ ├── fs │ │ │ └── NullProgressMonitor.java │ │ ├── BasicExtractProgressMonitor.java │ │ ├── PrefixFileFilter.java │ │ ├── JarMain.java │ │ ├── SimplerFileFilter.java │ │ ├── tools │ │ │ └── PrintMBRPartitions.java │ │ └── SimpleFileFilter.java │ │ ├── storage │ │ ├── ps │ │ │ ├── gpt │ │ │ │ ├── types │ │ │ │ │ ├── GPTEntry.struct │ │ │ │ │ └── MutableGUID.java │ │ │ │ ├── GPTHandlerFactory.java │ │ │ │ └── GPTRecognizer.java │ │ │ ├── apm │ │ │ │ ├── types │ │ │ │ │ ├── DriverDescriptorEntry.struct │ │ │ │ │ └── DriverDescriptorRecord.struct │ │ │ │ └── APMHandlerFactory.java │ │ │ ├── container │ │ │ │ ├── ContainerHandlerFactory.java │ │ │ │ ├── hfs │ │ │ │ │ └── HFSContainerHandlerFactory.java │ │ │ │ └── ContainerHandler.java │ │ │ ├── PartitionSystemHandlerFactory.java │ │ │ ├── ebr │ │ │ │ ├── EBRRecognizer.java │ │ │ │ ├── EBRPartition.java │ │ │ │ └── EBRHandlerFactory.java │ │ │ ├── mbr │ │ │ │ ├── MBRRecognizer.java │ │ │ │ ├── MBRHandlerFactory.java │ │ │ │ └── types │ │ │ │ │ └── MutableMBRPartition.java │ │ │ ├── PartitionSystemRecognizer.java │ │ │ ├── PartitionSystemHandler.java │ │ │ ├── PartitionSystemImplementationInfo.java │ │ │ ├── Partition.java │ │ │ └── StandardPartition.java │ │ ├── fs │ │ │ ├── FileSystemCapability.java │ │ │ ├── hfs │ │ │ │ └── HFSFileSystemRecognizer.java │ │ │ ├── hfsx │ │ │ │ ├── HFSXFileSystemRecognizer.java │ │ │ │ └── HFSXFileSystemHandler.java │ │ │ ├── FSForkType.java │ │ │ ├── hfsplus │ │ │ │ └── HFSPlusFileSystemRecognizer.java │ │ │ ├── hfscommon │ │ │ │ ├── HFSCommonFSFile.java │ │ │ │ └── HFSCommonFileSystemHandlerFactory.java │ │ │ ├── FileSystemRecognizer.java │ │ │ ├── FSFile.java │ │ │ └── FSLink.java │ │ └── io │ │ │ └── SubDataLocator.java │ │ └── jparted │ │ ├── app │ │ └── Main.java │ │ └── lib │ │ └── AbstractFile.java └── win32 │ ├── launcher │ ├── resource.h │ └── logging.hh │ └── llio │ ├── org_catacombae_storage_io_win32_Win32FileStream.h │ └── llio_common.h ├── wcreatejavadoc.bat ├── doc ├── todo.txt ├── hfsexplorer.nsi ├── dmg_iconsource │ ├── dmg.ico │ ├── finderdrive.ico │ └── finderdrive_folderback.ico ├── version.sdic.txt └── bugs.txt ├── dumpfsdata.bat ├── dist ├── res │ └── icon.png ├── lib │ ├── filedrop.jar │ ├── llio_arm.dll │ ├── csframework.jar │ ├── hfsx_dmglib.jar │ ├── llio_amd64.dll │ ├── llio_arm64.dll │ ├── llio_i386.dll │ ├── llio_ia64.dll │ ├── iharder-base64.jar │ ├── swing-layout-1.0.4.jar │ └── apache-ant-1.7.0-bzip2.jar ├── bin │ ├── hfsexplorer.exe │ ├── hfsx.bat │ ├── unhfs.bat │ ├── resview.bat │ ├── hfsexplorer.bat │ ├── dumpfsdata.bat │ ├── hfsx │ ├── unhfs │ ├── resview │ ├── hfsexplorer_vista.vbs │ └── hfsexplorer └── doc │ └── html │ ├── img │ └── HFSExplorer_logo.png │ ├── index.html │ └── troubleshooting.html ├── resource ├── back.png ├── folder.png ├── info.png ├── extract.png ├── folderup.png ├── forward.png ├── nothing.png ├── emptydocument.png ├── finderdrive_folderback_16.png ├── finderdrive_folderback_32.png └── finderdrive_folderback_48.png ├── hfsexplorer.bat ├── hfsx.bat ├── test.bat ├── .gitmodules ├── dsstoreinfo.bat ├── hfsx ├── unhfs ├── resview ├── createjavadoc ├── hfsexplorer ├── dsstoreinfo ├── runjparted ├── test └── vc6buildlauncher.bat /createjavadoc.bat: -------------------------------------------------------------------------------- 1 | @ant javadoc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.antbuild~/ 2 | /javadoc.~/ -------------------------------------------------------------------------------- /resview.bat: -------------------------------------------------------------------------------- 1 | @"%~dp0dist\bin\resview.bat" %* 2 | -------------------------------------------------------------------------------- /unhfs.bat: -------------------------------------------------------------------------------- 1 | @"%~dp0dist\bin\unhfs.bat" %* 2 | -------------------------------------------------------------------------------- /netbeans/HFSExplorer/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /dist/ 3 | -------------------------------------------------------------------------------- /netbeans/HFSExplorer/nbproject/.gitignore: -------------------------------------------------------------------------------- 1 | /private/ 2 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/.gitignore: -------------------------------------------------------------------------------- 1 | /private/ 2 | -------------------------------------------------------------------------------- /wbuildall.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call buildall.bat 3 | pause 4 | -------------------------------------------------------------------------------- /src/META-INF/hfs-jfuse_libhfs/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Class-Path: csframework.jar 2 | -------------------------------------------------------------------------------- /wcreatejavadoc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call createjavadoc.bat 3 | pause 4 | -------------------------------------------------------------------------------- /doc/todo.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/doc/todo.txt -------------------------------------------------------------------------------- /dumpfsdata.bat: -------------------------------------------------------------------------------- 1 | @call "%~dp0..\dist\bin\dumpfsdata.bat" %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /dist/res/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/res/icon.png -------------------------------------------------------------------------------- /doc/hfsexplorer.nsi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/doc/hfsexplorer.nsi -------------------------------------------------------------------------------- /resource/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/back.png -------------------------------------------------------------------------------- /resource/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/folder.png -------------------------------------------------------------------------------- /resource/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/info.png -------------------------------------------------------------------------------- /dist/lib/filedrop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/filedrop.jar -------------------------------------------------------------------------------- /dist/lib/llio_arm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/llio_arm.dll -------------------------------------------------------------------------------- /resource/extract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/extract.png -------------------------------------------------------------------------------- /resource/folderup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/folderup.png -------------------------------------------------------------------------------- /resource/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/forward.png -------------------------------------------------------------------------------- /resource/nothing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/nothing.png -------------------------------------------------------------------------------- /dist/bin/hfsexplorer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/bin/hfsexplorer.exe -------------------------------------------------------------------------------- /dist/lib/csframework.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/csframework.jar -------------------------------------------------------------------------------- /dist/lib/hfsx_dmglib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/hfsx_dmglib.jar -------------------------------------------------------------------------------- /dist/lib/llio_amd64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/llio_amd64.dll -------------------------------------------------------------------------------- /dist/lib/llio_arm64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/llio_arm64.dll -------------------------------------------------------------------------------- /dist/lib/llio_i386.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/llio_i386.dll -------------------------------------------------------------------------------- /dist/lib/llio_ia64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/llio_ia64.dll -------------------------------------------------------------------------------- /doc/dmg_iconsource/dmg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/doc/dmg_iconsource/dmg.ico -------------------------------------------------------------------------------- /resource/emptydocument.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/emptydocument.png -------------------------------------------------------------------------------- /dist/lib/iharder-base64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/iharder-base64.jar -------------------------------------------------------------------------------- /dist/lib/swing-layout-1.0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/swing-layout-1.0.4.jar -------------------------------------------------------------------------------- /src/META-INF/mkapm/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Main-Class: org.catacombae.hfsexplorer.tools.MkAPM 2 | Class-Path: csframework.jar 3 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/carbon/OSType.struct: -------------------------------------------------------------------------------- 1 | struct OSType { 2 | Char osType[4]; 3 | }; 4 | -------------------------------------------------------------------------------- /dist/bin/hfsx.bat: -------------------------------------------------------------------------------- 1 | @java -cp "%~dp0..\lib\hfsx.jar" org.catacombae.hfsexplorer.HFSExplorer %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /doc/dmg_iconsource/finderdrive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/doc/dmg_iconsource/finderdrive.ico -------------------------------------------------------------------------------- /dist/lib/apache-ant-1.7.0-bzip2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/lib/apache-ant-1.7.0-bzip2.jar -------------------------------------------------------------------------------- /hfsexplorer.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call "%~dp0dist\bin\hfsexplorer.bat" %1 %2 %3 %4 %5 %6 %7 %8 %9 4 | endlocal 5 | -------------------------------------------------------------------------------- /netbeans/HFSExplorer/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /dist/doc/html/img/HFSExplorer_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/dist/doc/html/img/HFSExplorer_logo.png -------------------------------------------------------------------------------- /resource/finderdrive_folderback_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/finderdrive_folderback_16.png -------------------------------------------------------------------------------- /resource/finderdrive_folderback_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/finderdrive_folderback_32.png -------------------------------------------------------------------------------- /resource/finderdrive_folderback_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/resource/finderdrive_folderback_48.png -------------------------------------------------------------------------------- /hfsx.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | pushd "%~dp0\dist\bin" 4 | call hfsx.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 5 | popd 6 | endlocal 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/carbon/Point.struct: -------------------------------------------------------------------------------- 1 | struct Point { 2 | SInt16 v; 3 | SInt16 h; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/ExtDataRec.struct: -------------------------------------------------------------------------------- 1 | struct ExtDataRec { 2 | ExtDescriptor extDataRec[3]; extent data record 3 | }; 4 | -------------------------------------------------------------------------------- /doc/dmg_iconsource/finderdrive_folderback.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unsound/hfsexplorer/HEAD/doc/dmg_iconsource/finderdrive_folderback.ico -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSUniStr255.struct: -------------------------------------------------------------------------------- 1 | struct HFSUniStr255 { 2 | UInt16 length; 3 | UniChar unicode[255]; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/bplist/types/BinaryPlistHeader.struct: -------------------------------------------------------------------------------- 1 | struct BinaryPlistHeader { 2 | char signature[6]; 3 | char version[2]; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/resff/ResourceName.struct: -------------------------------------------------------------------------------- 1 | struct ResourceName { 2 | UInt8 nameLength; 3 | Char name[2]; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BlockInfo.struct: -------------------------------------------------------------------------------- 1 | struct BlockInfo { 2 | UInt64 bnum; 3 | UInt32 bsize; 4 | UInt32 next; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusExtentRecord.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusExtentRecord { 2 | HFSPlusExtentDescriptor extentDescriptors[8]; 3 | }; 4 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/decmpfs/DecmpfsHeader.struct: -------------------------------------------------------------------------------- 1 | struct DecmpfsHeader { 2 | le32 magic; 3 | le32 compressionType; 4 | le64 fileSize; 5 | }; -------------------------------------------------------------------------------- /src/META-INF/jparted/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Main-Class: org.catacombae.jparted.Main 2 | Class-Path: csframework.jar apache-ant-1.7.0-bzip2.jar iharder-base64.jar swing-layout-1.0.4.jar 3 | -------------------------------------------------------------------------------- /test.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | PATH=%PATH%;%~dp0dist\lib 4 | java -cp "%~dp0dist\lib\hfsx.jar" org.catacombae.hfsexplorer.%1 %2 %3 %4 %5 %6 %7 %8 %9 5 | endlocal 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusExtentLeafRecord.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusExtentLeafRecord { 2 | HFSPlusExtentKey key; 3 | HFSPlusExtentRecord recordData; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/applesingle/EntryDescriptor.struct: -------------------------------------------------------------------------------- 1 | struct EntryDescriptor { 2 | UInt32 entryId; 3 | UInt32 entryOffset; 4 | UInt32 entryLength; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/ExtDescriptor.struct: -------------------------------------------------------------------------------- 1 | struct ExtDescriptor { 2 | UInt16 xdrStABN; first allocation block 3 | UInt16 xdrNumABlks; number of allocation blocks 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/dsstore/DSStoreTableOfContents.struct: -------------------------------------------------------------------------------- 1 | struct DSStoreTableOfContents { 2 | be32 tocCount; 3 | DSStoreTableOfContentsEntry tocEntries[1]; 4 | }; 5 | -------------------------------------------------------------------------------- /src/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Main-Class: org.catacombae.hfsexplorer.JarMain 2 | Class-Path: csframework.jar hfsx_dmglib.jar apache-ant-1.7.0-bzip2.jar filedrop.jar iharder-base64.jar swing-layout-1.0.4.jar 3 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/carbon/Rect.struct: -------------------------------------------------------------------------------- 1 | struct Rect { 2 | SInt16 top; 3 | SInt16 left; 4 | SInt16 bottom; 5 | SInt16 right; 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/FolderInfo.struct: -------------------------------------------------------------------------------- 1 | struct FolderInfo { 2 | Rect windowBounds; 3 | UInt16 finderFlags; 4 | Point location; 5 | UInt16 reservedField; 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusExtentDescriptor.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusExtentDescriptor { 2 | UInt32 startBlock; 3 | UInt32 blockCount; 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CatDataRec.struct: -------------------------------------------------------------------------------- 1 | struct CatDataRec { 2 | SInt8 cdrType; record type (SignedByte) 3 | SInt8 cdrResrv2; reserved (SignedByte) 4 | }; 5 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusAttributesForkData.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusAttributesForkData { 2 | UInt32 recordType; 3 | UInt32 reserved; 4 | HFSPlusForkData theFork; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogKey.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusCatalogKey { 2 | UInt16 keyLength; 3 | HFSCatalogNodeID parentID; 4 | HFSUniStr255 nodeName; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/applesingle/AttributeEntry.struct: -------------------------------------------------------------------------------- 1 | struct AttributeEntry { 2 | ube32 offset; 3 | ube32 length; 4 | be16 flags; 5 | u8 nameLength; 6 | char name[1]; 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/ExtendedFileInfo.struct: -------------------------------------------------------------------------------- 1 | struct ExtendedFileInfo { 2 | SInt16 reserved1[4]; 3 | UInt16 extendedFinderFlags; 4 | SInt16 reserved2; 5 | SInt32 putAwayFolderID; 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/dsstore/DSStoreTableOfContentsEntry.struct: -------------------------------------------------------------------------------- 1 | struct DSStoreTableOfContentsEntry { 2 | u8 tocNameLength; 3 | char tocName[255]; 4 | be32 tocValue; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BlockListHeader.struct: -------------------------------------------------------------------------------- 1 | struct BlockListHeader { 2 | UInt16 maxBlocks; 3 | UInt16 numBlocks; 4 | UInt32 bytesUsed; 5 | UInt32 checksum; 6 | UInt32 pad; 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/applesingle/AppleSingleHeader.struct: -------------------------------------------------------------------------------- 1 | struct AppleSingleHeader { 2 | UInt32 magicNumber; 3 | UInt32 versionNumber; 4 | Char homeFileSystem[16]; 5 | UInt16 numEntries; 6 | }; 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/catacombaeframework"] 2 | path = external/catacombaeframework 3 | url = ../catacombaeframework.git 4 | [submodule "external/dmgextractor"] 5 | path = external/dmgextractor 6 | url = ../dmgextractor.git 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusAttributesExtents.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusAttributesExtents { 2 | UInt32 recordType; 3 | UInt32 reserved; 4 | HFSPlusExtentRecord extents; 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/JournalInfoBlock.struct: -------------------------------------------------------------------------------- 1 | struct JournalInfoBlock { 2 | UInt32 flags; 3 | UInt32 deviceSignature[8]; 4 | UInt64 offset; 5 | UInt64 size; 6 | UInt32 reserved[32]; 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusBSDInfo.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusBSDInfo { 2 | UInt32 ownerID; 3 | UInt32 groupID; 4 | UInt8 adminFlags; 5 | UInt8 ownerFlags; 6 | UInt16 fileMode; 7 | UInt32 special; 8 | }; 9 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogThread.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusCatalogThread { 2 | SInt16 recordType; 3 | SInt16 reserved; 4 | HFSCatalogNodeID parentID; 5 | HFSUniStr255 nodeName; 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/dsstore/DSStoreRootBlock.struct: -------------------------------------------------------------------------------- 1 | struct DSStoreRootBlock { 2 | be32 unknown; 3 | be32 numOffsets; 4 | be32 unknown2; // Zeroed in all known cases. 5 | be32 offsetList[1]; 6 | }; 7 | -------------------------------------------------------------------------------- /dist/bin/unhfs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | REM ** The local extension of the PATH environment variable is neccessary for java to find llio_*.dll 4 | PATH=%PATH%;%~dp0..\lib 5 | java -cp "%~dp0..\lib\hfsx.jar" org.catacombae.hfsexplorer.tools.UnHFS %* 6 | endlocal 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusForkData.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusForkData { 2 | UInt64 logicalSize; 3 | UInt32 clumpSize; 4 | UInt32 totalBlocks; 5 | HFSPlusExtentRecord extents; 6 | }; 7 | -------------------------------------------------------------------------------- /dsstoreinfo.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | REM ** The local extension of the PATH environment variable is neccessary for java to find llio_*.dll 4 | PATH=%PATH%;%~dp0dist\lib 5 | java -cp "%~dp0dist\lib\hfsx.jar" org.catacombae.hfsexplorer.tools.DSStoreInfo %* 6 | endlocal 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/gpt/types/GPTEntry.struct: -------------------------------------------------------------------------------- 1 | struct GPTEntry { 2 | byte[16] partitionTypeGUID; 3 | byte[16] uniquePartitionGUID; 4 | UInt64 startingLBA; 5 | UInt64 endingLBA; 6 | UInt64 attributeBits; 7 | byte[72] partitionName; 8 | }; 9 | -------------------------------------------------------------------------------- /dist/bin/resview.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | REM ** The local extension of the PATH environment variable is neccessary for java to find llio_*.dll 4 | PATH=%PATH%;%~dp0..\lib 5 | java -cp "%~dp0..\lib\hfsx.jar" org.catacombae.hfsexplorer.tools.ResourceViewer %* 6 | endlocal 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusExtentKey.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusExtentKey { 2 | UInt16 keyLength; 3 | UInt8 forkType; 4 | UInt8 pad; 5 | HFSCatalogNodeID fileID; 6 | UInt32 startBlock; 7 | }; 8 | -------------------------------------------------------------------------------- /hfsx: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | "${BASEDIR}/dist/bin/hfsx" "$@" 11 | -------------------------------------------------------------------------------- /unhfs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | "${BASEDIR}/dist/bin/unhfs" "$@" 11 | -------------------------------------------------------------------------------- /resview: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | "${BASEDIR}/dist/bin/resview" "$@" 11 | -------------------------------------------------------------------------------- /src/java/org/catacombae/bplist/types/BinaryPlistFooter.struct: -------------------------------------------------------------------------------- 1 | struct BinaryPlistFooter { 2 | u8 reserved[5]; 3 | u8 sortVersion; 4 | u8 offsetTableOffsetSize; 5 | u8 objectRefSize; 6 | be64 numObjects; 7 | be64 topObjectOffset; 8 | be64 offsetTableStart; 9 | }; 10 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/ExtendedFolderInfo.struct: -------------------------------------------------------------------------------- 1 | struct ExtendedFolderInfo { 2 | Point scrollPosition; // Scroll position (for icon views) 3 | SInt32 reserved1; 4 | UInt16 extendedFinderFlags; 5 | SInt16 reserved2; 6 | SInt32 putAwayFolderID; 7 | }; 8 | -------------------------------------------------------------------------------- /createjavadoc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | cd "${BASEDIR}" 11 | 12 | ant javadoc 13 | -------------------------------------------------------------------------------- /hfsexplorer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | "${BASEDIR}/dist/bin/hfsexplorer" "$@" 11 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/dsstore/DSStoreTreeBlock.struct: -------------------------------------------------------------------------------- 1 | struct DSStoreTreeBlock { 2 | be32 firstDataBlockID; 3 | be32 recordsInTree; 4 | be32 levelsOfInternalBlocks; 5 | be32 totalTreeBlocks; 6 | be32 unknownAlways0x1000; 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/apm/types/DriverDescriptorEntry.struct: -------------------------------------------------------------------------------- 1 | struct DriverDescriptorEntry { 2 | UInt32 ddBlock; // {first driver's starting block} 3 | UInt16 ddSize; // {size of the driver, in 512-byte blocks} 4 | UInt16 ddType; // {operating system type (MacOS = 1)} 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/applesingle/AttributeHeader.struct: -------------------------------------------------------------------------------- 1 | struct AttributeHeader { 2 | be32 magic; 3 | be32 debugTag; 4 | ube32 totalEnd; 5 | ube32 dataStart; 6 | ube32 dataLength; 7 | char reserved[12]; 8 | be16 flags; 9 | ube16 numAttrs; 10 | }; 11 | -------------------------------------------------------------------------------- /dist/bin/hfsexplorer.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | REM ** The local extension of the PATH environment variable is neccessary for java to find llio_*.dll 4 | PATH=%PATH%;%~dp0..\lib 5 | java -cp "%~dp0..\lib\hfsx.jar" org.catacombae.hfsexplorer.FileSystemBrowserWindow %1 %2 %3 %4 %5 %6 %7 %8 %9 6 | endlocal 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/JournalHeader.struct: -------------------------------------------------------------------------------- 1 | struct JournalHeader { 2 | UInt32 magic; 3 | UInt32 endian; 4 | UInt64 start; 5 | UInt64 end; 6 | UInt64 size; 7 | UInt32 blhdrSize; 8 | UInt32 checksum; 9 | UInt32 jhdrSize; 10 | }; 11 | -------------------------------------------------------------------------------- /dist/bin/dumpfsdata.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | REM ** The local extension of the PATH environment variable is neccessary for java to find llio_*.dll 4 | PATH=%PATH%;%~dp0..\lib 5 | java -cp "%~dp0..\lib\hfsx.jar" org.catacombae.hfsexplorer.tools.DumpFSInfo %1 %2 %3 %4 %5 %6 %7 %8 %9 6 | endlocal 7 | pause 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/FileInfo.struct: -------------------------------------------------------------------------------- 1 | struct FileInfo { 2 | OSType fileType; // The type of the file 3 | OSType fileCreator; // The file's creator 4 | UInt16 finderFlags; 5 | Point location; // File's location in the folder. 6 | UInt16 reservedField; 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusAttributesData.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusAttributesData { 2 | UInt32 recordType; /* == kHFSPlusAttrInlineData */ 3 | UInt32 reserved[2]; 4 | UInt32 attrSize; /* size of attribute data in bytes */ 5 | UInt8 attrData[2]; /* variable length */ 6 | }; 7 | -------------------------------------------------------------------------------- /dist/bin/hfsx: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | java -cp "${BASEDIR}/../lib/hfsx.jar" org.catacombae.hfsexplorer.HFSExplorer "$@" 11 | -------------------------------------------------------------------------------- /dist/bin/unhfs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | java -cp "${BASEDIR}/../lib/hfsx.jar" org.catacombae.hfsexplorer.tools.UnHFS "$@" 11 | -------------------------------------------------------------------------------- /dsstoreinfo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | java -cp "${BASEDIR}/dist/lib/hfsx.jar" org.catacombae.hfsexplorer.tools.DSStoreInfo "$@" 11 | -------------------------------------------------------------------------------- /dist/bin/resview: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | java -cp "${BASEDIR}/../lib/hfsx.jar" org.catacombae.hfsexplorer.tools.ResourceViewer "$@" 11 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/HFSVolumeFinderInfo.struct: -------------------------------------------------------------------------------- 1 | struct HFSVolumeFinderInfo { 2 | be32 blessedSystemFolder; 3 | be32 startupApplicationParentFolder; 4 | be32 openFolderList; 5 | be32 alternateMacOSBlessedSystemFolder; 6 | be32 reserved; 7 | be32 alternateMacOSXBlessedSystemFolder; 8 | be64 volumeUUID; 9 | }; 10 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/ExtKeyRec.struct: -------------------------------------------------------------------------------- 1 | struct ExtKeyRec { 2 | SInt8 xkrKeyLen; key length (SignedByte) 3 | SInt8 xkrFkType; fork type (SignedByte) 4 | SInt32 xkrFNum; file number (LongInt) 5 | SInt16 xkrFABN; starting file allocation block (Integer) 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/resff/ResourceType.struct: -------------------------------------------------------------------------------- 1 | struct ResourceType { 2 | Char type[4]; // Resource type. 3 | UInt16 instanceCount; // Number of resources of this type in map minus 1. 4 | UInt16 referenceListOffset; // Offset from beginning of resource type list to reference list for this type. 5 | }; 6 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/dsstore/DSStoreHeader.struct: -------------------------------------------------------------------------------- 1 | struct DSStoreHeader { 2 | be32 alignment; 3 | u8 signature[4]; // Must be 'Bud1' in ASCII. 4 | be32 rootBlockOffset1; // Must be equal to rootBlockOffset2. 5 | be32 rootBlockSize; 6 | be32 rootBlockOffset2; // Must be equal to rootBlockOffset1. 7 | u8 unknown[16]; 8 | }; 9 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CdrFThdRec.struct: -------------------------------------------------------------------------------- 1 | struct CdrFThdRec { 2 | SInt8 cdrType; record type (SignedByte) 3 | SInt8 cdrResrv2; reserved (SignedByte) 4 | SInt32 fthdResrv[2]; reserved (ARRAY[1..2] OF LongInt) 5 | SInt32 fthdParID; parent ID for this file (LongInt) 6 | Char fthdCName[32]; name of this file (Str31) 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CatKeyRec.struct: -------------------------------------------------------------------------------- 1 | struct CatKeyRec { 2 | SInt8 ckrKeyLen; key length (SignedByte) 3 | SInt8 ckrResrv1; reserved (SignedByte) 4 | SInt32 ckrParID; parent directory ID (LongInt) 5 | UInt8 ckrCNameLen length of catalog node name (part of Str31) 6 | Char ckrCName[31]; catalog node name (part of Str31) 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CdrThdRec.struct: -------------------------------------------------------------------------------- 1 | struct CdrThdRec { 2 | SInt8 cdrType; record type (SignedByte) 3 | SInt8 cdrResrv2; reserved (SignedByte) 4 | SInt32 thdResrv[2]; reserved (ARRAY[1..2] OF LongInt) 5 | SInt32 thdParID; parent ID for this directory (LongInt) 6 | Char thdCName[32]; name of this directory (Str31) 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/resff/ResourceHeader.struct: -------------------------------------------------------------------------------- 1 | struct ResourceHeader { 2 | UInt32 dataOffset; // Offset from the beginning of the resource fork to the beginning of the resource data. 3 | UInt32 mapOffset; // Offset from the beginning of the resource fork to the beginning of the resource map. 4 | UInt32 dataLength; // Length of resource data. 5 | UInt32 mapLength; // Length of resource map. 6 | }; 7 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/NodeDescriptor.struct: -------------------------------------------------------------------------------- 1 | struct NodeDescriptor { 2 | SInt32 ndFLink; forward link (LongInt) 3 | SInt32 ndBLink; backward link (LongInt) 4 | SInt8 ndType; node type (SignedByte) 5 | SInt8 ndNHeight; node level (SignedByte) 6 | SInt16 ndNRecs; number of records in node (Integer) 7 | SInt16 ndResv2; reserved (Integer) 8 | }; 9 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusAttributesKey.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusAttributeKey { 2 | UInt16 keyLength; /* key length (in bytes) */ 3 | UInt16 pad; /* set to zero */ 4 | UInt32 fileID; /* file associated with attribute */ 5 | UInt32 startBlock; /* first allocation block number for extents */ 6 | UInt16 attrNameLen; /* number of unicode characters */ 7 | UInt16 attrName[127]; /* attribute name (Unicode) */ 8 | }; 9 | -------------------------------------------------------------------------------- /doc/version.sdic.txt: -------------------------------------------------------------------------------- 1 | !SimpleDictionary: 1.0 2 | AppName: HFSExplorer 3 | Version: 2021.10.9 4 | Build: 2021100900 5 | Date: 2021-10-09 6 | Installer: http://downloads.sourceforge.net/catacombae/hfsexplorer-2021.10.9-setup.exe?use_mirror= 7 | Binary: http://downloads.sourceforge.net/catacombae/hfsexplorer-2021.10.9-bin.zip?use_mirror= 8 | Source: http://downloads.sourceforge.net/catacombae/hfsexplorer-2021.10.9-src.zip?use_mirror= 9 | Changelog: http://www.catacombae.org/hfsexplorer/changelog.txt 10 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/DInfo.struct: -------------------------------------------------------------------------------- 1 | struct DInfo { 2 | Rect frRect; The rectangle for the window that the Finder displays when the user opens the folder. 3 | UInt16 frFlags; Reserved. 4 | Point frLocation; Location of the folder in the parent window. 5 | SInt16 frView; The manner in which folders are displayed; this is set by the user with commands from the View menu of the Finder. 6 | }; 7 | -------------------------------------------------------------------------------- /runjparted: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | LIB="${BASEDIR}/dist/lib" 11 | 12 | java -cp "${BASEDIR}/targets/jparted/lib/jparted.jar":"${LIB}/hfsx_dmglib.jar":"${LIB}/swing-layout-1.0.4.jar":"${LIB}/apache-ant-1.7.0-bzip2.jar":"${LIB}/iharder-base64.jar":"${LIB}/catacombae_io.jar" org.catacombae.jparted.app.Main "$@" 13 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/resff/ReferenceListEntry.struct: -------------------------------------------------------------------------------- 1 | struct ReferenceListEntry { 2 | UInt16 resourceID; // Resource ID 3 | UInt16 resourceNameOffset; // Offset from beginning of resource name list to resource name 4 | UInt8 resourceAttributes; // Resource attributes 5 | UInt8 resourceDataOffset[3]; // Offset from beginning of resource data to data for this resource. 6 | UInt32 reserved1; // Reserved for handle to resource. 7 | }; 8 | -------------------------------------------------------------------------------- /netbeans/HFSExplorer/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=9e78c37f 2 | build.xml.script.CRC32=19fcce8b 3 | build.xml.stylesheet.CRC32=958a1d3e@1.26.2.45 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=9e78c37f 7 | nbproject/build-impl.xml.script.CRC32=13e1674e 8 | nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.2.45 9 | -------------------------------------------------------------------------------- /dist/bin/hfsexplorer_vista.vbs: -------------------------------------------------------------------------------- 1 | ' finding documentation about this scripting language and its host was NOT EASY. 2 | ' Took me too much time. Time that I should have spent on studying scientific computing. 3 | ' Anyway, this script invokes the UAC-dialog and gives administrator priviligies to the 4 | ' FileSystemBrowser 5 | 6 | Set objShell = CreateObject("Shell.Application") 7 | Set objFolder = objShell.Namespace(WScript.ScriptFullName & "\..") 8 | Set objFolderItem = objFolder.ParseName("hfsexplorer.bat") 9 | objFolderItem.InvokeVerb "runas" 10 | -------------------------------------------------------------------------------- /src/win32/launcher/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by launcher.rc 4 | // 5 | #define IDI_ICON1 103 6 | #define IDI_ICON2 104 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 105 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/FInfo.struct: -------------------------------------------------------------------------------- 1 | struct FInfo { 2 | OSType fdType; File type. 3 | OSType fdCreator; The signature of the application that created the file. 4 | UInt16 fdFlags; Finder flags. See "Finder Flags." 5 | Point fdLocation; The location--specified in coordinates local to the window--of the file's icon within its window. 6 | SInt16 fdFldr; The window in which the file's icon appears; this information is meaningful only to the Finder. 7 | }; 8 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogFolder.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusCatalogFolder { 2 | SInt16 recordType; 3 | UInt16 flags; 4 | UInt32 valence; 5 | HFSCatalogNodeID folderID; 6 | UInt32 createDate; 7 | UInt32 contentModDate; 8 | UInt32 attributeModDate; 9 | UInt32 accessDate; 10 | UInt32 backupDate; 11 | HFSPlusBSDInfo permissions; 12 | FolderInfo userInfo; 13 | ExtendedFolderInfo finderInfo; 14 | UInt32 textEncoding; 15 | UInt32 reserved; 16 | }; 17 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | CLASSPATH="${BASEDIR}/dist/lib/hfsx.jar":"${BASEDIR}/dist/lib/swing-layout-1.0.4.jar":"${BASEDIR}/dist/lib/hfsx_dmglib.jar":"${BASEDIR}/dist/lib/apache-ant-1.7.0-bzip2.jar":"${BASEDIR}/dist/lib/filedrop.jar":"${BASEDIR}/dist/lib/iharder-base64.jar":"${BASEDIR}/dist/lib/catacombae_io.jar" 11 | java -cp "${CLASSPATH}" org.catacombae.hfsexplorer.$1 ${2:+"${2}"} ${3:+"$3"} ${4:+"$4"} ${5:+"$5"} ${6:+"$6"} ${7:+"$7"} ${8:+"$8"} ${9:+"$9"} 12 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/apm/types/DriverDescriptorRecord.struct: -------------------------------------------------------------------------------- 1 | struct DriverDescriptorRecord { 2 | be16 sbSig; // Device signature. 3 | be16 sbBlkSize; // Block size of the device. 4 | be32 sbBlkCount; // Number of blocks on the device. 5 | be16 sbDevType; // Reserved. 6 | be16 sbDevId; // Reserved. 7 | be32 dbData; // Reserved. 8 | be16 sbDrvrCount; // Number of driver descriptor entries. 9 | DriverDescriptorEntry entries[1]; // Drivers, if any. 10 | u8 ddPad[1]; // Reserved. 11 | }; 12 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | org.netbeans.modules.cnd.makeproject 3 | 4 | 5 | HFSExplorerNative 6 | 0 7 | c 8 | cpp 9 | h,hh 10 | UTF-8 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogFile.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusCatalogFile { 2 | SInt16 recordType; 3 | UInt16 flags; 4 | UInt32 reserved1; 5 | HFSCatalogNodeID fileID; 6 | UInt32 createDate; 7 | UInt32 contentModDate; 8 | UInt32 attributeModDate; 9 | UInt32 accessDate; 10 | UInt32 backupDate; 11 | HFSPlusBSDInfo permissions; 12 | FileInfo userInfo; 13 | ExtendedFileInfo finderInfo; 14 | UInt32 textEncoding; 15 | UInt32 reserved2; 16 | HFSPlusForkData dataFork; 17 | HFSPlusForkData resourceFork; 18 | }; 19 | -------------------------------------------------------------------------------- /dist/bin/hfsexplorer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR="`dirname "$0"`" 4 | if [ $? -ne 0 ]; then 5 | echo "WARNING: No dirname utility found!" 6 | echo " Script will only work if invoked from its parent directory." 7 | BASEDIR="." 8 | fi 9 | 10 | LIB="${BASEDIR}/../lib" 11 | 12 | UNAME=`uname` 13 | case "${UNAME}" in 14 | Darwin*) 15 | DOCK_NAME="-Xdock:name=HFSExplorer" 16 | DOCK_ICON="-Xdock:icon=${BASEDIR}/../res/icon.png" 17 | ;; 18 | mingw*|MINGW*|MSYS*) 19 | # Our library dir must be in the PATH in Windows so that llio dlls can be 20 | # located. 21 | export PATH="${PATH}:${LIB}" 22 | ;; 23 | esac 24 | 25 | java ${DOCK_NAME:+"${DOCK_NAME}"} ${DOCK_ICON:+"${DOCK_ICON}"} -cp "$LIB/hfsx.jar" org.catacombae.hfsexplorer.FileSystemBrowserWindow "$@" 26 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/resff/ResourceMap.struct: -------------------------------------------------------------------------------- 1 | struct ResourceMap { 2 | UInt8 reserved1[16]; // Reserved for copy of resource header. 3 | UInt32 reserved2; // Reserved for handle to next resource map. 4 | UInt16 reserved3; // Reserved for file reference number. 5 | UInt16 resourceForkAttributes; // Resource fork attributes 6 | UInt16 typeListOffset; // Offset from beginning of map to resource type list. 7 | UInt16 nameListOffset; // Offset from beginning of map to resource name list. 8 | SInt16 typeCount; // Number of types in the map minus 1. 9 | ResourceType resourceTypeList[2]; // Resource type list. 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /dist/doc/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index page 6 | 7 | 8 | 9 |

HFSExplorer logo

10 |

These help pages are provided as guidance to using the application, but they are far from complete. If you have anything to add, don't hesitate to email me and contribute to the user friendliness of HFSExplorer.
11 | The following topics are available:

12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/BTHdrRec.struct: -------------------------------------------------------------------------------- 1 | struct BTHdrRec { 2 | SInt16 bthDepth; current depth of tree (Integer) 3 | SInt32 bthRoot; number of root node (LongInt) 4 | SInt32 bthNRecs; number of leaf records in tree (LongInt) 5 | SInt32 bthFNode; number of first leaf node (LongInt) 6 | SInt32 bthLNode; number of last leaf node (LongInt) 7 | SInt16 bthNodeSize; size of a node (Integer) 8 | SInt16 bthKeyLen; maximum length of a key (Integer) 9 | SInt32 bthNNodes; total number of nodes in tree (LongInt) 10 | SInt32 bthFree; number of free nodes (LongInt) 11 | SInt8 bthResv[76]; reserved (ARRAY[1..76] OF SignedByte) 12 | }; 13 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/FXInfo.struct: -------------------------------------------------------------------------------- 1 | struct FXInfo { 2 | SInt16 fdIconID; An ID number for the file's icon; the numbers that identify icons are assigned by the Finder. 3 | SInt16 fdReserved[3]; Reserved. 4 | SInt8 fdScript; Extended flags. Script code if high-bit is set. 5 | SInt8 fdXFlags; Extended flags. 6 | SInt16 fdComment; Reserved (set to 0). If the high-bit is clear, an ID number for the comment that is displayed in the information window when the user selects a file and chooses the Get Info command from the File menu. The numbers that identify comments are assigned by the Finder. 7 | SInt32 fdPutAway; If the user moves the file onto the desktop, the directory ID of the folder from which the user moves the file. 8 | }; 9 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CdrDirRec.struct: -------------------------------------------------------------------------------- 1 | struct CdrDirRec { 2 | SInt8 cdrType; record type (SignedByte) 3 | SInt8 cdrResrv2; reserved (SignedByte) 4 | SInt16 dirFlags; directory flags (Integer) 5 | SInt16 dirVal; directory valence (Integer) 6 | SInt32 dirDirID; directory ID (LongInt) 7 | SInt32 dirCrDat; date and time of creation (LongInt) 8 | SInt32 dirMdDat; date and time of last modification (LongInt) 9 | SInt32 dirBkDat; date and time of last backup (LongInt) 10 | DInfo dirUsrInfo; Finder information (DInfo) 11 | DXInfo dirFndrInfo; additional Finder information (DXInfo) 12 | SInt32 dirResrv[4]; reserved (ARRAY[1..4] OF LongInt) 13 | }; 14 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/HotFilesFile.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2009 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class HotFilesFile { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/Util.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class Util extends org.catacombae.util.Util { 24 | } 25 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsx/HFSXKeyCompareType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsx; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public enum HFSXKeyCompareType { 24 | CASE_FOLDING, BINARY_COMPARE; 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonHFSForkType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public enum CommonHFSForkType { 24 | DATA_FORK, RESOURCE_FORK; 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/types/alias/AliasHeader.struct: -------------------------------------------------------------------------------- 1 | struct AliasHeader { 2 | char userType[4]; 3 | be16 aliasSize; 4 | be16 version; 5 | be16 flags; 6 | u8 volumeNameLength; 7 | char volumeName[27]; 8 | be32 volumeCreateTimestamp; 9 | char volumeFsType[2]; // 'H+' for HFS+, 'BD' (Big Disk) for HFS and also later for any other filesystems, 'RW' for MFS. 10 | be16 driveType; // 0 = HD (fixed), 1 = Network, 2 = 400k FD, 3 = 800k FD, 4 = 1.44M FD, 5 = Other ejectable media 11 | be32 parentID; // Parent directory ID of target item. 12 | u8 fileNameLength; 13 | char fileName[63]; 14 | be32 fileID; 15 | be32 fileCreateTimestamp; 16 | char fileType[4]; 17 | char fileCreator[4]; 18 | be16 nextLevelUpFromAlias; 19 | be16 nextLevelDownToTarget; 20 | be32 volumeAttributes; 21 | be16 fileSystemID; 22 | u8 reserved[10]; 23 | }; 24 | -------------------------------------------------------------------------------- /src/win32/llio/org_catacombae_storage_io_win32_Win32FileStream.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_catacombae_storage_io_win32_Win32FileStream */ 4 | 5 | #ifndef _Included_org_catacombae_storage_io_win32_Win32FileStream 6 | #define _Included_org_catacombae_storage_io_win32_Win32FileStream 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_catacombae_storage_io_win32_Win32FileStream 12 | * Method: openNative 13 | * Signature: (Ljava/lang/String;)[B 14 | */ 15 | JNIEXPORT jbyteArray JNICALL Java_org_catacombae_storage_io_win32_Win32FileStream_openNative 16 | (JNIEnv *, jclass, jstring); 17 | 18 | /* 19 | * Class: org_catacombae_storage_io_win32_Win32FileStream 20 | * Method: write 21 | * Signature: ([BII[B)V 22 | */ 23 | JNIEXPORT void JNICALL Java_org_catacombae_storage_io_win32_Win32FileStream_write 24 | (JNIEnv *, jclass, jbyteArray, jint, jint, jbyteArray); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/MacLegacyEncoding.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfs; 19 | 20 | /** 21 | * Very sketchy and unfinished. 22 | * 23 | * @author Erik Larsson 24 | */ 25 | public enum MacLegacyEncoding { 26 | ROMAN, ARABIC; 27 | } 28 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | CND_BUILDDIR=build 8 | CND_DISTDIR=dist 9 | # Debug configuration 10 | CND_PLATFORM_Debug=MinGW-Windows 11 | CND_ARTIFACT_DIR_Debug=dist/Debug/MinGW-Windows 12 | CND_ARTIFACT_NAME_Debug=libHFSExplorerNative.dll 13 | CND_ARTIFACT_PATH_Debug=dist/Debug/MinGW-Windows/libHFSExplorerNative.dll 14 | CND_PACKAGE_DIR_Debug=dist/Debug/MinGW-Windows/package 15 | CND_PACKAGE_NAME_Debug=libHFSExplorerNative.dll.tar 16 | CND_PACKAGE_PATH_Debug=dist/Debug/MinGW-Windows/package/libHFSExplorerNative.dll.tar 17 | # Release configuration 18 | CND_PLATFORM_Release=MinGW-Windows 19 | CND_ARTIFACT_DIR_Release=dist/Release/MinGW-Windows 20 | CND_ARTIFACT_NAME_Release=libHFSExplorerNative.dll 21 | CND_ARTIFACT_PATH_Release=dist/Release/MinGW-Windows/libHFSExplorerNative.dll 22 | CND_PACKAGE_DIR_Release=dist/Release/MinGW-Windows/package 23 | CND_PACKAGE_NAME_Release=libHFSExplorerNative.dll.tar 24 | CND_PACKAGE_PATH_Release=dist/Release/MinGW-Windows/package/libHFSExplorerNative.dll.tar 25 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTLeafRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public abstract class CommonBTLeafRecord > 24 | extends CommonBTKeyedRecord 25 | { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/StringComparator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public interface StringComparator { 24 | public int compare(byte[] a, int aoff, int alen, byte[] b, int boff, int blen); 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/finder/DXInfo.struct: -------------------------------------------------------------------------------- 1 | struct DXInfo { 2 | Point frScroll; Scroll position within the Finder window. The Finder does not necessarily save this position immediately upon user action. 3 | SInt32 frOpenChain; Chain of directory IDs for open folders. The Finder numbers directory IDs. The Finder does not necessarily save this information immediately upon user action. 4 | SInt8 frScript; Extended flags. If the high-bit is set, the script system for displaying the folder's name. 5 | SInt8 frXFlags; Extended flags. See "Extended Finder Flags". 6 | SInt16 frComment; Reserved (set to 0). If the high-bit is clear, an ID number for the comment that is displayed in the information window when the user selects a folder and chooses the Get Info command from the File menu. The numbers that identify comments are assigned by the Finder. 7 | SInt32 frPutAway; If the user moves the folder onto the desktop, the directory ID of the folder from which the user moves it. 8 | }; 9 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/GUIUtil.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | /** 21 | * Utility functions that the GUI designer can use to ease his/her existential suffering. 22 | * 23 | * @author Erik Larsson 24 | */ 25 | public class GUIUtil extends org.catacombae.util.GUIUtil { 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/SpeedUnitUtils.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | // Ripped from TypherTransfer. Relevant changes should be backported. 19 | 20 | package org.catacombae.hfsexplorer; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class SpeedUnitUtils extends org.catacombae.util.SpeedUnitUtils { 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/catacombae/jparted/app/Main.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.jparted.app; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class Main { 24 | public static void main(String[] args) { 25 | MainController mc = new MainController(); 26 | mc.showMainWindow(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTKeyedRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public abstract class CommonBTKeyedRecord 24 | extends CommonBTRecord 25 | { 26 | public abstract K getKey(); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/VolumeHeader.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2009 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | import org.catacombae.hfs.types.hfscommon.CommonHFSVolumeHeader; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class VolumeHeader { 26 | public abstract CommonHFSVolumeHeader getHeaderStruct(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/ProgressMonitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public interface ProgressMonitor { 24 | 25 | public void signalCancel(); 26 | public boolean cancelSignaled(); 27 | public void confirmCancel(); 28 | public void addDataProgress(long dataSize); 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonHFSCatalogThread.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public abstract class CommonHFSCatalogThread { 24 | public abstract CommonHFSCatalogNodeID getParentID(); 25 | public abstract CommonHFSCatalogString getNodeName(); 26 | } 27 | -------------------------------------------------------------------------------- /netbeans/HFSExplorer/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | HFSExplorer 7 | 1.6.5 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | CatacombaeFramework 18 | jar 19 | 20 | jar 21 | clean 22 | jar 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/container/ContainerHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.container; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class ContainerHandlerFactory { 26 | public abstract ContainerHandler createHandler(DataLocator containerData); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | import org.catacombae.csjc.PrintableStruct; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class CommonBTRecord implements PrintableStruct { 26 | public abstract int getSize(); 27 | public abstract byte[] getBytes(); 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonHFSCatalogThreadRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public abstract class CommonHFSCatalogThreadRecord 24 | 25 | extends CommonHFSCatalogLeafRecord 26 | { 27 | public abstract T getData(); 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/FileSystemCapability.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2009 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public enum FileSystemCapability { 24 | /** The file system has create time for all file system objects. */ 25 | CREATE_TIME, 26 | /** The file system has backup time for all file system objects. */ 27 | BACKUP_TIME, 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTKey.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | import org.catacombae.csjc.DynamicStruct; 21 | import org.catacombae.csjc.PrintableStruct; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public abstract class CommonBTKey implements Comparable, DynamicStruct, PrintableStruct { 27 | public abstract byte[] getBytes(); 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/HFSInvalidDataException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2016 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class HFSInvalidDataException extends HFSException { 24 | public HFSInvalidDataException(String message) { 25 | super(message); 26 | } 27 | 28 | public HFSInvalidDataException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/unfinished/ErrorMessageException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.unfinished; 19 | 20 | /** 21 | * A HFSExplorer exception that should result in a pretty error message. 22 | * 23 | * @author Erik Larsson 24 | */ 25 | public class ErrorMessageException extends RuntimeException { 26 | public ErrorMessageException(String errorMessage) { 27 | super(errorMessage); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/BuildNumber.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class BuildNumber { 24 | //[BuildEnumerator:Opening] WARNING: The following lines are managed by an external program. Do NOT change. 25 | public static final long BUILD_NUMBER = 2021100900L; 26 | //[BuildEnumerator:Closing] The lines managed by an external program end here. 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/testcode/TestRegexp.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.testcode; 19 | 20 | import java.util.regex.Pattern; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class TestRegexp { 26 | public static void main(String[] args) { 27 | String regexp = args[0]; 28 | String testString = args[1]; 29 | 30 | System.out.println(Pattern.matches(regexp, testString)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BTLeafNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.csjc.PrintableStruct; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class BTLeafNode extends BTNode implements PrintableStruct { 26 | // This one is open for future generalization 27 | public BTLeafNode(byte[] data, int offset, int nodeSize) { 28 | super(data, offset, nodeSize); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/io/WritableRandomAccessChannel.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.io; 19 | 20 | import java.io.IOException; 21 | import java.nio.channels.FileChannel; 22 | import java.nio.channels.WritableByteChannel; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public interface WritableRandomAccessChannel extends RandomAccessChannel, WritableByteChannel { 28 | 29 | public abstract FileChannel truncate(long size) 30 | throws IOException; 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/gui/ChainedPanel.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.gui; 19 | 20 | import java.awt.Component; 21 | 22 | /** 23 | * Interface for a panel which can chain-link another Component inside itself. 24 | * 25 | * @author Erik Larsson 26 | */ 27 | public interface ChainedPanel { 28 | /** 29 | * Sets the chained-linked contents for this panel. 30 | * @param c the chain-linked component. 31 | */ 32 | public void setChainedContents(Component c); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/HFSDateField.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfs; 19 | 20 | import org.catacombae.hfs.types.hfsplus.HFSPlusDateField; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class HFSDateField extends HFSPlusDateField { 26 | public HFSDateField(byte[] data) { 27 | this(data, 0, data.length); 28 | } 29 | 30 | public HFSDateField(byte[] data, int offset, int length) { 31 | super("HFSDate", data, offset, length, true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsx/HFSXCatalogLeafRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsx; 19 | 20 | import org.catacombae.hfs.types.hfsplus.BTHeaderRec; 21 | import org.catacombae.hfs.types.hfsplus.HFSPlusCatalogLeafRecord; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class HFSXCatalogLeafRecord extends HFSPlusCatalogLeafRecord { 27 | public HFSXCatalogLeafRecord(byte[] data, int offset, BTHeaderRec catalogHeaderRec) { 28 | super(data, offset, catalogHeaderRec); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsx/HFSXCatalogLeafNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsx; 19 | 20 | import org.catacombae.hfs.types.hfsplus.BTHeaderRec; 21 | import org.catacombae.hfs.types.hfsplus.HFSPlusCatalogLeafNode; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class HFSXCatalogLeafNode extends HFSPlusCatalogLeafNode { 27 | public HFSXCatalogLeafNode(byte[] data, int offset, int nodeSize, BTHeaderRec catalogHeaderRec) { 28 | super(data, offset, nodeSize, catalogHeaderRec); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsx/HFSXCatalogIndexNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsx; 19 | 20 | import org.catacombae.hfs.types.hfsplus.BTHeaderRec; 21 | import org.catacombae.hfs.types.hfsplus.HFSPlusCatalogIndexNode; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class HFSXCatalogIndexNode extends HFSPlusCatalogIndexNode { 27 | public HFSXCatalogIndexNode(byte[] data, int offset, int nodeSize, BTHeaderRec catalogHeaderRec) { 28 | super(data, offset, nodeSize, catalogHeaderRec); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/catacombae/jparted/lib/AbstractFile.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.jparted.lib; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public interface AbstractFile { 24 | public void seek(long pos); 25 | public int read(); 26 | public int read(byte[] data); 27 | public int read(byte[] data, int pos, int len); 28 | public void readFully(byte[] data); 29 | public void readFully(byte[] data, int offset, int length); 30 | public long length(); 31 | public long getFilePointer(); 32 | public void close(); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/io/RandomAccessChannel.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.io; 19 | 20 | import java.io.IOException; 21 | import java.nio.channels.FileChannel; 22 | import java.nio.channels.ReadableByteChannel; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public interface RandomAccessChannel extends ReadableByteChannel { 28 | 29 | public abstract long position() 30 | throws IOException; 31 | 32 | public abstract FileChannel position(long newPosition) 33 | throws IOException; 34 | 35 | public abstract long size() 36 | throws IOException; 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/gpt/types/MutableGUID.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2011-2012 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.gpt.types; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class MutableGUID extends GUID { 24 | public MutableGUID() {} 25 | public MutableGUID(GUID guid) { 26 | super(guid); 27 | } 28 | 29 | public void setBytes(byte[] data, int offset) { 30 | if(data.length - offset < length()) 31 | throw new IllegalArgumentException("Not enough data (need > 16, " + 32 | "got " + (data.length - offset) + ")."); 33 | 34 | copyBytes(data, 0); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/container/hfs/HFSContainerHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.container.hfs; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | import org.catacombae.storage.ps.container.ContainerHandler; 22 | import org.catacombae.storage.ps.container.ContainerHandlerFactory; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class HFSContainerHandlerFactory extends ContainerHandlerFactory { 28 | 29 | @Override 30 | public ContainerHandler createHandler(DataLocator containerData) { 31 | throw new UnsupportedOperationException("Not supported yet."); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/testcode/editgpt/EditGPT.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTKeyedNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class CommonBTKeyedNode 26 | extends CommonBTNode 27 | { 28 | protected CommonBTKeyedNode(byte[] data, int offset, int nodeSize, 29 | FSType type) 30 | { 31 | super(data, offset, nodeSize, type); 32 | } 33 | 34 | public R getBTKeyedRecord(int index) { 35 | return getBTRecord(index); 36 | } 37 | 38 | public List getBTKeyedRecords() { 39 | return getBTRecords(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/Limits.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2016 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | import java.math.BigInteger; 21 | 22 | /** 23 | * Convenient interface containing some essential limits of generic types. 24 | * 25 | * @author Erik Larsson 26 | */ 27 | public interface Limits { 28 | public static final int UINT8_MAX = 0xFF; 29 | public static final int UINT16_MAX = 0xFFFF; 30 | public static final long UINT32_MAX = 0xFFFFFFFFL; 31 | public static final BigInteger UINT64_MAX = 32 | new BigInteger(1, new byte[] { 33 | (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 34 | (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/PartitionSystemHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | 22 | /** 23 | * A subclass of PartitionSystemHandlerFactory must always have a empty 24 | * constructor in order to be used as such. 25 | * 26 | * @author Erik Larsson 27 | */ 28 | public abstract class PartitionSystemHandlerFactory { 29 | public abstract PartitionSystemRecognizer getRecognizer(); 30 | public abstract PartitionSystemHandler createHandler(DataLocator partitionData); 31 | //public abstract PartitionSystemRecognizer createDetector(DataLocator partitionData); 32 | public abstract PartitionSystemImplementationInfo getInfo(); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/HFSException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2016 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | /** 21 | * The superclass of all exceptions that are thrown because of inconsistent HFS 22 | * on-disk data.
23 | * It should not be thrown as a result of inconsistencies in the internal state, 24 | * only when encountering inconsistencies in structs read from disk that prevent 25 | * us from proceeding with the requested operation. 26 | * 27 | * @author Erik Larsson 28 | */ 29 | public class HFSException extends RuntimeException { 30 | public HFSException(String message) { 31 | super(message); 32 | } 33 | 34 | public HFSException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/HFSNotEnoughDataException.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2016 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class HFSNotEnoughDataException extends HFSException { 24 | 25 | public HFSNotEnoughDataException(boolean dynamic, int arrayLength, 26 | int arrayOffset, int minimumLength, Class clazz) 27 | { 28 | super("Not enough data for " + clazz.getSimpleName() + " " + 29 | (dynamic ? "dynamic" : "static") + " fields (array " + 30 | "length: " + arrayLength + ", offset: " + 31 | arrayOffset + ", available: " + (arrayLength - arrayOffset) + 32 | ", minimum: " + minimumLength + ")."); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/ebr/EBRRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.ebr; 19 | 20 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 21 | import org.catacombae.io.ReadableRandomAccessStream; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class EBRRecognizer implements PartitionSystemRecognizer { 27 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 28 | try { 29 | EBRPartitionSystem ps = new EBRPartitionSystem(fsStream, offset, 512); 30 | if(ps.isValid()) { 31 | return true; 32 | } 33 | } catch(Exception e) { 34 | } 35 | 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfs/HFSFileSystemRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfs; 19 | 20 | import org.catacombae.io.ReadableRandomAccessStream; 21 | import org.catacombae.storage.fs.FileSystemRecognizer; 22 | import org.catacombae.storage.fs.hfscommon.HFSCommonFileSystemRecognizer; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class HFSFileSystemRecognizer implements FileSystemRecognizer { 28 | 29 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 30 | switch(HFSCommonFileSystemRecognizer.detectFileSystem(fsStream, offset)) { 31 | case HFS: 32 | return true; 33 | default: 34 | return false; 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/BootBlkHdr.struct: -------------------------------------------------------------------------------- 1 | struct BootBlkHdr { 2 | SInt16 bbID; boot blocks signature (Integer) 3 | SInt32 bbEntry; entry point to boot code (LongInt) 4 | SInt16 bbVersion; boot blocks version number (Integer) 5 | SInt16 bbPageFlags; used internally (Integer) 6 | Char bbSysName[16]; System filename (Str15) 7 | Char bbShellName[16]; Finder filename (Str15) 8 | Char bbDbg1Name[16]; debugger filename (Str15) 9 | Char bbDbg2Name[16]; debugger filename (Str15) 10 | Char bbScreenName[16]; name of startup screen (Str15) 11 | Char bbHelloName[16]; name of startup program (Str15) 12 | Char bbScrapName[16]; name of system scrap file (Str15) 13 | SInt16 bbCntFCBs; number of FCBs to allocate (Integer) 14 | SInt16 bbCntEvts; number of event queue elements (Integer) 15 | SInt32 bb128KSHeap; system heap size on 128K Mac (LongInt) 16 | SInt32 bb256KSHeap; used internally (LongInt) 17 | SInt32 bbSysHeapSize; system heap size on all machines (LongInt) 18 | SInt16 filler; reserved (Integer) 19 | SInt32 bbSysHeapExtra; additional system heap space (LongInt) 20 | SInt32 bbSysHeapFract; fraction of RAM for system heap (LongInt) 21 | }; 22 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfsx/HFSXFileSystemRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfsx; 19 | 20 | import org.catacombae.io.ReadableRandomAccessStream; 21 | import org.catacombae.storage.fs.FileSystemRecognizer; 22 | import org.catacombae.storage.fs.hfscommon.HFSCommonFileSystemRecognizer; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class HFSXFileSystemRecognizer implements FileSystemRecognizer { 28 | 29 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 30 | switch(HFSCommonFileSystemRecognizer.detectFileSystem(fsStream, offset)) { 31 | case HFSX: 32 | return true; 33 | default: 34 | return false; 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/CdrFilRec.struct: -------------------------------------------------------------------------------- 1 | struct CdrFilRec { 2 | SInt8 cdrType; record type (SignedByte) 3 | SInt8 cdrResrv2; reserved (SignedByte) 4 | SInt8 filFlags; file flags (SignedByte) 5 | SInt8 filTyp; file type (SignedByte) 6 | FInfo filUsrWds; Finder information (FInfo) 7 | SInt32 filFlNum; file ID (LongInt) 8 | SInt16 filStBlk; first alloc. blk. of data fork (Integer) 9 | SInt32 filLgLen; logical EOF of data fork (LongInt) 10 | SInt32 filPyLen; physical EOF of data fork (LongInt) 11 | SInt16 filRStBlk; first alloc. blk. of resource fork (Integer) 12 | SInt32 filRLgLen; logical EOF of resource fork (LongInt) 13 | SInt32 filRPyLen; physical EOF of resource fork (LongInt) 14 | SInt32 filCrDat; date and time of creation (LongInt) 15 | SInt32 filMdDat; date and time of last modification (LongInt) 16 | SInt32 filBkDat; date and time of last backup (LongInt) 17 | FXInfo filFndrInfo; additional Finder information (FXInfo) 18 | SInt16 filClpSize; file clump size (Integer) 19 | ExtDataRec filExtRec; first data fork extent record (ExtDataRec) 20 | ExtDataRec filRExtRec; first resource fork extent record (ExtDataRec) 21 | SInt32 filResrv; reserved (LongInt) 22 | }; 23 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusAttributesIndexNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2012 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.util.Util; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class HFSPlusAttributesIndexNode extends BTIndexNode { 26 | public HFSPlusAttributesIndexNode(byte[] data, int offset, int nodeSize) { 27 | super(data, offset, nodeSize); 28 | 29 | for(int i = 0; i < records.length; ++i) { 30 | final int currentOffset = Util.unsign(offsets[i]); 31 | HFSPlusAttributesKey currentKey = 32 | new HFSPlusAttributesKey(data, offset + currentOffset); 33 | 34 | records[i] = 35 | new BTIndexRecord(currentKey, data, offset + currentOffset); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusExtentIndexNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.util.Util; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class HFSPlusExtentIndexNode extends BTIndexNode { 26 | public HFSPlusExtentIndexNode(byte[] data, int offset, int nodeSize) { 27 | super(data, offset, nodeSize); 28 | 29 | // Populate record list 30 | // we loop offsets.length-1 times, since last offset is offset to free space 31 | for(int i = 0; i < records.length; ++i) { 32 | int currentOffset = Util.unsign(offsets[i]); 33 | HFSPlusExtentKey currentKey = new HFSPlusExtentKey(data, offset+currentOffset); 34 | records[i] = new BTIndexRecord(currentKey, data, offset+currentOffset); 35 | } 36 | } 37 | //public static 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/fs/NullProgressMonitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008-2012 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.fs; 19 | 20 | import org.catacombae.hfs.ProgressMonitor; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class NullProgressMonitor implements ProgressMonitor { 26 | 27 | private static final NullProgressMonitor INSTANCE = new NullProgressMonitor(); 28 | 29 | public static NullProgressMonitor getInstance() { return INSTANCE; } 30 | 31 | protected NullProgressMonitor() {} 32 | 33 | /* @Override */ 34 | public void signalCancel() {} 35 | 36 | /* @Override */ 37 | public boolean cancelSignaled() { return false; } 38 | 39 | /* @Override */ 40 | public void confirmCancel() {} 41 | 42 | /* @Override */ 43 | public void addDataProgress(long dataSize) {} 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/FSForkType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs; 19 | 20 | /** 21 | * Enumerates the fork types that are recognized by the API as having a special 22 | * meaning. 23 | * 24 | * @author Erik Larsson 25 | */ 26 | public enum FSForkType { 27 | /** 28 | * The data fork, the "main" fork of a file. All file system 29 | * implementations must support this fork type. 30 | */ 31 | DATA, 32 | /** 33 | * The resource fork in a MacOS file system. The resource fork has a special 34 | * meaning for MacOS operating systems, as content type, thumbnails and 35 | * other metadata are stored there. 36 | */ 37 | MACOS_RESOURCE, 38 | /** 39 | * The 32-byte metadata fork FinderInfo, used by the Mac OS Finder. 40 | */ 41 | MACOS_FINDERINFO, 42 | ; 43 | } 44 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfsplus/HFSPlusFileSystemRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfsplus; 19 | 20 | import org.catacombae.io.ReadableRandomAccessStream; 21 | import org.catacombae.storage.fs.FileSystemRecognizer; 22 | import org.catacombae.storage.fs.hfscommon.HFSCommonFileSystemRecognizer; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class HFSPlusFileSystemRecognizer implements FileSystemRecognizer { 28 | 29 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 30 | switch(HFSCommonFileSystemRecognizer.detectFileSystem(fsStream, offset)) { 31 | case HFS_PLUS: 32 | case HFS_WRAPPED_HFS_PLUS: 33 | return true; 34 | default: 35 | return false; 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/BasicExtractProgressMonitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | import org.catacombae.hfsexplorer.fs.NullProgressMonitor; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class BasicExtractProgressMonitor extends NullProgressMonitor implements ExtractProgressMonitor { 26 | 27 | protected BasicExtractProgressMonitor() {} 28 | 29 | /* @Override */ 30 | public void updateTotalProgress(double fraction, String message) {} 31 | 32 | /* @Override */ 33 | public void updateCurrentDir(String dirname) {} 34 | 35 | /* @Override */ 36 | public void updateCurrentFile(String filename, long fileSize) {} 37 | 38 | /* @Override */ 39 | public void setDataSize(long totalSize) {} 40 | 41 | /* @Override */ 42 | public void updateCalculateDir(String dirname) {} 43 | } 44 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/PrefixFileFilter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | import java.io.File; 21 | import javax.swing.filechooser.FileFilter; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class PrefixFileFilter extends FileFilter { 27 | private final String description; 28 | private final String prefix; 29 | 30 | public PrefixFileFilter(String description, String prefix) { 31 | this.description = description; 32 | this.prefix = prefix; 33 | } 34 | 35 | @Override 36 | public boolean accept(File f) { 37 | if(f.isDirectory()) 38 | return true; 39 | 40 | if(f.getName().startsWith(prefix)) 41 | return true; 42 | return false; 43 | } 44 | 45 | @Override 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfscommon/HFSCommonFSFile.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfscommon; 19 | 20 | import org.catacombae.hfs.types.hfscommon.CommonHFSCatalogFileRecord; 21 | import org.catacombae.hfs.types.hfscommon.CommonHFSCatalogLeafRecord; 22 | import org.catacombae.storage.fs.FSFile; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class HFSCommonFSFile extends HFSCommonAbstractFile implements FSFile { 28 | protected HFSCommonFSFile(HFSCommonFileSystemHandler parent, 29 | CommonHFSCatalogFileRecord fileRecord) 30 | { 31 | super(parent, fileRecord); 32 | } 33 | 34 | protected HFSCommonFSFile(HFSCommonFileSystemHandler parent, 35 | CommonHFSCatalogLeafRecord hardLinkRecord, 36 | CommonHFSCatalogFileRecord fileRecord) 37 | { 38 | super(parent, hardLinkRecord, fileRecord); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/mbr/MBRRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.mbr; 19 | 20 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 21 | import org.catacombae.io.ReadableRandomAccessStream; 22 | import org.catacombae.storage.ps.mbr.types.MBRPartitionTable; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class MBRRecognizer implements PartitionSystemRecognizer { 28 | 29 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 30 | try { 31 | byte[] firstBlock = new byte[512]; 32 | fsStream.read(firstBlock); 33 | 34 | // Look for MBR 35 | MBRPartitionTable mpt = new MBRPartitionTable(firstBlock, 0); 36 | if(mpt.isValid()) { 37 | return true; 38 | } 39 | } catch(Exception e) { 40 | } 41 | 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/testcode/ParseExtentLeafNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.testcode; 19 | 20 | import java.io.RandomAccessFile; 21 | import org.catacombae.hfs.types.hfsplus.HFSPlusExtentLeafNode; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class ParseExtentLeafNode { 27 | 28 | public static void main(String[] args) throws Exception { 29 | RandomAccessFile raf = new RandomAccessFile(args[0], "r"); 30 | byte[] data = new byte[(int) raf.length()]; 31 | raf.readFully(data); 32 | raf.close(); 33 | HFSPlusExtentLeafNode node = new HFSPlusExtentLeafNode(data, 0, data.length); 34 | node.print(System.out, ""); 35 | 36 | System.out.println("Leaf record offsets:"); 37 | short[] offsets = node.getLeafRecordOffsets(); 38 | for(short s : offsets) 39 | System.out.println(" " + (s & 0xFFFF)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/FileSystemRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs; 19 | 20 | import org.catacombae.io.ReadableRandomAccessStream; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public interface FileSystemRecognizer { 26 | 27 | /** 28 | * Detects whether there is a file system located at the specified offset in 29 | * fsStream. Which file system is being detected is dependent on the 30 | * context. 31 | * 32 | * @param fsStream 33 | * @param offset the offset in fsStream to the start of the file system. 34 | * @param length this parameter may be set to -1 if the length isn't 35 | * currently known. 36 | * @return true if a file system can be detected at the 37 | * specified offset in fsStream, and false otherwise. 38 | */ 39 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length); 40 | } 41 | -------------------------------------------------------------------------------- /src/win32/launcher/logging.hh: -------------------------------------------------------------------------------- 1 | #ifndef __LOGGING_HH 2 | #define __LOGGING_HH 3 | 4 | #define FALSE 0 5 | #define TRUE 1 6 | 7 | #ifndef LOGGING_ENABLED 8 | #define LOGGING_ENABLED TRUE 9 | #endif /* LOGGING_ENABLED */ 10 | 11 | /** Format placeholder to use for _TCHAR strings in log messages. */ 12 | #ifdef _UNICODE 13 | #define FMTts "S" 14 | #else 15 | #define FMTts "s" 16 | #endif 17 | 18 | /* */ 19 | enum loglevel { 20 | error = 0x0000010, 21 | debug = 0x0000100, 22 | trace = 0x1000000 23 | }; 24 | 25 | /* Here you can set which log levels are printed to stderr. */ 26 | static int logMask = error | debug | trace; 27 | 28 | static inline bool loglevelEnabled(loglevel ll) { 29 | return (ll & logMask) != 0x0; 30 | } 31 | 32 | static inline const _TCHAR* loglevelToString(loglevel ll) { 33 | switch(ll) { 34 | case error: return _T("ERROR"); 35 | case debug: return _T("DEBUG"); 36 | case trace: return _T("TRACE"); 37 | default: return _T("[Unknown loglevel!]"); 38 | } 39 | } 40 | 41 | /* Main logging macro. */ 42 | #if LOGGING_ENABLED 43 | static inline void LOG(enum loglevel loglevel, const char *format, ...) 44 | { 45 | if(loglevelEnabled(loglevel)) { 46 | va_list ap; 47 | va_start(ap, format); 48 | _ftprintf(stderr, _T("%s: "), loglevelToString(loglevel)); 49 | vfprintf(stderr, format, ap); 50 | _ftprintf(stderr, _T("\n")); 51 | fflush(stderr); 52 | va_end(ap); 53 | } 54 | } 55 | #else 56 | static inline void LOG(enum loglevel loglevel, const char *format, ...) {} 57 | #endif 58 | /* */ 59 | 60 | inline void setLogMask(int newMask) { 61 | logMask = newMask; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/win32/llio/llio_common.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | /* Utility functions common to all llio source files. */ 19 | 20 | #ifndef _Included_llio_common 21 | #define _Included_llio_common 22 | 23 | #include 24 | #include 25 | 26 | void throwByName(JNIEnv *env, const char *name, const char *fmt, ...); 27 | void handleMultiByteToWideCharError(JNIEnv *env, DWORD errorCode); 28 | jbyteArray getHandleData(JNIEnv *env, HANDLE hnd); 29 | HANDLE getHandle(JNIEnv *env, jbyteArray handleData); 30 | 31 | /** 32 | * Opens a file by the name filename, and returns the resulting handle as 33 | * a byte array so it can be stored in java data structures. Java 34 | * RuntimeExceptions are thrown if things go wrong. 35 | */ 36 | jbyteArray openWin32File(JNIEnv *env, 37 | jstring filename, 38 | DWORD dwDesiredAccess, 39 | DWORD dwShareMode, 40 | LPSECURITY_ATTRIBUTES lpSecurityAttributes, 41 | DWORD dwCreationDisposition, 42 | DWORD dwFlagsAndAttributes, 43 | HANDLE hTemplateFile); 44 | #endif 45 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BTNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import java.io.PrintStream; 21 | import org.catacombae.csjc.PrintableStruct; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public abstract class BTNode implements PrintableStruct { 27 | protected final BTNodeDescriptor nodeDescriptor; 28 | 29 | public BTNode(byte[] data, int offset, int nodeSize) { 30 | nodeDescriptor = new BTNodeDescriptor(data, offset); 31 | } 32 | 33 | public BTNodeDescriptor getNodeDescriptor() { 34 | return nodeDescriptor; 35 | } 36 | 37 | public void printFields(PrintStream ps, String prefix) { 38 | ps.println(prefix + " nodeDescriptor:"); 39 | nodeDescriptor.printFields(ps, prefix + " "); 40 | } 41 | 42 | public void print(PrintStream ps, String prefix) { 43 | ps.println(prefix + "BTNode:"); 44 | printFields(ps, prefix); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/testcode/PrintGPTHeader.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.testcode; 19 | 20 | import java.io.File; 21 | import java.io.RandomAccessFile; 22 | import org.catacombae.storage.ps.gpt.types.GPTHeader; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class PrintGPTHeader { 28 | public static void main(String[] args) throws Exception { 29 | long offset = 0; 30 | File sourceFile; 31 | if(args.length > 0) 32 | sourceFile = new File(args[0]); 33 | else { 34 | System.out.println("usage: PrintGPTHeader []"); 35 | System.exit(1); 36 | return; 37 | } 38 | if(args.length > 1) 39 | offset = Long.parseLong(args[1]); 40 | 41 | byte[] data = new byte[512]; 42 | RandomAccessFile sourceRaf = new RandomAccessFile(sourceFile, "r"); 43 | sourceRaf.seek(offset); 44 | sourceRaf.read(data); 45 | 46 | GPTHeader gph = new GPTHeader(data, 0, 512); 47 | gph.print(System.out, ""); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BTKey.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.csjc.PrintableStruct; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class BTKey implements Comparable, PrintableStruct { 26 | public abstract short getKeyLength(); 27 | public abstract int length(); 28 | public abstract byte[] getBytes(); 29 | 30 | /* @Override */ 31 | public int compareTo(BTKey btk) { 32 | byte[] thisData = getBytes(); 33 | byte[] thatData = btk.getBytes(); 34 | 35 | for(int i = 0; i < Math.min(thisData.length, thatData.length); ++i) { 36 | int a = thisData[i] & 0xFF; 37 | int b = thatData[i] & 0xff; 38 | if(a < b) 39 | return -1; 40 | else if(a > b) 41 | return 1; 42 | } 43 | if(thisData.length < thatData.length) 44 | return -1; 45 | else if(thisData.length > thatData.length) 46 | return 1; 47 | else 48 | return 0; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/HFSPlusWrapperMDB.struct: -------------------------------------------------------------------------------- 1 | struct HFSPlusWrapperMDB { 2 | UInt16 drSigWord; volume signature 3 | UInt32 drCrDate; date and time of volume creation 4 | UInt32 drLsMod; date and time of last modification 5 | UInt16 drAtrb; volume attributes 6 | UInt16 drNmFls; number of files in root directory 7 | UInt16 drVBMSt; first block of volume bitmap 8 | UInt16 drAllocPtr; start of next allocation search 9 | UInt16 drNmAlBlks; number of allocation blocks in volume 10 | UInt32 drAlBlkSiz; size (in bytes) of allocation blocks 11 | UInt32 drClpSiz; default clump size 12 | UInt16 drAlBlSt; first allocation block in volume 13 | UInt32 drNxtCNID; next unused catalog node ID 14 | UInt16 drFreeBks; number of unused allocation blocks 15 | UInt8 drVNLength; length of volume name 16 | Char drVN[27]; volume name 17 | UInt32 drVolBkUp; date and time of last backup 18 | UInt16 drVSeqNum; volume backup sequence number 19 | UInt32 drWrCnt; volume write count 20 | UInt32 drXTClpSiz; clump size for extents overflow file 21 | UInt32 drCTClpSiz; clump size for catalog file 22 | UInt16 drNmRtDirs; number of directories in root directory 23 | UInt32 drFilCnt; number of files in volume 24 | UInt32 drDirCnt; number of directories in volume 25 | UInt32 drFndrInfo[8]; information used by the Finder 26 | UInt16 drEmbedSigWord; HFS+ Wrapper specific: Must always be 'H+' 27 | ExtDescriptor drEmbedExtent; HFS+ Wrapper specific: The extent containing the HFS+ volume 28 | UInt32 drXTFlSize; size of extents overflow file 29 | ExtDataRec drXTExtRec; extent record for extents overflow file 30 | UInt32 drCTFlSize; size of catalog file 31 | ExtDataRec drCTExtRec; extent record for catalog file 32 | }; 33 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/testcode/PrintGPTEntry.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.testcode; 19 | 20 | import java.io.File; 21 | import java.io.RandomAccessFile; 22 | import org.catacombae.storage.ps.gpt.types.GPTEntry; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class PrintGPTEntry { 28 | public static void main(String[] args) throws Exception { 29 | long offset = 0; 30 | File sourceFile; 31 | if(args.length > 0) 32 | sourceFile = new File(args[0]); 33 | else { 34 | System.out.println("usage: PrintGPTEntry []"); 35 | System.exit(1); 36 | return; 37 | } 38 | if(args.length > 1) 39 | offset = Long.parseLong(args[1]); 40 | 41 | byte[] data = new byte[GPTEntry.getSize()]; 42 | RandomAccessFile sourceRaf = new RandomAccessFile(sourceFile, "r"); 43 | sourceRaf.seek(offset); 44 | sourceRaf.read(data); 45 | 46 | GPTEntry gph = new GPTEntry(data, 0, 512); 47 | gph.print(System.out, ""); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/FSFile.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs; 19 | 20 | /** 21 | * This interface represents an entry corresponding to a file in the file system 22 | * presented by a FileSystemHandler. A file is an entry that does not have 23 | * subentries, like a folder, but that has associated data. A file can have one 24 | * or more "forks" of data, where one of the forks always must be considered the 25 | * "main" fork or the "data" fork. Some file systems do not support forks, in 26 | * which case the only fork available is the "main" fork. 27 | * 28 | * @author Erik Larsson 29 | */ 30 | public interface FSFile extends FSEntry { 31 | /** 32 | * Returns the main (data) fork of this file, containing the data that users 33 | * normally will see. All implementors must make sure that this FSFork 34 | * always exists. 35 | * 36 | * @return the main (data) fork of this file. 37 | */ 38 | public abstract FSFork getMainFork(); 39 | } 40 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/PartitionSystemRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | import org.catacombae.io.ReadableRandomAccessStream; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public interface PartitionSystemRecognizer { 26 | /* TODO: detect should take a sectorSize argument... */ 27 | /** 28 | * Detects whether there is a partition system located at the specified 29 | * offset in fsStream. Which partition system is being detected is dependent 30 | * on the context. 31 | * 32 | * @param fsStream 33 | * @param offset the offset in fsStream to the start of the file system. 34 | * @param length this parameter may be set to -1 if the length isn't 35 | * currently known. 36 | * @return true if a partition system can be detected at the 37 | * specified offset in fsStream, and false otherwise. 38 | */ 39 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length); 40 | } 41 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfs/MasterDirectoryBlock.struct: -------------------------------------------------------------------------------- 1 | struct MasterDirectoryBlock { 2 | UInt16 drSigWord; volume signature 3 | UInt32 drCrDate; date and time of volume creation 4 | UInt32 drLsMod; date and time of last modification 5 | UInt16 drAtrb; volume attributes 6 | UInt16 drNmFls; number of files in root directory 7 | UInt16 drVBMSt; first block of volume bitmap 8 | UInt16 drAllocPtr; start of next allocation search 9 | UInt16 drNmAlBlks; number of allocation blocks in volume 10 | UInt32 drAlBlkSiz; size (in bytes) of allocation blocks 11 | UInt32 drClpSiz; default clump size 12 | UInt16 drAlBlSt; first allocation block in volume 13 | UInt32 drNxtCNID; next unused catalog node ID 14 | UInt16 drFreeBks; number of unused allocation blocks 15 | UInt8 drVNLength; length of volume name 16 | Char drVN[28]; volume name 17 | UInt32 drVolBkUp; date and time of last backup 18 | UInt16 drVSeqNum; volume backup sequence number 19 | UInt32 drWrCnt; volume write count 20 | UInt32 drXTClpSiz; clump size for extents overflow file 21 | UInt32 drCTClpSiz; clump size for catalog file 22 | UInt16 drNmRtDirs; number of directories in root directory 23 | UInt32 drFilCnt; number of files in volume 24 | UInt32 drDirCnt; number of directories in volume 25 | HFSVolumeFinderInfo drFndrInfo; information used by the Finder 26 | UInt16 drVCSize; size (in blocks) of volume cache 27 | UInt16 drVBMCSize; size (in blocks) of volume bitmap cache 28 | UInt16 drCtlCSize; size (in blocks) of common volume cache 29 | UInt32 drXTFlSize; size of extents overflow file 30 | ExtDataRec drXTExtRec; extent record for extents overflow file 31 | UInt32 drCTFlSize; size of catalog file 32 | ExtDataRec drCTExtRec; extent record for catalog file 33 | }; 34 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/gui/HFSExplorerJFrame.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2015 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.gui; 19 | 20 | import javax.swing.ImageIcon; 21 | import javax.swing.JFrame; 22 | import org.catacombae.hfsexplorer.Java6Util; 23 | import org.catacombae.hfsexplorer.Resources; 24 | 25 | /** 26 | * Base class for all HFSExplorer windows, setting up common properties such as 27 | * the window icon. 28 | * 29 | * @author Erik Larsson 30 | */ 31 | public class HFSExplorerJFrame extends JFrame implements Resources { 32 | private static final ImageIcon[] WINDOW_ICONS = { 33 | new ImageIcon(APPLICATION_ICON_16), 34 | new ImageIcon(APPLICATION_ICON_32), 35 | new ImageIcon(APPLICATION_ICON_48), 36 | }; 37 | 38 | public HFSExplorerJFrame(String title) { 39 | super(title); 40 | 41 | if(Java6Util.isJava6OrHigher()) { 42 | Java6Util.setIconImages(WINDOW_ICONS, this); 43 | } 44 | else { 45 | setIconImage(WINDOW_ICONS[0].getImage()); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/Package-Debug.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # 4 | # Generated - do not edit! 5 | # 6 | 7 | # Macros 8 | TOP=`pwd` 9 | CND_PLATFORM=MinGW-Windows 10 | CND_CONF=Debug 11 | CND_DISTDIR=dist 12 | TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging 13 | TMPDIRNAME=tmp-packaging 14 | OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libHFSExplorerNative.dll 15 | OUTPUT_BASENAME=libHFSExplorerNative.dll 16 | PACKAGE_TOP_DIR=libHFSExplorerNative.dll/ 17 | 18 | # Functions 19 | function checkReturnCode 20 | { 21 | rc=$? 22 | if [ $rc != 0 ] 23 | then 24 | exit $rc 25 | fi 26 | } 27 | function makeDirectory 28 | # $1 directory path 29 | # $2 permission (optional) 30 | { 31 | mkdir -p "$1" 32 | checkReturnCode 33 | if [ "$2" != "" ] 34 | then 35 | chmod $2 "$1" 36 | checkReturnCode 37 | fi 38 | } 39 | function copyFileToTmpDir 40 | # $1 from-file path 41 | # $2 to-file path 42 | # $3 permission 43 | { 44 | cp "$1" "$2" 45 | checkReturnCode 46 | if [ "$3" != "" ] 47 | then 48 | chmod $3 "$2" 49 | checkReturnCode 50 | fi 51 | } 52 | 53 | # Setup 54 | cd "${TOP}" 55 | mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package 56 | rm -rf ${TMPDIR} 57 | mkdir -p ${TMPDIR} 58 | 59 | # Copy files and create directories and links 60 | cd "${TOP}" 61 | makeDirectory ${TMPDIR}/libHFSExplorerNative.dll/lib 62 | copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644 63 | 64 | 65 | # Generate tar file 66 | cd "${TOP}" 67 | rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libHFSExplorerNative.dll.tar 68 | cd ${TMPDIR} 69 | tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libHFSExplorerNative.dll.tar * 70 | checkReturnCode 71 | 72 | # Cleanup 73 | cd "${TOP}" 74 | rm -rf ${TMPDIR} 75 | -------------------------------------------------------------------------------- /netbeans/HFSExplorerNative/nbproject/Package-Release.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # 4 | # Generated - do not edit! 5 | # 6 | 7 | # Macros 8 | TOP=`pwd` 9 | CND_PLATFORM=MinGW-Windows 10 | CND_CONF=Release 11 | CND_DISTDIR=dist 12 | TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging 13 | TMPDIRNAME=tmp-packaging 14 | OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libHFSExplorerNative.dll 15 | OUTPUT_BASENAME=libHFSExplorerNative.dll 16 | PACKAGE_TOP_DIR=libHFSExplorerNative.dll/ 17 | 18 | # Functions 19 | function checkReturnCode 20 | { 21 | rc=$? 22 | if [ $rc != 0 ] 23 | then 24 | exit $rc 25 | fi 26 | } 27 | function makeDirectory 28 | # $1 directory path 29 | # $2 permission (optional) 30 | { 31 | mkdir -p "$1" 32 | checkReturnCode 33 | if [ "$2" != "" ] 34 | then 35 | chmod $2 "$1" 36 | checkReturnCode 37 | fi 38 | } 39 | function copyFileToTmpDir 40 | # $1 from-file path 41 | # $2 to-file path 42 | # $3 permission 43 | { 44 | cp "$1" "$2" 45 | checkReturnCode 46 | if [ "$3" != "" ] 47 | then 48 | chmod $3 "$2" 49 | checkReturnCode 50 | fi 51 | } 52 | 53 | # Setup 54 | cd "${TOP}" 55 | mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package 56 | rm -rf ${TMPDIR} 57 | mkdir -p ${TMPDIR} 58 | 59 | # Copy files and create directories and links 60 | cd "${TOP}" 61 | makeDirectory ${TMPDIR}/libHFSExplorerNative.dll/lib 62 | copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644 63 | 64 | 65 | # Generate tar file 66 | cd "${TOP}" 67 | rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libHFSExplorerNative.dll.tar 68 | cd ${TMPDIR} 69 | tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/libHFSExplorerNative.dll.tar * 70 | checkReturnCode 71 | 72 | # Cleanup 73 | cd "${TOP}" 74 | rm -rf ${TMPDIR} 75 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/PartitionSystemHandler.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | /** 21 | * Stub. 22 | * 23 | * @author Erik Larsson 24 | */ 25 | public abstract class PartitionSystemHandler { 26 | 27 | public abstract long getPartitionCount(); 28 | public abstract Partition[] getPartitions(); 29 | public abstract void close(); 30 | 31 | /** 32 | * Returns the partition with number partitionNumber, or 33 | * null if there is no partition with the specified number. 34 | * 35 | * @param partitionNumber the requested partition number. 36 | * @return the partition with number partitionNumber, or 37 | * null if there is no partition with the specified number. 38 | */ 39 | public Partition getPartition(int partitionNumber) { 40 | Partition[] parts = getPartitions(); 41 | if(partitionNumber >= 0 && partitionNumber < parts.length) 42 | return parts[partitionNumber]; 43 | else 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /dist/doc/html/troubleshooting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Troubleshooting 6 | 7 | 8 | 9 |

HFSExplorer troubleshooting

10 |

[Windows] Pressing the autodetect button doesn't make HFSExplorer locate my HFS+/HFSX hard drive

11 |

This can have many causes. First you have to make sure that HFSExplorer can find your hard drives. If the list box labeled "Detected devices" is empty or contains only "CdRom"-devices, your user probably doesn't have sufficient rights to access hard disk devices directly.

12 |

To gain sufficient rights, 13 | run the program through the menu shortcut "Run HFSExplorer in Administrator mode".
14 | If you're running Windows Vista and have User Account Control turned on, you will get a dialog asking for credentials if you're a non-administrator user, or a dialog asking you to confirm that you want to give administrator rights to the application if you are an administrator user.
15 | If you're running an earlier version of Windows, such as Windows XP, you will get a dialog asking you to enter the username and password of an administrator user.
16 | HFSExplorer cannot currently read from attached hard drives without administrator rights, because of security barriers in the operating system.

17 |

If you can see your hard drives and "Autodetect" still doesn't do the job, try to load the file system manually by trying to load each of the detected hard drives. If one of them does work, when autodetect does not, there is a bug in the "Autodetect" code, and you should report it back to the developer.

18 | 19 | 20 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/JarMain.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | /** 21 | * Containins the main method for when the application is started 22 | * through a JAR manifest. 23 | * 24 | * @author Erik Larsson 25 | */ 26 | public class JarMain { 27 | private static final String CONSOLE_ARG = "-dbgconsole"; 28 | 29 | /** 30 | * This special main method for starting the application makes sure 31 | * the argument "-dbgconsole" is present in args, and adds it if 32 | * absent, to force the debug console to appear. Then it invokes 33 | * the normal application main method with the possibly modified 34 | * argument array. 35 | */ 36 | public static void main(String[] args) { 37 | String[] fsbArgs; 38 | if(args.length <= 0 || !args[0].equals(CONSOLE_ARG)) { 39 | fsbArgs = new String[args.length+1]; 40 | fsbArgs[0] = CONSOLE_ARG; 41 | for(int i = 0; i < args.length; ++i) 42 | fsbArgs[i+1] = args[i]; 43 | } 44 | else 45 | fsbArgs = args; 46 | 47 | FileSystemBrowserWindow.main(fsbArgs); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/ebr/EBRPartition.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.ebr; 19 | 20 | import org.catacombae.storage.ps.mbr.types.MBRPartition; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class EBRPartition extends MBRPartition { 26 | 27 | private final long baseOffset; 28 | 29 | /** 30 | * 31 | * @param data 32 | * @param offset offset in data to the EBR partition data. 33 | * @param baseOffset the base offset which we will resolve startOffset 34 | * against. 35 | * @param sectorSize 36 | */ 37 | public EBRPartition(byte[] data, int offset, long baseOffset, int sectorSize) { 38 | super(data, offset, sectorSize); 39 | this.baseOffset = baseOffset; 40 | } 41 | 42 | /** Copy constructor. */ 43 | public EBRPartition(EBRPartition source) { 44 | super(source); 45 | this.baseOffset = source.baseOffset; 46 | } 47 | 48 | // Defined in Partition 49 | @Override 50 | public long getStartOffset() { return super.getStartOffset()+baseOffset; } 51 | } 52 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/BTIndexRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import java.io.PrintStream; 21 | import org.catacombae.csjc.PrintableStruct; 22 | import org.catacombae.util.Util; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class BTIndexRecord implements PrintableStruct { 28 | private final BTKey key; 29 | private final byte[] index = new byte[4]; 30 | 31 | public BTIndexRecord(BTKey key, byte[] data, int offset) { 32 | this.key = key; 33 | System.arraycopy(data, offset+key.length(), index, 0, 4); 34 | } 35 | 36 | public BTKey getKey() { return key; } 37 | public int getIndex() { return Util.readIntBE(index); } 38 | 39 | public void printFields(PrintStream ps, String prefix) { 40 | ps.println(prefix + " key:"); 41 | key.print(ps, prefix + " "); 42 | ps.println(prefix + " index: " + Util.unsign(getIndex())); 43 | } 44 | 45 | public void print(PrintStream ps, String prefix) { 46 | ps.println(prefix + "BTIndexRecord:"); 47 | printFields(ps, prefix); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vc6buildlauncher.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | setlocal 4 | 5 | set BUILD_DIR=%~dp0build.~ 6 | set SOURCE_DIR=%~dp0src\win32\launcher 7 | set TARGET_EXE_PREFIX=%~dp0dist\bin 8 | set RES_TARGET=%BUILD_DIR%\launcher.res 9 | set OBJ_TARGET=%BUILD_DIR%\launcher.obj 10 | 11 | if "%JAVA_HOME%"=="" echo Please set JAVA_HOME to point at your JDK before running this script. & goto end 12 | 13 | if "%1"=="console" goto console 14 | if "%1"=="windows" goto windows 15 | 16 | :printusage 17 | echo usage: %0 [console^|windows] ^ 18 | goto end 19 | 20 | :console 21 | set SUBSYSTEM=CONSOLE 22 | goto arch 23 | 24 | :windows 25 | set SUBSYSTEM=WINDOWS 26 | goto arch 27 | 28 | :arch 29 | if "%2"=="" set TARGET_EXE=%TARGET_EXE_PREFIX%\hfsexplorer.exe & goto build 30 | if "%2"=="x86" set TARGET_EXE=%TARGET_EXE_PREFIX%\hfsexplorer_x86.exe & goto build 31 | 32 | echo Unknown architecture "%2"! 33 | goto printusage 34 | 35 | :build 36 | echo Cleaning build dir... 37 | if exist "%BUILD_DIR%" rmdir /s /q "%BUILD_DIR%" 38 | if exist "%BUILD_DIR%" echo Could not clean build dir! & goto error 39 | mkdir "%BUILD_DIR%" 40 | 41 | echo Compiling resources... 42 | rc /fo "%RES_TARGET%" "%SOURCE_DIR%\launcher.rc" 43 | if not "%ERRORLEVEL%"=="0" goto error 44 | 45 | echo Compiling source code... 46 | cl /c "/Fo%OBJ_TARGET%" "/I%JAVA_HOME%\include" "/I%JAVA_HOME%\include\win32" "%SOURCE_DIR%\launcher.cpp" 47 | if not "%ERRORLEVEL%"=="0" goto error 48 | 49 | echo Linking... 50 | link /defaultlib:user32 /defaultlib:shell32 /defaultlib:advapi32 /defaultlib:ole32 /subsystem:%SUBSYSTEM% /entry:mainCRTStartup "/out:%TARGET_EXE%" "%OBJ_TARGET%" "%RES_TARGET%" 51 | if not "%ERRORLEVEL%"=="0" goto error 52 | goto completed 53 | 54 | :completed 55 | echo Target generated at %TARGET_EXE% 56 | echo Done! 57 | goto end 58 | 59 | :error 60 | echo There were errors... 61 | goto end 62 | 63 | :end 64 | endlocal -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfsx/HFSXFileSystemHandler.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008-2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfsx; 19 | 20 | import org.catacombae.storage.fs.hfsplus.HFSPlusFileSystemHandler; 21 | import org.catacombae.storage.io.DataLocator; 22 | import org.catacombae.hfs.x.HFSXVolume; 23 | 24 | /** 25 | * HFSX implementation of a FileSystemHandler. This implementation can be used 26 | * to access HFSX file systems. (HFSX file systems are very similar to HFS+, 27 | * but with a few extensions, like the ability to treat file names in a case 28 | * sensitive manner). 29 | * 30 | * @author Erik Larsson 31 | */ 32 | public class HFSXFileSystemHandler extends HFSPlusFileSystemHandler { 33 | 34 | public HFSXFileSystemHandler(DataLocator fsLocator, boolean useCaching, 35 | boolean posixNames, boolean sfmSubstitutions, 36 | boolean doUnicodeFileNameComposition, boolean hideProtected) 37 | { 38 | super(new HFSXVolume(fsLocator.createReadOnlyFile(), useCaching), 39 | posixNames, sfmSubstitutions, doUnicodeFileNameComposition, 40 | hideProtected); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/gpt/GPTHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.gpt; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 22 | import org.catacombae.storage.ps.PartitionSystemHandler; 23 | import org.catacombae.storage.ps.PartitionSystemHandlerFactory; 24 | import org.catacombae.storage.ps.PartitionSystemImplementationInfo; 25 | 26 | /** 27 | * @author Erik Larsson 28 | */ 29 | public class GPTHandlerFactory extends PartitionSystemHandlerFactory { 30 | 31 | private static final GPTRecognizer recognizer = new GPTRecognizer(); 32 | 33 | @Override 34 | public PartitionSystemHandler createHandler(DataLocator data) { 35 | return new GPTHandler(data); 36 | } 37 | 38 | @Override 39 | public PartitionSystemImplementationInfo getInfo() { 40 | return new PartitionSystemImplementationInfo("GUID Partition Table", 41 | "Catacombae GPT PS Handler", "1.0", "Catacombae"); 42 | } 43 | 44 | @Override 45 | public PartitionSystemRecognizer getRecognizer() { 46 | return recognizer; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/ebr/EBRHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.ebr; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 22 | import org.catacombae.storage.ps.PartitionSystemHandler; 23 | import org.catacombae.storage.ps.PartitionSystemHandlerFactory; 24 | import org.catacombae.storage.ps.PartitionSystemImplementationInfo; 25 | 26 | /** 27 | * @author Erik Larsson 28 | */ 29 | public class EBRHandlerFactory extends PartitionSystemHandlerFactory { 30 | 31 | private static final EBRRecognizer recognizer = new EBRRecognizer(); 32 | 33 | @Override 34 | public PartitionSystemHandler createHandler(DataLocator data) { 35 | return new EBRHandler(data); 36 | } 37 | 38 | @Override 39 | public PartitionSystemImplementationInfo getInfo() { 40 | return new PartitionSystemImplementationInfo("Extended Boot Record", 41 | "Catacombae EBR PS Handler", "1.0", "Catacombae"); 42 | } 43 | 44 | @Override 45 | public PartitionSystemRecognizer getRecognizer() { 46 | return recognizer; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/mbr/MBRHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.mbr; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 22 | import org.catacombae.storage.ps.PartitionSystemHandler; 23 | import org.catacombae.storage.ps.PartitionSystemHandlerFactory; 24 | import org.catacombae.storage.ps.PartitionSystemImplementationInfo; 25 | 26 | /** 27 | * @author Erik Larsson 28 | */ 29 | public class MBRHandlerFactory extends PartitionSystemHandlerFactory { 30 | 31 | private static final MBRRecognizer recognizer = new MBRRecognizer(); 32 | 33 | @Override 34 | public PartitionSystemHandler createHandler(DataLocator data) { 35 | return new MBRHandler(data); 36 | } 37 | 38 | @Override 39 | public PartitionSystemImplementationInfo getInfo() { 40 | return new PartitionSystemImplementationInfo("Master Boot Record", 41 | "Catacombae MBR PS Handler", "1.0", "Catacombae"); 42 | } 43 | 44 | @Override 45 | public PartitionSystemRecognizer getRecognizer() { 46 | return recognizer; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonBTGenericDataRecord.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | import java.io.PrintStream; 21 | import org.catacombae.util.Util; 22 | 23 | /** 24 | * Record with unspecified data. 25 | * 26 | * @author Erik Larsson 27 | */ 28 | public class CommonBTGenericDataRecord extends CommonBTRecord { 29 | private final byte[] data; 30 | 31 | public CommonBTGenericDataRecord(byte[] data, int offset, int length) { 32 | this.data = new byte[length]; 33 | System.arraycopy(data, offset, this.data, 0, length); 34 | } 35 | 36 | @Override 37 | public int getSize() { 38 | return data.length; 39 | } 40 | 41 | @Override 42 | public byte[] getBytes() { 43 | return Util.createCopy(data); 44 | } 45 | 46 | public void print(PrintStream ps, String prefix) { 47 | ps.println(prefix + "CommonBTGenericDataRecord:"); 48 | printFields(ps, prefix + " "); 49 | } 50 | 51 | public void printFields(PrintStream ps, String prefix) { 52 | ps.println(prefix + "data: byte[" + data.length + "] (" + data + ")"); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/apm/APMHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.apm; 19 | 20 | import org.catacombae.storage.io.DataLocator; 21 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 22 | import org.catacombae.storage.ps.PartitionSystemHandler; 23 | import org.catacombae.storage.ps.PartitionSystemHandlerFactory; 24 | import org.catacombae.storage.ps.PartitionSystemImplementationInfo; 25 | 26 | /** 27 | * @author Erik Larsson 28 | */ 29 | public class APMHandlerFactory extends PartitionSystemHandlerFactory { 30 | private static final APMRecognizer recognizer = new APMRecognizer(); 31 | 32 | @Override 33 | public PartitionSystemHandler createHandler(DataLocator partitionData) { 34 | return new APMHandler(partitionData); 35 | } 36 | 37 | @Override 38 | public PartitionSystemImplementationInfo getInfo() { 39 | return new PartitionSystemImplementationInfo("Apple Partition Map", 40 | "Catacombae APM PS Handler", "1.0", "Catacombae"); 41 | } 42 | 43 | @Override 44 | public PartitionSystemRecognizer getRecognizer() { 45 | return recognizer; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogLeafRecordData.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.util.Util; 21 | import org.catacombae.csjc.PrintableStruct; 22 | import org.catacombae.csjc.StructElements; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public abstract class HFSPlusCatalogLeafRecordData implements PrintableStruct, StructElements { 28 | public static final int RECORD_TYPE_FOLDER = 0x0001; 29 | public static final int RECORD_TYPE_FILE = 0x0002; 30 | public static final int RECORD_TYPE_FOLDER_THREAD = 0x0003; 31 | public static final int RECORD_TYPE_FILE_THREAD = 0x0004; 32 | 33 | public abstract short getRecordType(); 34 | public String getRecordTypeAsString() { 35 | int recordType = Util.unsign(getRecordType()); 36 | if(recordType == RECORD_TYPE_FOLDER) return "kHFSPlusFolderRecord"; 37 | else if(recordType == RECORD_TYPE_FILE) return "kHFSPlusFileRecord"; 38 | else if(recordType == RECORD_TYPE_FOLDER_THREAD) return "kHFSPlusFolderThreadRecord"; 39 | else if(recordType == RECORD_TYPE_FILE_THREAD) return "kHFSPlusFileThreadRecord"; 40 | else return "UNKNOWN!"; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/PartitionSystemImplementationInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | /** 21 | * @author Erik Larsson 22 | */ 23 | public class PartitionSystemImplementationInfo { 24 | private String partitionSystemName; 25 | private String implementationName; 26 | private String implementationVersion; 27 | private String author; 28 | 29 | public PartitionSystemImplementationInfo(String partitionSystemName, 30 | String implementationName, String implementationVersion, 31 | String author) { 32 | this.partitionSystemName = partitionSystemName; 33 | this.implementationName = implementationName; 34 | this.implementationVersion = implementationVersion; 35 | this.author = author; 36 | } 37 | 38 | public String getPartitionSystemName() { 39 | return partitionSystemName; 40 | } 41 | 42 | public String getImplementationName() { 43 | return implementationName; 44 | } 45 | 46 | public String getImplementationVersion() { 47 | return implementationVersion; 48 | } 49 | 50 | public String getAuthor() { 51 | return author; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/SimplerFileFilter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * Even simpler file filter as it only allows one extension.
24 | * Directories are always accepted. 25 | * 26 | * @author Erik Larsson 27 | */ 28 | public class SimplerFileFilter extends javax.swing.filechooser.FileFilter { 29 | 30 | private String extension; 31 | private String description; 32 | 33 | public SimplerFileFilter(String extension, String description) { 34 | this.extension = extension; 35 | this.description = description; 36 | } 37 | 38 | /** {@inheritDoc} */ 39 | @Override 40 | public boolean accept(File f) { 41 | 42 | if(f.isDirectory()) 43 | return true; 44 | else if(f.getName().endsWith(extension)) 45 | return true; 46 | else 47 | return false; 48 | } 49 | 50 | /** {@inheritDoc} */ 51 | @Override 52 | public String getDescription() { return description; } 53 | 54 | /** 55 | * Returns the extension that this file filter matches. 56 | * @return the extension that this file filter matches. 57 | */ 58 | public String getExtension() { return extension; } 59 | } 60 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfsplus/HFSPlusCatalogIndexNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfsplus; 19 | 20 | import org.catacombae.hfs.types.hfsx.HFSXCatalogKey; 21 | import org.catacombae.util.Util; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public class HFSPlusCatalogIndexNode extends BTIndexNode { 27 | public HFSPlusCatalogIndexNode(byte[] data, int offset, int nodeSize) { 28 | this(data, offset, nodeSize, null); 29 | } 30 | protected HFSPlusCatalogIndexNode(byte[] data, int offset, int nodeSize, BTHeaderRec catalogHeaderRec) { 31 | super(data, offset, nodeSize); 32 | 33 | // Populate record list 34 | // we loop offsets.length-1 times, since last offset is offset to free space 35 | for(int i = 0; i < records.length; ++i) { 36 | int currentOffset = Util.unsign(offsets[i]); 37 | HFSPlusCatalogKey currentKey; 38 | if(catalogHeaderRec == null) 39 | currentKey = new HFSPlusCatalogKey(data, offset+currentOffset); 40 | else 41 | currentKey = 42 | new HFSXCatalogKey(data, offset + currentOffset, 43 | catalogHeaderRec.getKeyCompareType()); 44 | records[i] = new BTIndexRecord(currentKey, data, offset+currentOffset); 45 | } 46 | } 47 | //public static 48 | } 49 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/gpt/GPTRecognizer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.gpt; 19 | 20 | import org.catacombae.storage.ps.PartitionSystemRecognizer; 21 | import org.catacombae.io.ReadableRandomAccessStream; 22 | import org.catacombae.storage.ps.gpt.types.GPTHeader; 23 | 24 | /** 25 | * @author Erik Larsson 26 | */ 27 | public class GPTRecognizer implements PartitionSystemRecognizer { 28 | 29 | public boolean detect(ReadableRandomAccessStream fsStream, long offset, long length) { 30 | try { 31 | //ReadableRandomAccessStream llf = data.createReadOnlyFile(); 32 | byte[] secondBlock = new byte[512]; 33 | fsStream.seek(512); 34 | fsStream.readFully(secondBlock); 35 | 36 | // Look for GPT 37 | // Let's assume that blocks are always 512 bytes in size with MBR and GPT. I don't know 38 | // how to detect the actual block size (at least when reading from a file, otherwise I 39 | // guess there are system specific ways)... 40 | GPTHeader gh = new GPTHeader(secondBlock, 0, 512); 41 | if(gh.isValid()) { 42 | return true; 43 | } 44 | } catch(Exception e) { 45 | } 46 | 47 | return false; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/mbr/types/MutableMBRPartition.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.mbr.types; 19 | 20 | import org.catacombae.util.Util; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public class MutableMBRPartition extends MBRPartition { 26 | 27 | public MutableMBRPartition(MBRPartition source) { 28 | super(source); 29 | } 30 | public void setStatus(byte b) { status[0] = b; } 31 | public void setFirstSector(byte[] chs, int off) { copyData(chs, off, firstSector); } 32 | public void setPartitionType(byte b) { partitionType[0] = b; } 33 | public void setLastSector(byte[] chs, int off) { copyData(chs, off, lastSector); } 34 | public void setLBAFirstSector(int lba) { Util.arrayCopy(Util.toByteArrayLE(lba), lbaFirstSector); } 35 | public void setLBAPartitionLength(int lba) { Util.arrayCopy(Util.toByteArrayLE(lba), lbaPartitionLength); } 36 | 37 | private static void copyData(byte[] data, int off, byte[] dest) { 38 | copyData(data, off, dest, dest.length); 39 | } 40 | private static void copyData(byte[] data, int off, byte[] dest, int len) { 41 | if(off+len > data.length) 42 | throw new IllegalArgumentException("Length of input data must be " + len + "."); 43 | System.arraycopy(data, off, dest, 0, len); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/Partition.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006-2009 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | import org.catacombae.csjc.PrintableStruct; 21 | 22 | /** 23 | *
24 |  * A partition is a string of bytes. It is a substring of some possibly larger
25 |  * string of bytes (usually representing a physical device holding the data,
26 |  * such as a hard disk, a memory stick or an optical disc).
27 |  *
28 |  * A partition usually has metadata asssociated with it, facilitating the
29 |  * interpretation of the data inside the partition. This simple abstraction
30 |  * produces three fundamental variables:
31 |  * the start offset, the length of the partition and the partition type.
32 |  *
33 |  * While most partition systems specify their offsets in sectors or blocks, the
34 |  * unit of this general partition will be one byte, so most implementations will
35 |  * need to convert from the native sector number to an actual byte offset/length.
36 |  * 
37 | * 38 | * @author Erik Larsson 39 | */ 40 | public interface Partition extends PrintableStruct { 41 | /** Returns the start offset in bytes. */ 42 | public abstract long getStartOffset(); 43 | 44 | /** Returns the length of the partition in bytes. */ 45 | public abstract long getLength(); 46 | 47 | /** Returns the type of the partition. */ 48 | public abstract PartitionType getType(); 49 | } 50 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/gui/StructViewPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/io/SubDataLocator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2009 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.io; 19 | 20 | import org.catacombae.io.ConcatenatedStream; 21 | import org.catacombae.io.RandomAccessStream; 22 | import org.catacombae.io.ReadableConcatenatedStream; 23 | import org.catacombae.io.ReadableRandomAccessStream; 24 | 25 | /** 26 | * @author Erik Larsson 27 | */ 28 | public class SubDataLocator extends DataLocator { 29 | private DataLocator source; 30 | private long offset; 31 | private long length; 32 | 33 | public SubDataLocator(DataLocator source, long offset, long length) { 34 | this.source = source; 35 | this.offset = offset; 36 | this.length = length; 37 | 38 | this.source.addReference(this); 39 | } 40 | 41 | @Override 42 | public ReadableRandomAccessStream createReadOnlyFile() { 43 | return new ReadableConcatenatedStream(source.createReadOnlyFile(), offset, length); 44 | } 45 | 46 | @Override 47 | public boolean isWritable() { 48 | return source.isWritable(); 49 | } 50 | 51 | @Override 52 | public RandomAccessStream createReadWriteFile() throws UnsupportedOperationException { 53 | return new ConcatenatedStream(source.createReadWriteFile(), offset, length); 54 | } 55 | 56 | @Override 57 | protected void releaseResources() { 58 | source.removeReference(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /doc/bugs.txt: -------------------------------------------------------------------------------- 1 | 2007-06-27 2 | ---------- 3 | - INVALID? Discovered that the dates are incorrect... need to 4 | revise the date calculation mechanism... 5 | UPDATE: Can't reproduce this bug, everything seems fine. 6 | UPDATE2: Experiemented with dates and time zones in Mac OS X and 7 | discoverered that sometimes it does behave strangely, with a half 8 | hour offset added without reason. This must be investigated at 9 | some point. 10 | 11 | 2008-07-18 12 | ---------- 13 | - Launcher: With the current argument structure, a user can NEVER 14 | open a file called "-invokeuac". 15 | It's not very likely that any that anyone would need to open a 16 | file by that name, but HFSExplorer should be able to handle it. 17 | Proposed solution: 18 | The switch 19 | -invokeuac 20 | is replaced by: 21 | -- -invokeuac 22 | This means that one of the arguments "--" or "-invokeuac" is not 23 | alone sufficient to trigger elevation. This means that 24 | hfsexplorer.exe can easily be run with "hfsexplorer.exe --" for a 25 | file called "--" or "hfsexplorer.exe -invokeuac" for a file called 26 | "-invokeuac". 27 | As long as we only allow one file at a time to be opened by 28 | HFSExplorer, this scheme will work for all cases. 29 | 30 | - FileSystemBrowserWindow.main: A problem similar to the above issue 31 | occurs with the switch "-dbgconsole". A similar solution should be 32 | developed. Make sure the two solutions don't invalidate each other. 33 | 34 | 2008-10-04 35 | ---------- 36 | - Sometimes the title of the backing storage (filename/device 37 | path/device path with partition system and number) is displayed 38 | incorrectly, for example when we load Partition0 with MBR partition 39 | scheme and a partition number, only Partition0 is displayed. 40 | Ex. runfsb \\?\GLOBALROOT\Device\Harddisk3\Partition0 41 | 42 | 2014-08-27 43 | ---------- 44 | - Browsing into self-referring symlink hierarchies is halted after some level of 45 | symlinks. Could have something to do with cyclic symlink detection code... 46 | E.g. we have "/usr/X11" with target ".". Then we browse to "/usr/X11" in 47 | HFSExplorer, browse to "/usr/X11/X11", then to "/usr/X11/X11", ... and at some 48 | point HFSExplorer throws an exception. 49 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/tools/PrintMBRPartitions.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2007-2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer.tools; 19 | 20 | import java.io.FileOutputStream; 21 | import org.catacombae.storage.ps.mbr.types.MBRPartitionTable; 22 | import org.catacombae.storage.io.win32.ReadableWin32FileStream; 23 | import org.catacombae.io.ReadableFileStream; 24 | import org.catacombae.io.ReadableRandomAccessStream; 25 | 26 | /** 27 | * @author Erik Larsson 28 | */ 29 | public class PrintMBRPartitions { 30 | 31 | public static void main(String[] args) throws Exception { 32 | ReadableRandomAccessStream llf; 33 | if(ReadableWin32FileStream.isSystemSupported()) 34 | llf = new ReadableWin32FileStream(args[0]); 35 | else 36 | llf = new ReadableFileStream(args[0]); 37 | 38 | byte[] referencetable = new byte[512]; 39 | llf.seek(0); 40 | llf.readFully(referencetable); 41 | FileOutputStream refFile = new FileOutputStream("mbr_table.debug"); 42 | refFile.write(referencetable); 43 | refFile.close(); 44 | System.out.println("Wrote the raw MBR table to file: mbr_table.debug"); 45 | 46 | System.out.println("Length of file: " + llf.length()); 47 | MBRPartitionTable mbr = new MBRPartitionTable(llf, 0); 48 | mbr.print(System.out, ""); 49 | System.out.println("Is this partition table valid? " + mbr.isValid() + "."); 50 | 51 | llf.close(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/container/ContainerHandler.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps.container; 19 | 20 | import org.catacombae.storage.fs.FileSystemMajorType; 21 | import org.catacombae.storage.ps.PartitionSystemType; 22 | 23 | /** 24 | * @author Erik Larsson 25 | */ 26 | public abstract class ContainerHandler { 27 | /** Returns true if the container contains a file system. */ 28 | public abstract boolean containsFileSystem(); 29 | 30 | /** Returns true if the container contains a partition system. */ 31 | public abstract boolean containsPartitionSystem(); 32 | 33 | /** Returns true if the container contains another container. */ 34 | public abstract boolean containsContainer(); 35 | 36 | /** 37 | * Probes for the file system type contained within this container. Returns 38 | * null if the file system type could not be determined. 39 | */ 40 | public abstract FileSystemMajorType detectFileSystemType(); 41 | 42 | /** 43 | * Probes for the partition system type contained within this container. 44 | * Returns null if the partition system type could not be determined. 45 | */ 46 | public abstract PartitionSystemType detectPartitionSystemType(); 47 | 48 | /** 49 | * Probes for the container type contained within this container. 50 | * Returns null if the container type could not be determined. 51 | */ 52 | public abstract ContainerType detectContainerType(); 53 | } 54 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/hfscommon/HFSCommonFileSystemHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2009-2014 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs.hfscommon; 19 | 20 | import org.catacombae.storage.fs.FileSystemHandlerFactory; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class HFSCommonFileSystemHandlerFactory extends FileSystemHandlerFactory { 26 | protected static final CustomAttribute posixFilenamesAttribute = 27 | createCustomAttribute(AttributeType.BOOLEAN, "POSIX_FILENAMES", 28 | "Controls whether filenames should be translated from " + 29 | "their on-disk format to POSIX format, swapping the ':' " + 30 | "and '/' characters.", false); 31 | 32 | protected static final CustomAttribute sfmSubstitutionsAttribute = 33 | createCustomAttribute(AttributeType.BOOLEAN, "SFM_SUBSTITUTIONS", 34 | "Controls whether filename characters that are invalid " + 35 | "in Windows filesystems should be remapped to characters " + 36 | "in the Unicode private range using the same method used " + 37 | "in Microsoft's now defunct Services for Mac software.", 38 | false); 39 | 40 | public CustomAttribute[] getSupportedCustomAttributes() { 41 | return new CustomAttribute[] { 42 | posixFilenamesAttribute, 43 | sfmSubstitutionsAttribute, 44 | }; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/ps/StandardPartition.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.ps; 19 | 20 | import java.io.PrintStream; 21 | 22 | /** 23 | * A basic implementation of the Partition interface, which just takes the 24 | * variables as parameters. 25 | * 26 | * @author Erik Larsson 27 | */ 28 | public class StandardPartition implements Partition { 29 | private final long startOffset; 30 | private final long length; 31 | private final PartitionType type; 32 | 33 | public StandardPartition(long startOffset, long length, PartitionType type) { 34 | this.startOffset = startOffset; 35 | this.length = length; 36 | this.type = type; 37 | } 38 | 39 | /* @Override */ 40 | public long getStartOffset() { 41 | return startOffset; 42 | } 43 | 44 | /* @Override */ 45 | public long getLength() { 46 | return length; 47 | } 48 | 49 | /* @Override */ 50 | public PartitionType getType() { 51 | return type; 52 | } 53 | 54 | /* @Override */ 55 | public void printFields(PrintStream ps, String prefix) { 56 | ps.println(prefix + "startOffset: " + startOffset); 57 | ps.println(prefix + "length: " + length); 58 | ps.println(prefix + "type: " + type); 59 | } 60 | 61 | /* @Override */ 62 | public void print(PrintStream ps, String prefix) { 63 | ps.println(prefix + getClass().getSimpleName()); 64 | printFields(ps, prefix + " "); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfsexplorer/SimpleFileFilter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2006 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfsexplorer; 19 | 20 | import java.io.File; 21 | import java.util.Iterator; 22 | import java.util.LinkedList; 23 | import javax.swing.filechooser.FileFilter; 24 | 25 | /** 26 | * @author Erik Larsson 27 | */ 28 | public class SimpleFileFilter extends FileFilter { 29 | private final LinkedList extensions; 30 | private String description; 31 | 32 | public SimpleFileFilter() { 33 | extensions = new LinkedList(); 34 | description = ""; 35 | } 36 | 37 | public void addExtension(String extension) { 38 | extensions.add(extension); 39 | } 40 | 41 | public void setDescription(String idescription) { 42 | description = idescription; 43 | } 44 | 45 | public void removeExtension(String iextension) { 46 | final Iterator it = extensions.iterator(); 47 | while(it.hasNext()) { 48 | if(it.next().equals(iextension)) { 49 | it.remove(); 50 | } 51 | } 52 | } 53 | 54 | public boolean accept(File f) { 55 | 56 | if(f.isDirectory()) 57 | return true; 58 | 59 | for(String curExtension : extensions) { 60 | if(f.getName().endsWith(curExtension)) { 61 | return true; 62 | } 63 | } 64 | 65 | return false; 66 | } 67 | 68 | public String getDescription() { 69 | return description; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/java/org/catacombae/hfs/types/hfscommon/CommonHFSAttributesIndexNode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008-2012 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.hfs.types.hfscommon; 19 | 20 | import org.catacombae.hfs.types.hfsplus.HFSPlusAttributesKey; 21 | 22 | /** 23 | * @author Erik Larsson 24 | */ 25 | public abstract class CommonHFSAttributesIndexNode 26 | extends CommonBTKeyedNode> 27 | { 28 | protected CommonHFSAttributesIndexNode(byte[] data, int offset, 29 | int nodeSize, FSType type) 30 | { 31 | super(data, offset, nodeSize, type); 32 | } 33 | 34 | public static CommonHFSAttributesIndexNode createHFSPlus(byte[] data, 35 | int offset, int nodeSize) 36 | { 37 | return new HFSPlusImplementation(data, offset, nodeSize); 38 | } 39 | 40 | public static class HFSPlusImplementation 41 | extends CommonHFSAttributesIndexNode 42 | { 43 | public HFSPlusImplementation(byte[] data, int offset, int nodeSize) { 44 | super(data, offset, nodeSize, FSType.HFS_PLUS); 45 | } 46 | 47 | @Override 48 | protected CommonBTIndexRecord createBTRecord( 49 | int recordNumber, byte[] data, int offset, int length) 50 | { 51 | final CommonHFSAttributesKey key = CommonHFSAttributesKey.create( 52 | new HFSPlusAttributesKey(data, offset)); 53 | 54 | return CommonBTIndexRecord.createHFSPlus(key, data, offset); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/java/org/catacombae/storage/fs/FSLink.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (C) 2008 Erik Larsson 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package org.catacombae.storage.fs; 19 | 20 | /** 21 | * This class represents a link in a file system, i.e. a point of redirection to another part of 22 | * the file system. In Unix, this is equivalent to a "symbolic link". Unix hard links should be 23 | * modeled as FSFile or FSFolder types, as they're not strictly links, but just two equal file 24 | * system entries that point to the same location (there is no "source file" for the link, but 25 | * instead an inode). 26 | * 27 | * @author Erik Larsson 28 | */ 29 | public interface FSLink extends FSEntry { 30 | 31 | /** 32 | * Tries to resolve the target of the link in the context of its file system. If the link is 33 | * invalid, this method will return null. 34 | * 35 | * @param parentDir a path to the parent directory of the link (needed for links that use 36 | * relative pathnames). 37 | * @return the target of this link, if possible, or null if the link was invalid. 38 | */ 39 | public FSEntry getLinkTarget(String[] parentDir); 40 | 41 | /** 42 | * Returns a context specific string which shows the intended target for this link in the syntax 43 | * of its file system. This string is only for display purposes in info boxes or debug messages. 44 | * It doesn't have any specified format. 45 | * 46 | * @return a context specific string which shows the intended target for this link. 47 | */ 48 | public String getLinkTargetString(); 49 | } 50 | --------------------------------------------------------------------------------