Versions in this module Expand all Collapse all v0 v0.1.0 Jun 15, 2025 Changes in this version + const CodeSignatureBlobMinSize + const LoadCommandMinSize + const MagicNumberSize + func IsSingleArchitecture(head []byte) bool + func IsUniversal(head []byte) bool + type Alignment uint32 + func (align Alignment) Bytes() (_ uint64, ok bool) + func (align Alignment) String() string + type CPUType uint32 + const CPUTypeARM + const CPUTypeARM64 + const CPUTypeARM64_32 + const CPUTypeHPPA + const CPUTypeI386 + const CPUTypeI860 + const CPUTypeMC680x0 + const CPUTypeMC88000 + const CPUTypeMC98000 + const CPUTypePowerPC + const CPUTypePowerPC64 + const CPUTypeSPARC + const CPUTypeVAX + const CPUTypeX86_64 + func (ct CPUType) Is64Bit() bool + func (i CPUType) String() string + type CodeDirectory struct + CodeLimit uint64 + ExecutableSegmentBase uint64 + ExecutableSegmentFlags uint64 + ExecutableSegmentLimit uint64 + Flags CodeSignatureFlags + HashData []byte + HashType HashType + Identifier string + PageSize Alignment + Platform uint8 + SpecialSlotCount uint32 + TeamIdentifier string + func (cd *CodeDirectory) HashSlotCount() int + func (cd *CodeDirectory) HashSlots() iter.Seq2[int, []byte] + func (cd *CodeDirectory) UnmarshalBinary(data []byte) error + type CodeSignatureBlob struct + Data []byte + Magic CodeSignatureMagic + func (blob *CodeSignatureBlob) UnmarshalBinary(data []byte) error + func (blob CodeSignatureBlob) AppendBinary(dst []byte) ([]byte, error) + func (blob CodeSignatureBlob) MarshalBinary() ([]byte, error) + type CodeSignatureFlags uint32 + const CodeSignatureAdHoc + const CodeSignatureCheckExpiration + const CodeSignatureEnforcement + const CodeSignatureHard + const CodeSignatureKill + const CodeSignatureLinkerSigned + const CodeSignatureRequireLV + const CodeSignatureRestrict + const CodeSignatureRuntime + type CodeSignatureMagic uint32 + const CodeSignatureMagicBlobWrapper + const CodeSignatureMagicCodeDirectory + const CodeSignatureMagicDetachedSignature + const CodeSignatureMagicEmbeddedEntitlements + const CodeSignatureMagicEmbeddedSignature + const CodeSignatureMagicRequirement + const CodeSignatureMagicRequirements + func (i CodeSignatureMagic) String() string + type CommandReader struct + func (r *CommandReader) Command() (_ LoadCmd, ok bool) + func (r *CommandReader) Err() error + func (r *CommandReader) Next() bool + func (r *CommandReader) Read(p []byte) (n int, err error) + func (r *CommandReader) Size() (_ uint32, ok bool) + type FileHeader struct + AddressWidth int + ByteOrder binary.ByteOrder + CPUSubtype uint32 + CPUType CPUType + LoadCommandCount uint32 + LoadCommandRegionSize uint32 + Type Type + func ReadFileHeader(r io.Reader) (*FileHeader, error) + func (hdr *FileHeader) DataOffset() int64 + func (hdr *FileHeader) LoadCommandsOffset() int64 + func (hdr *FileHeader) NewCommandReader(r io.Reader) *CommandReader + type HashType uint8 + const HashTypeSHA1 + const HashTypeSHA256 + const HashTypeSHA256Truncated + const HashTypeSHA384 + func (ht HashType) Size() (_ int, ok bool) + func (i HashType) String() string + type LinkeditDataCommand struct + Command LoadCmd + DataOffset uint32 + DataSize uint32 + func (cmd *LinkeditDataCommand) UnmarshalMachO(byteOrder binary.ByteOrder, data []byte) error + type LoadCmd uint32 + const LoadCmdBuildVersion + const LoadCmdCodeSignature + const LoadCmdDataInCode + const LoadCmdDyldInfo + const LoadCmdDyldInfoOnly + const LoadCmdDysymtab + const LoadCmdFunctionStarts + const LoadCmdIDDylinker + const LoadCmdLoadDylib + const LoadCmdLoadDylinker + const LoadCmdMain + const LoadCmdRPath + const LoadCmdSegment + const LoadCmdSegment64 + const LoadCmdSourceVersion + const LoadCmdSymtab + const LoadCmdThread + const LoadCmdUUID + const LoadCmdUnixThread + func (i LoadCmd) String() string + type Section struct + Address uint64 + Alignment Alignment + Flags uint32 + Offset uint32 + RawName [16]byte + RawSegmentName [16]byte + RelocationCount uint32 + RelocationOffset uint32 + Size uint64 + func (s *Section) Name() string + func (s *Section) SegmentName() string + type SegmentCommand struct + Command LoadCmd + FileOffset uint64 + FileSize uint64 + Flags uint32 + InitProtection VirtualMemoryProtection + MaxProtection VirtualMemoryProtection + RawName [16]byte + Sections []Section + VirtualMemoryAddress uint64 + VirtualMemorySize uint64 + func (cmd *SegmentCommand) Name() string + func (cmd *SegmentCommand) UnmarshalMachO(byteOrder binary.ByteOrder, data []byte) error + type SuperBlob struct + Blobs []SuperBlobEntry + Magic CodeSignatureMagic + func (blob *SuperBlob) UnmarshalBinary(data []byte) error + type SuperBlobEntry struct + Blob CodeSignatureBlob + Type SuperBlobSlot + type SuperBlobSlot uint32 + const SuperBlobApplicationSlot + const SuperBlobCodeDirectorySlot + const SuperBlobEntitlementsSlot + const SuperBlobInfoSlot + const SuperBlobRequirementsSlot + const SuperBlobResourceDirSlot + func (i SuperBlobSlot) String() string + type Type uint32 + const TypeBundle + const TypeDylib + const TypeExec + const TypeObj + type UUIDCommand struct + UUID uuid.UUID + func (cmd *UUIDCommand) UnmarshalMachO(byteOrder binary.ByteOrder, data []byte) error + type UniversalFileEntry struct + Alignment Alignment + CPU CPUType + CPUSubtype uint32 + Offset uint32 + Size uint32 + func ReadUniversalHeader(r io.Reader) ([]UniversalFileEntry, error) + func (ent *UniversalFileEntry) UnmarshalBinary(data []byte) error + type VirtualMemoryProtection uint32 + const VirtualMemoryExecutePermission + const VirtualMemoryReadPermission + const VirtualMemoryWritePermission v0.1.0-rc2 Jun 4, 2025