Documentation ¶
Index ¶
- Variables
- type BuildVersion
- type CodeSignature
- type DataInCode
- type DyldChainedFixups
- type DyldEnvironment
- type DyldExportsTrie
- type DyldInfo
- type DyldInfoOnly
- type Dylib
- type DylibID
- type DylinkerID
- type Dysymtab
- type EncryptionInfo
- type EncryptionInfo64
- type EntryPoint
- type FatArch
- type FatArchHeader
- type FatFile
- type File
- func (f *File) BuildVersion() *BuildVersion
- func (f *File) Close() error
- func (f *File) CodeSignature() *CodeSignature
- func (f *File) DWARF() (*dwarf.Data, error)
- func (f *File) DyldChainedFixups() (*fixupchains.DyldChainedFixups, error)
- func (f *File) DyldExportsTrie() *DyldExportsTrie
- func (f *File) DyldInfo() *DyldInfo
- func (f *File) DylibID() *DylibID
- func (f *File) FindAddressSymbols(addr uint64) ([]Symbol, error)
- func (f *File) FindSectionForVMAddr(vmAddr uint64) *Section
- func (f *File) FindSymbolAddress(symbol string) (uint64, error)
- func (f *File) FunctionStartAddrs(data ...byte) []uint64
- func (f *File) FunctionStarts() *FunctionStarts
- func (f *File) GetBaseAddress() uint64
- func (f *File) GetBindName(pointer uint64) (string, error)
- func (f *File) GetCFStrings() ([]objc.CFString, error)
- func (f *File) GetCString(strVMAdr uint64) (string, error)
- func (f *File) GetCStringAtOffset(strOffset int64) (string, error)
- func (f *File) GetMangledTypeAtOffset(offset int64) (string, *stypes.TypeDescriptor, error)
- func (f *File) GetObjCCategories() ([]objc.Category, error)
- func (f *File) GetObjCClass(vmaddr uint64) (*objc.Class, error)
- func (f *File) GetObjCClassInfo(vmAddr uint64) (*objc.ClassRO64, error)
- func (f *File) GetObjCClasses() ([]objc.Class, error)
- func (f *File) GetObjCImageInfo() (*objc.ImageInfo, error)
- func (f *File) GetObjCInfo() objc.Info
- func (f *File) GetObjCIvars(vmAddr uint64) ([]objc.Ivar, error)
- func (f *File) GetObjCMethodList() ([]objc.Method, error)
- func (f *File) GetObjCMethodNames() (map[string]uint64, error)
- func (f *File) GetObjCMethods(vmAddr uint64) ([]objc.Method, error)
- func (f *File) GetObjCPlusLoadClasses() ([]objc.Class, error)
- func (f *File) GetObjCProperties(vmAddr uint64) ([]objc.Property, error)
- func (f *File) GetObjCProtocols() ([]objc.Protocol, error)
- func (f *File) GetObjCSelectorReferences() (map[uint64]*objc.Selector, error)
- func (f *File) GetOffset(address uint64) (int64, error)
- func (f *File) GetSwiftAssociatedTypes() (*[]swift.AssociatedTypeDescriptor, error)
- func (f *File) GetSwiftBuiltinTypes() (*[]swift.BuiltinType, error)
- func (f *File) GetSwiftClosures() (*[]swift.CaptureDescriptor, error)
- func (f *File) GetSwiftFields() (*[]fieldmd.Field, error)
- func (f *File) GetSwiftProtocolConformances() (*[]protocols.ConformanceDescriptor, error)
- func (f *File) GetSwiftProtocols() (*[]protocols.Protocol, error)
- func (f *File) GetSwiftTypes() (*[]stypes.TypeDescriptor, error)
- func (f *File) GetVMAddress(offset uint64) (uint64, error)
- func (f *File) HasFixups() bool
- func (f *File) HasObjC() bool
- func (f *File) HasObjCMessageReferences() bool
- func (f *File) HasPlusLoadMethod() bool
- func (f *File) ImportedLibraries() []string
- func (f *File) ImportedSymbolNames() ([]string, error)
- func (f *File) ImportedSymbols() ([]Symbol, error)
- func (f *File) LibraryOrdinalName(libraryOrdinal int) string
- func (f *File) Section(segment, section string) *Section
- func (f *File) Segment(name string) *Segment
- func (f *File) Segments() []*Segment
- func (f *File) SourceVersion() *SourceVersion
- func (f *File) UUID() *UUID
- type FileTOC
- func (t *FileTOC) AddLoad(l Load)
- func (t *FileTOC) AddSection(s *Section)
- func (t *FileTOC) AddSegment(s *Segment)
- func (t *FileTOC) DerivedCopy(Type types.HeaderFileType, Flags types.HeaderFlag) *FileTOC
- func (t *FileTOC) FileSize() uint64
- func (t *FileTOC) HdrSize() uint32
- func (t *FileTOC) LoadAlign() uint64
- func (t *FileTOC) LoadSize() uint32
- func (t *FileTOC) LoadsString() string
- func (t *FileTOC) Put(buffer []byte) int
- func (t *FileTOC) String() string
- func (t *FileTOC) SymbolSize() uint32
- func (t *FileTOC) TOCSize() uint32
- type FilesetEntry
- type FormatError
- type FunctionStarts
- type LazyLoadDylib
- type LinkEditData
- type Load
- type LoadBytes
- type LoadCmdBytes
- type LoadDylinker
- type ReExportDylib
- type Regs386
- type RegsAMD64
- type RegsARM
- type RegsARM64
- type Reloc
- type Routines64
- type Rpath
- type Section
- func (s *Section) Copy() *Section
- func (s *Section) Data() ([]byte, error)
- func (s *Section) Open() io.ReadSeeker
- func (s *Section) Put32(b []byte, o binary.ByteOrder) int
- func (s *Section) Put64(b []byte, o binary.ByteOrder) int
- func (s *Section) PutData(b []byte)
- func (s *Section) PutRelocs(b []byte, o binary.ByteOrder) int
- func (s *Section) PutUncompressedData(b []byte)
- func (s *Section) UncompressedSize() uint64
- type SectionHeader
- type Segment
- func (s *Segment) Copy() *Segment
- func (s *Segment) CopyZeroed() *Segment
- func (s *Segment) Data() ([]byte, error)
- func (s *Segment) LoadSize(t *FileTOC) uint32
- func (s *Segment) Open() io.ReadSeeker
- func (s *Segment) Put32(b []byte, o binary.ByteOrder) int
- func (s *Segment) Put64(b []byte, o binary.ByteOrder) int
- func (s *Segment) String() string
- func (s *Segment) UncompressedSize(t *FileTOC, align uint64) uint64
- type SegmentHeader
- type SourceVersion
- type SplitInfo
- type SubClient
- type SubFramework
- type Symbol
- type Symtab
- type UUID
- type UnixThread
- type UpwardDylib
- type VersionMinMacOSX
- type VersionMinTvOS
- type VersionMinWatchOS
- type VersionMiniPhoneOS
- type WeakDylib
Constants ¶
This section is empty.
Variables ¶
var ErrNotFat = &FormatError{0, "not a fat Mach-O file", nil}
ErrNotFat is returned from NewFatFile or OpenFat when the file is not a universal binary but may be a thin binary, based on its magic number.
Functions ¶
This section is empty.
Types ¶
type BuildVersion ¶
type BuildVersion struct { LoadBytes types.BuildVersionCmd Platform string /* platform */ Minos string /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ Sdk string /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ NumTools uint32 /* number of tool entries following this */ Tool string ToolVersion string }
A BuildVersion represents a Mach-O build for platform min OS version.
func (*BuildVersion) String ¶ added in v1.0.4
func (b *BuildVersion) String() string
type CodeSignature ¶
type CodeSignature struct { LoadBytes types.CodeSignatureCmd Offset uint32 Size uint32 ctypes.CodeSignature }
func (*CodeSignature) String ¶ added in v1.0.8
func (c *CodeSignature) String() string
type DataInCode ¶
type DataInCode struct { LoadBytes types.DataInCodeCmd Offset uint32 Size uint32 Entries []types.DataInCodeEntry }
A DataInCode represents a Mach-O data in code command.
func (*DataInCode) String ¶ added in v1.0.8
func (d *DataInCode) String() string
type DyldChainedFixups ¶ added in v1.0.6
type DyldChainedFixups struct { LoadBytes types.DyldChainedFixupsCmd Offset uint32 Size uint32 Data []byte }
A DyldChainedFixups used with linkedit_data_command
func (*DyldChainedFixups) String ¶ added in v1.0.6
func (cf *DyldChainedFixups) String() string
type DyldEnvironment ¶ added in v1.0.13
type DyldEnvironment struct { LoadBytes types.DyldEnvironmentCmd Name string }
A DyldEnvironment is a string for dyld to treat like environment variable
func (*DyldEnvironment) String ¶ added in v1.0.13
func (d *DyldEnvironment) String() string
type DyldExportsTrie ¶ added in v1.0.6
type DyldExportsTrie struct { LoadBytes types.DyldExportsTrieCmd Offset uint32 Size uint32 Data []byte }
A DyldExportsTrie used with linkedit_data_command, payload is trie
func (*DyldExportsTrie) String ¶ added in v1.0.6
func (t *DyldExportsTrie) String() string
type DyldInfo ¶
type DyldInfo struct { LoadBytes types.DyldInfoCmd RebaseOff uint32 // file offset to rebase info RebaseSize uint32 // size of rebase info BindOff uint32 // file offset to binding info BindSize uint32 // size of binding info WeakBindOff uint32 // file offset to weak binding info WeakBindSize uint32 // size of weak binding info LazyBindOff uint32 // file offset to lazy binding info LazyBindSize uint32 // size of lazy binding info ExportOff uint32 // file offset to export info ExportSize uint32 // size of export info }
A DyldInfo represents a Mach-O id dyld info command.
type DyldInfoOnly ¶ added in v1.0.8
type DyldInfoOnly struct { LoadBytes types.DyldInfoOnlyCmd RebaseOff uint32 // file offset to rebase info RebaseSize uint32 // size of rebase info BindOff uint32 // file offset to binding info BindSize uint32 // size of binding info WeakBindOff uint32 // file offset to weak binding info WeakBindSize uint32 // size of weak binding info LazyBindOff uint32 // file offset to lazy binding info LazyBindSize uint32 // size of lazy binding info ExportOff uint32 // file offset to export info ExportSize uint32 // size of export info }
DyldInfoOnly is compressed dyld information only
func (*DyldInfoOnly) Copy ¶ added in v1.0.8
func (d *DyldInfoOnly) Copy() *DyldInfoOnly
func (*DyldInfoOnly) LoadSize ¶ added in v1.0.8
func (d *DyldInfoOnly) LoadSize(t *FileTOC) uint32
func (*DyldInfoOnly) Put ¶ added in v1.0.8
func (d *DyldInfoOnly) Put(b []byte, o binary.ByteOrder) int
func (*DyldInfoOnly) String ¶ added in v1.0.8
func (d *DyldInfoOnly) String() string
type Dylib ¶
type Dylib struct { LoadBytes types.DylibCmd Name string Time uint32 CurrentVersion string CompatVersion string }
A Dylib represents a Mach-O load dynamic library command.
type DylibID ¶
type DylibID Dylib
A DylibID represents a Mach-O load dynamic library ident command.
type DylinkerID ¶ added in v1.0.26
type DylinkerID struct { LoadBytes types.DylinkerIDCmd Name string }
DylinkerID dynamic linker identification
func (*DylinkerID) String ¶ added in v1.0.26
func (d *DylinkerID) String() string
type Dysymtab ¶
type Dysymtab struct { LoadBytes types.DysymtabCmd IndirectSyms []uint32 // indices into Symtab.Syms }
A Dysymtab represents a Mach-O dynamic symbol table command.
type EncryptionInfo ¶ added in v1.0.26
type EncryptionInfo struct { LoadBytes types.EncryptionInfoCmd Offset uint32 // file offset of encrypted range Size uint32 // file size of encrypted range CryptID types.EncryptionSystem // which enryption system, 0 means not-encrypted yet }
A EncryptionInfo represents a Mach-O 32-bit encrypted segment information
func (*EncryptionInfo) Copy ¶ added in v1.0.26
func (e *EncryptionInfo) Copy() *EncryptionInfo
func (*EncryptionInfo) LoadSize ¶ added in v1.0.26
func (e *EncryptionInfo) LoadSize(t *FileTOC) uint32
func (*EncryptionInfo) Put ¶ added in v1.0.26
func (e *EncryptionInfo) Put(b []byte, o binary.ByteOrder) int
func (*EncryptionInfo) String ¶ added in v1.0.26
func (e *EncryptionInfo) String() string
type EncryptionInfo64 ¶ added in v1.0.6
type EncryptionInfo64 struct { LoadBytes types.EncryptionInfo64Cmd Offset uint32 // file offset of encrypted range Size uint32 // file size of encrypted range CryptID types.EncryptionSystem // which enryption system, 0 means not-encrypted yet }
A EncryptionInfo64 represents a Mach-O 64-bit encrypted segment information
func (*EncryptionInfo64) Copy ¶ added in v1.0.6
func (e *EncryptionInfo64) Copy() *EncryptionInfo64
func (*EncryptionInfo64) LoadSize ¶ added in v1.0.6
func (e *EncryptionInfo64) LoadSize(t *FileTOC) uint32
func (*EncryptionInfo64) Put ¶ added in v1.0.6
func (e *EncryptionInfo64) Put(b []byte, o binary.ByteOrder) int
func (*EncryptionInfo64) String ¶ added in v1.0.6
func (e *EncryptionInfo64) String() string
type EntryPoint ¶ added in v1.0.4
type EntryPoint struct { LoadBytes types.EntryPointCmd EntryOffset uint64 StackSize uint64 }
func (*EntryPoint) Copy ¶ added in v1.0.4
func (e *EntryPoint) Copy() *EntryPoint
func (*EntryPoint) LoadSize ¶ added in v1.0.4
func (e *EntryPoint) LoadSize(t *FileTOC) uint32
func (*EntryPoint) Put ¶ added in v1.0.4
func (e *EntryPoint) Put(b []byte, o binary.ByteOrder) int
func (*EntryPoint) String ¶ added in v1.0.4
func (e *EntryPoint) String() string
type FatArch ¶
type FatArch struct { FatArchHeader *File }
A FatArch is a Mach-O File inside a FatFile.
type FatArchHeader ¶
type FatArchHeader struct { CPU types.CPU SubCPU types.CPUSubtype Offset uint32 Size uint32 Align uint32 }
A FatArchHeader represents a fat header for a specific image architecture.
type FatFile ¶
type FatFile struct { Magic types.Magic Arches []FatArch // contains filtered or unexported fields }
A FatFile is a Mach-O universal binary that contains at least one architecture.
func NewFatFile ¶
NewFatFile creates a new FatFile for accessing all the Mach-O images in a universal binary. The Mach-O binary is expected to start at position 0 in the ReaderAt.
type File ¶
type File struct { FileTOC Symtab *Symtab Dysymtab *Dysymtab // contains filtered or unexported fields }
A File represents an open Mach-O file.
func NewFile ¶
NewFile creates a new File for accessing a Mach-O binary in an underlying reader. The Mach-O binary is expected to start at position 0 in the ReaderAt.
func (*File) BuildVersion ¶
func (f *File) BuildVersion() *BuildVersion
BuildVersion returns the build version load command, or nil if no build version exists.
func (*File) Close ¶
Close closes the File. If the File was created using NewFile directly instead of Open, Close has no effect.
func (*File) CodeSignature ¶ added in v1.0.12
func (f *File) CodeSignature() *CodeSignature
CodeSignature returns the code signature, or nil if none exists.
func (*File) DyldChainedFixups ¶ added in v1.0.21
func (f *File) DyldChainedFixups() (*fixupchains.DyldChainedFixups, error)
DyldChainedFixups returns the dyld chained fixups.
func (*File) DyldExportsTrie ¶ added in v1.0.23
func (f *File) DyldExportsTrie() *DyldExportsTrie
DyldExportsTrie returns the dyld export trie load command, or nil if no dyld info exists.
func (*File) DyldInfo ¶
DyldInfo returns the dyld info load command, or nil if no dyld info exists.
func (*File) FindAddressSymbols ¶ added in v1.0.24
func (*File) FindSectionForVMAddr ¶ added in v1.0.12
FindSectionForVMAddr returns the section containing a given virtual memory ddress.
func (*File) FunctionStartAddrs ¶ added in v1.1.7
FunctionStartAddrs returns the function starts array, or nil if none exists.
func (*File) FunctionStarts ¶ added in v1.0.5
func (f *File) FunctionStarts() *FunctionStarts
FunctionStarts returns the function starts array, or nil if none exists.
func (*File) GetBaseAddress ¶ added in v1.0.24
GetBaseAddress returns the MachO's preferred load address
func (*File) GetBindName ¶ added in v1.1.3
GetBindName returns the import name for a given dyld chained pointer
func (*File) GetCFStrings ¶ added in v1.1.1
GetCFStrings parses all the cfstrings in tne MachO
func (*File) GetCString ¶ added in v1.0.5
GetCString returns a c-string at a given virtual address in the MachO
func (*File) GetCStringAtOffset ¶ added in v1.0.32
GetCStringAtOffset returns a c-string at a given offset into the MachO
func (*File) GetMangledTypeAtOffset ¶ added in v1.0.33
GetMangledTypeAtOffset reads a mangled type at a given offset in the MachO
func (*File) GetObjCCategories ¶ added in v1.0.12
func (*File) GetObjCClass ¶ added in v1.0.12
GetObjCClass parses an ObjC class at a given virtual memory address
func (*File) GetObjCClassInfo ¶ added in v1.0.12
func (*File) GetObjCClasses ¶ added in v1.0.12
func (*File) GetObjCImageInfo ¶ added in v1.0.12
func (*File) GetObjCInfo ¶ added in v1.0.12
func (*File) GetObjCIvars ¶ added in v1.0.12
func (*File) GetObjCMethodList ¶ added in v1.0.12
func (*File) GetObjCMethodNames ¶ added in v1.0.12
func (*File) GetObjCMethods ¶ added in v1.0.12
func (*File) GetObjCPlusLoadClasses ¶ added in v1.0.12
func (*File) GetObjCProperties ¶ added in v1.0.12
func (*File) GetObjCProtocols ¶ added in v1.0.12
func (*File) GetObjCSelectorReferences ¶ added in v1.0.12
func (*File) GetSwiftAssociatedTypes ¶ added in v1.0.33
func (f *File) GetSwiftAssociatedTypes() (*[]swift.AssociatedTypeDescriptor, error)
GetSwiftAssociatedTypes parses all the associated types in the __TEXT.__swift5_assocty section
func (*File) GetSwiftBuiltinTypes ¶ added in v1.0.33
func (f *File) GetSwiftBuiltinTypes() (*[]swift.BuiltinType, error)
GetSwiftBuiltinTypes parses all the built-in types in the __TEXT.__swift5_builtin section
func (*File) GetSwiftClosures ¶ added in v1.0.33
func (f *File) GetSwiftClosures() (*[]swift.CaptureDescriptor, error)
GetSwiftClosures parses all the closure context objects in the __TEXT.__swift5_capture section
func (*File) GetSwiftFields ¶ added in v1.0.33
GetSwiftFields parses all the fields in the __TEXT.__swift5_fieldmd section
func (*File) GetSwiftProtocolConformances ¶ added in v1.0.33
func (f *File) GetSwiftProtocolConformances() (*[]protocols.ConformanceDescriptor, error)
GetSwiftProtocolConformances parses all the protocol conformances in the __TEXT.__swift5_proto section
func (*File) GetSwiftProtocols ¶ added in v1.0.32
GetSwiftProtocols parses all the protocols in the __TEXT.__swift5_protos section
func (*File) GetSwiftTypes ¶ added in v1.0.32
func (f *File) GetSwiftTypes() (*[]stypes.TypeDescriptor, error)
GetSwiftTypes parses all the types in the __TEXT.__swift5_types section
func (*File) GetVMAddress ¶ added in v1.0.4
func (*File) HasFixups ¶ added in v1.0.26
HasFixups does macho contain a LC_DYLD_CHAINED_FIXUPS load command
func (*File) HasObjCMessageReferences ¶ added in v1.0.12
func (*File) HasPlusLoadMethod ¶ added in v1.0.12
func (*File) ImportedLibraries ¶
ImportedLibraries returns the paths of all libraries referred to by the binary f that are expected to be linked with the binary at dynamic link time.
func (*File) ImportedSymbolNames ¶ added in v1.0.24
ImportedSymbolNames returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time.
func (*File) ImportedSymbols ¶
ImportedSymbols returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time.
func (*File) LibraryOrdinalName ¶ added in v1.0.28
LibraryOrdinalName returns the depancy library oridinal's name
func (*File) Section ¶
Section returns the section with the given name in the given segment, or nil if no such section exists.
func (*File) Segment ¶
Segment returns the first Segment with the given name, or nil if no such segment exists.
func (*File) SourceVersion ¶
func (f *File) SourceVersion() *SourceVersion
SourceVersion returns the source version load command, or nil if no source version exists.
type FileTOC ¶
type FileTOC struct { types.FileHeader ByteOrder binary.ByteOrder Loads []Load Sections sections }
func (*FileTOC) AddSection ¶
AddSection adds section to the most recently added Segment
func (*FileTOC) AddSegment ¶
AddSegment adds segment s to the file table of contents, and also zeroes out the segment information with the expectation that this will be added next.
func (*FileTOC) DerivedCopy ¶
func (t *FileTOC) DerivedCopy(Type types.HeaderFileType, Flags types.HeaderFlag) *FileTOC
DerivedCopy returns a modified copy of the TOC, with empty loads and sections, and with the specified header type and flags.
func (*FileTOC) FileSize ¶
FileSize returns the size in bytes of the header, load commands, and the in-file contents of all the segments and sections included in those load commands, accounting for their offsets within the file.
func (*FileTOC) HdrSize ¶
HdrSize returns the size in bytes of the Macho header for a given magic number (where the magic number has been appropriately byte-swapped).
func (*FileTOC) LoadAlign ¶
LoadAlign returns the required alignment of Load commands in a binary. This is used to add padding for necessary alignment.
func (*FileTOC) LoadSize ¶
LoadSize returns the size of all the load commands in a file's table-of contents (but not their associated data, e.g., sections and symbol tables)
func (*FileTOC) LoadsString ¶ added in v1.0.21
LoadsString returns a string representation of all the MachO's load commands
func (*FileTOC) Put ¶
Put writes the header and all load commands to buffer, using the byte ordering specified in FileTOC t. For sections, this writes the headers that come in-line with the segment Load commands, but does not write the reference data for those sections.
func (*FileTOC) SymbolSize ¶
SymbolSize returns the size in bytes of a Symbol (Nlist32 or Nlist64)
type FilesetEntry ¶ added in v1.0.9
type FilesetEntry struct { LoadBytes types.FilesetEntryCmd Addr uint64 // memory address of the entry Offset uint64 // file offset of the entry EntryID string // contained entry id }
FilesetEntry used with fileset_entry_command
func (*FilesetEntry) String ¶ added in v1.0.9
func (f *FilesetEntry) String() string
type FormatError ¶
type FormatError struct {
// contains filtered or unexported fields
}
FormatError is returned by some operations if the data does not have the correct format for an object file.
func (*FormatError) Error ¶
func (e *FormatError) Error() string
type FunctionStarts ¶
type FunctionStarts struct { LoadBytes types.FunctionStartsCmd Offset uint32 Size uint32 StartOffset uint64 NextFuncOffsets []uint64 VMAddrs []uint64 }
A FunctionStarts represents a Mach-O function starts command.
func (*FunctionStarts) String ¶ added in v1.0.8
func (f *FunctionStarts) String() string
type LazyLoadDylib ¶ added in v1.0.26
type LazyLoadDylib Dylib
func (*LazyLoadDylib) String ¶ added in v1.0.26
func (d *LazyLoadDylib) String() string
type LinkEditData ¶
type LinkEditData struct { LoadBytes types.LinkEditDataCmd Offset uint32 Size uint32 }
A LinkEditData represents a Mach-O linkedit data command.
type Load ¶
type Load interface { Raw() []byte String() string Command() types.LoadCmd LoadSize(*FileTOC) uint32 // Need the TOC for alignment, sigh. Put([]byte, binary.ByteOrder) int }
A Load represents any Mach-O load command.
type LoadBytes ¶
type LoadBytes []byte
A LoadBytes is the uninterpreted bytes of a Mach-O load command.
type LoadCmdBytes ¶
LoadCmdBytes is a command-tagged sequence of bytes. This is used for Load Commands that are not (yet) interesting to us, and to common up this behavior for all those that are.
func (LoadCmdBytes) Copy ¶
func (s LoadCmdBytes) Copy() LoadCmdBytes
func (LoadCmdBytes) String ¶
func (s LoadCmdBytes) String() string
type LoadDylinker ¶ added in v1.0.4
type LoadDylinker struct { LoadBytes types.DylinkerCmd Name string }
func (*LoadDylinker) String ¶ added in v1.0.4
func (d *LoadDylinker) String() string
type ReExportDylib ¶
type ReExportDylib Dylib
func (*ReExportDylib) String ¶ added in v1.0.9
func (d *ReExportDylib) String() string
type Regs386 ¶
type Regs386 struct { AX uint32 BX uint32 CX uint32 DX uint32 DI uint32 SI uint32 BP uint32 SP uint32 SS uint32 FLAGS uint32 IP uint32 CS uint32 DS uint32 ES uint32 FS uint32 GS uint32 }
Regs386 is the Mach-O 386 register structure.
type RegsAMD64 ¶
type RegsAMD64 struct { AX uint64 BX uint64 CX uint64 DX uint64 DI uint64 SI uint64 BP uint64 SP uint64 R8 uint64 R9 uint64 R10 uint64 R11 uint64 R12 uint64 R13 uint64 R14 uint64 R15 uint64 IP uint64 FLAGS uint64 CS uint64 FS uint64 GS uint64 }
RegsAMD64 is the Mach-O AMD64 register structure.
type RegsARM ¶
type RegsARM struct { R0 uint32 R1 uint32 R2 uint32 R3 uint32 R4 uint32 R5 uint32 R6 uint32 R7 uint32 R8 uint32 R9 uint32 R10 uint32 R11 uint32 R12 uint32 SP uint32 LR uint32 PC uint32 CPSR uint32 }
RegsARM is the Mach-O ARM register structure.
type RegsARM64 ¶
type RegsARM64 struct { X0 uint64 X1 uint64 X2 uint64 X3 uint64 X4 uint64 X5 uint64 X6 uint64 X7 uint64 X8 uint64 X9 uint64 X10 uint64 X11 uint64 X12 uint64 X13 uint64 X14 uint64 X15 uint64 X16 uint64 X17 uint64 X18 uint64 X19 uint64 X20 uint64 X21 uint64 X22 uint64 X23 uint64 X24 uint64 X25 uint64 X26 uint64 X27 uint64 X28 uint64 FP uint64 LR uint64 SP uint64 PC uint64 CPSR uint32 PAD uint32 }
RegsARM64 is the Mach-O ARM 64 register structure.
type Reloc ¶
type Reloc struct { Addr uint32 Value uint32 // when Scattered == false && Extern == true, Value is the symbol number. // when Scattered == false && Extern == false, Value is the section number. // when Scattered == true, Value is the value that this reloc refers to. Type uint8 Len uint8 // 0=byte, 1=word, 2=long, 3=quad Pcrel bool Extern bool // valid if Scattered == false Scattered bool }
A Reloc represents a Mach-O relocation.
type Routines64 ¶
type Routines64 struct { LoadBytes types.Routines64Cmd InitAddress uint64 InitModule uint64 }
type Section ¶
type Section struct { SectionHeader Relocs []Reloc // Embed ReaderAt for ReadAt method. // Do not embed SectionReader directly // to avoid having Read and Seek. // If a client wants Read and Seek it must use // Open() to avoid fighting over the seek offset // with other clients. io.ReaderAt // contains filtered or unexported fields }
func (*Section) Open ¶
func (s *Section) Open() io.ReadSeeker
Open returns a new ReadSeeker reading the Mach-O section.
func (*Section) PutUncompressedData ¶
func (*Section) UncompressedSize ¶
type SectionHeader ¶
type Segment ¶
type Segment struct { SegmentHeader LoadBytes // Embed ReaderAt for ReadAt method. // Do not embed SectionReader directly // to avoid having Read and Seek. // If a client wants Read and Seek it must use // Open() to avoid fighting over the seek offset // with other clients. io.ReaderAt // contains filtered or unexported fields }
A Segment represents a Mach-O 32-bit or 64-bit load segment command.
func (*Segment) CopyZeroed ¶
func (*Segment) Open ¶
func (s *Segment) Open() io.ReadSeeker
Open returns a new ReadSeeker reading the segment.
type SegmentHeader ¶
type SegmentHeader struct { types.LoadCmd Len uint32 Name string Addr uint64 Memsz uint64 Offset uint64 Filesz uint64 Maxprot types.VmProtection Prot types.VmProtection Nsect uint32 Flag types.SegFlag Firstsect uint32 }
A SegmentHeader is the header for a Mach-O 32-bit or 64-bit load segment command.
func (*SegmentHeader) String ¶
func (s *SegmentHeader) String() string
type SourceVersion ¶
type SourceVersion struct { LoadBytes types.SourceVersionCmd Version string }
A SourceVersion represents a Mach-O source version.
func (*SourceVersion) String ¶ added in v1.0.4
func (s *SourceVersion) String() string
type SplitInfo ¶
type SubClient ¶
type SubClient struct { LoadBytes types.SubClientCmd Name string }
A SubClient is a Mach-O dynamic sub client command.
type SubFramework ¶
type SubFramework struct { LoadBytes types.SubFrameworkCmd Framework string }
func (*SubFramework) String ¶ added in v1.0.24
func (s *SubFramework) String() string
type UnixThread ¶
type UnixThread struct { LoadBytes types.UnixThreadCmd EntryPoint uint64 }
A UnixThread represents a Mach-O unix thread command.
func (*UnixThread) String ¶ added in v1.0.8
func (u *UnixThread) String() string
type UpwardDylib ¶
type UpwardDylib Dylib
A UpwardDylib represents a Mach-O load upward dylib command.
func (*UpwardDylib) String ¶ added in v1.0.9
func (d *UpwardDylib) String() string
type VersionMinMacOSX ¶ added in v1.0.9
type VersionMinMacOSX struct { LoadBytes types.VersionMinMacOSCmd Version string Sdk string }
VersionMinMacOSX build for MacOSX min OS version
func (*VersionMinMacOSX) String ¶ added in v1.0.9
func (v *VersionMinMacOSX) String() string
type VersionMinTvOS ¶ added in v1.0.9
type VersionMinTvOS struct { LoadBytes types.VersionMinIPhoneOSCmd Version string Sdk string }
VersionMinTvOS build for AppleTV min OS version
func (*VersionMinTvOS) String ¶ added in v1.0.9
func (v *VersionMinTvOS) String() string
type VersionMinWatchOS ¶ added in v1.0.9
type VersionMinWatchOS struct { LoadBytes types.VersionMinIPhoneOSCmd Version string Sdk string }
VersionMinWatchOS build for Watch min OS version
func (*VersionMinWatchOS) String ¶ added in v1.0.9
func (v *VersionMinWatchOS) String() string
type VersionMiniPhoneOS ¶ added in v1.0.9
type VersionMiniPhoneOS struct { LoadBytes types.VersionMinIPhoneOSCmd Version string Sdk string }
VersionMiniPhoneOS build for iPhoneOS min OS version
func (*VersionMiniPhoneOS) String ¶ added in v1.0.9
func (v *VersionMiniPhoneOS) String() string
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
obscuretestdata
Package obscuretestdata contains functionality used by tests to more easily work with testdata that must be obscured primarily due to golang.org/issue/34986.
|
Package obscuretestdata contains functionality used by tests to more easily work with testdata that must be obscured primarily due to golang.org/issue/34986. |
pkg
|
|