Package ghidra.app.util.bin
Interface StructConverter
- All Known Subinterfaces:
CoffSymbolAux,ElfFileSection,OptionalHeader
- All Known Implementing Classes:
AoutHeader,AoutHeaderMIPS,AppleSingleDouble,ArchitectureDataDirectory,AssociatedTypeDescriptor,AssociatedTypeRecord,BaseRelocation,BoundImportDescriptor,BoundImportForwarderRef,BuildVersionCommand,BuildVersionCommand.BuildToolVersion,BuiltinTypeDescriptor,CaptureDescriptor,CaptureTypeRecord,CFragResource,CFragResourceMember,CFragUsage1Union,CFragUsage2Union,CFragWhere1Union,CFragWhere2Union,CliAbstractSig,CliAbstractStream,CliAbstractTable,CliBlob,CliBlobCustomAttrib,CliBlobMarshalSpec,CliMetadataDirectory,CliMetadataRoot,CliMethodDef,CliMethodExtraSections,CliSigAssembly,CliSigAssemblyRef,CliSigConstant,CliSigField,CliSigLocalVar,CliSigMethodDef,CliSigMethodRef,CliSigMethodSpec,CliSigProperty,CliSigStandAloneMethod,CliSigTypeSpec,CliStreamBlob,CliStreamGuid,CliStreamHeader,CliStreamMetadata,CliStreamStrings,CliStreamUserStrings,CliTableAssembly,CliTableAssemblyOS,CliTableAssemblyProcessor,CliTableAssemblyRef,CliTableAssemblyRefOS,CliTableAssemblyRefProcessor,CliTableClassLayout,CliTableConstant,CliTableCustomAttribute,CliTableDeclSecurity,CliTableEvent,CliTableEventMap,CliTableExportedType,CliTableField,CliTableFieldLayout,CliTableFieldMarshall,CliTableFieldRVA,CliTableFile,CliTableGenericParam,CliTableGenericParamConstraint,CliTableImplMap,CliTableInterfaceImpl,CliTableManifestResource,CliTableMemberRef,CliTableMethodDef,CliTableMethodImpl,CliTableMethodSemantics,CliTableMethodSpec,CliTableModule,CliTableModuleRef,CliTableNestedClass,CliTableParam,CliTableProperty,CliTablePropertyMap,CliTableStandAloneSig,CliTableTypeDef,CliTableTypeRef,CliTableTypeSpec,CodeSignatureBlobIndex,CodeSignatureCodeDirectory,CodeSignatureCommand,CodeSignatureGenericBlob,CodeSignatureSuperBlob,CoffArchiveHeader,CoffArchiveMemberHeader,CoffFileHeader,CoffLineNumber,CoffRelocation,CoffSectionHeader,CoffSymbol,CoffSymbolAuxArray,CoffSymbolAuxBeginningOfBlock,CoffSymbolAuxEndOfBlock,CoffSymbolAuxEndOfStruct,CoffSymbolAuxFilename,CoffSymbolAuxFunction,CoffSymbolAuxName,CoffSymbolAuxSection,CoffSymbolAuxTagName,ContainerHeader,CorruptLoadCommand,DataInCodeCommand,DataInCodeEntry,DebugCodeView,DebugCodeViewSymbolTable,DebugCOFFSymbol,DebugCOFFSymbolAux,DebugCOFFSymbolAux.AuxFile,DebugCOFFSymbolAux.AuxSection,DebugCOFFSymbolAux.AuxSym,DebugDirectory,DebugMisc,DebugStateX86_32,DebugStateX86_64,DefaultDataDirectory,DelayImportDescriptor,DOSHeader,DyldCacheAccelerateInfo,DyldCacheAcceleratorDof,DyldCacheAcceleratorInitializer,DyldCacheHeader,DyldCacheImageInfo,DyldCacheImageInfoExtra,DyldCacheImageTextInfo,DyldCacheLocalSymbolsEntry,DyldCacheLocalSymbolsInfo,DyldCacheMappingAndSlideInfo,DyldCacheMappingInfo,DyldCacheRangeEntry,DyldCacheSlideInfo1,DyldCacheSlideInfo2,DyldCacheSlideInfo3,DyldCacheSlideInfo4,DyldCacheSlideInfo5,DyldCacheSlideInfoCommon,DyldChainedFixupHeader,DyldChainedFixupsCommand,DyldChainedImport,DyldChainedStartsInImage,DyldChainedStartsInSegment,DyldChainedStartsOffsets,DyldChainedStartsOffsets,DyldExportsTrieCommand,DyldInfoCommand,DyldSubcacheEntry,DynamicLibrary,DynamicLibraryCommand,DynamicLibraryModule,DynamicLibraryReference,DynamicLinkerCommand,DynamicSymbolTableCommand,ElfDynamicTable,ElfHeader,ElfProgramHeader,ElfRelocation,ElfRelocationTable,ElfSectionHeader,ElfStringTable,ElfSymbolTable,EncryptedInformationCommand,EntryDescriptor,EntryPoint,EntryPointCommand,ExceptionStateX86_32,ExceptionStateX86_64,ExportDataDirectory,ExportedSymbol,ExportedSymbolHashSlot,ExportedSymbolKey,FieldDescriptor,FieldRecord,FileHeader,FileSetEntryCommand,FirstLinkerMember,FixedVirtualMemoryFileCommand,FixedVirtualMemorySharedLibraryCommand,FunctionStartsCommand,GnuVerdaux,GnuVerdef,GnuVernaux,GnuVerneed,IdentCommand,ImageCor20Header,ImportByName,ImportDescriptor,ImportedLibrary,ImportedSymbol,LibObjcOptimization,LinkEditDataCommand,LinkerOptionCommand,LoadCommand,LoadCommandString,LoadConfigDirectory,LoaderInfoHeader,LoaderRelocationHeader,LongNamesMember,MachHeader,MetadataSourceRecord,MultiPayloadEnumDescriptor,MzRelocation,NList,NTHeader,ObjectiveC_Method,ObjectiveC_MethodList,ObjectiveC1_Category,ObjectiveC1_Class,ObjectiveC1_InstanceVariable,ObjectiveC1_InstanceVariableList,ObjectiveC1_MetaClass,ObjectiveC1_Method,ObjectiveC1_MethodList,ObjectiveC1_Module,ObjectiveC1_Protocol,ObjectiveC1_ProtocolList,ObjectiveC1_ProtocolMethod,ObjectiveC1_ProtocolMethodList,ObjectiveC1_SymbolTable,ObjectiveC2_Cache,ObjectiveC2_Category,ObjectiveC2_Class,ObjectiveC2_ClassRW,ObjectiveC2_ImageInfo,ObjectiveC2_Implementation,ObjectiveC2_InstanceVariable,ObjectiveC2_InstanceVariableList,ObjectiveC2_MessageReference,ObjectiveC2_Method,ObjectiveC2_MethodList,ObjectiveC2_Property,ObjectiveC2_PropertyList,ObjectiveC2_Protocol,ObjectiveC2_ProtocolList,ObsoleteCommand,OldDOSHeader,Omf166DepList,Omf2or4,Omf51Content,Omf51ExternalDefsRecord,Omf51FixupRecord,Omf51LibraryDictionaryRecord,Omf51LibraryHeaderRecord,Omf51LibraryModuleLocationsRecord,Omf51LibraryModuleNamesRecord,Omf51ModuleEnd,Omf51ModuleHeader,Omf51PublicDefsRecord,Omf51SegmentDefs,OmfComdatExternalSymbol,OmfComdefRecord,OmfCommentRecord,OmfData,OmfEnumeratedData,OmfExternalSymbol,OmfFileHeader,OmfFixupRecord,OmfGroupRecord,OmfIndex,OmfIteratedData,OmfModuleEnd,OmfNamesRecord,OmfObsoleteRecord,OmfRecord,OmfSegmentHeader,OmfString,OmfSymbolRecord,OmfUnknownRecord,OmfUnsupportedRecord,OptionalHeaderImpl,PdbInfoCodeView,PdbInfoDotNet,PefDebug,PrebindChecksumCommand,PreboundDynamicLibraryCommand,ReferenceListEntry,Relocation,RelocationInfo,RelocByIndexGroup,RelocBySectDWithSkip,RelocIncrPosition,RelocLgByImport,RelocLgRepeat,RelocLgSetOrBySection,RelocSetPosition,RelocSmRepeat,RelocUndefinedOpcode,RelocValueGroup,ResourceDataEntry,ResourceDirectory,ResourceDirectoryEntry,ResourceDirectoryString,ResourceDirectoryStringU,ResourceHeader,ResourceMap,ResourceType,RichHeader,RoutinesCommand,RunPathCommand,SecondLinkerMember,Section,SectionHeader,SectionHeader,SecurityCertificate,SegmentCommand,SourceVersionCommand,SubClientCommand,SubFrameworkCommand,SubLibraryCommand,SubUmbrellaCommand,SwiftTypeMetadataStructure,SymbolCommand,SymbolTableCommand,TableOfContents,TargetClassDescriptor,TargetContextDescriptor,TargetEnumDescriptor,TargetProtocolConformanceDescriptor,TargetProtocolDescriptor,TargetStructDescriptor,TargetTypeContextDescriptor,ThreadCommand,ThreadState,ThreadStateARM,ThreadStateARM_64,ThreadStateHeader,ThreadStatePPC,ThreadStateX86_32,ThreadStateX86_64,ThunkData,TLSDirectory,TwoLevelHint,TwoLevelHintsCommand,UnixAoutHeader,UnixAoutRelocationTable,UnixAoutSymbolTable,UnsupportedLoadCommand,UuidCommand,VersionMinCommand,VS_VERSION_CHILD,VS_VERSION_INFO,XCoffFileHeader,XCoffOptionalHeader,XCoffSectionHeader
public interface StructConverter
Allows a class to create a structure
datatype equivalent to its class members.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataTypeReusable ASCII datatype.static final DataTypeReusable BYTE datatype.static final DataTypeReusable DWORD datatype.static final DataTypeReusable 32-bit image base offset datatype.static final DataTypeReusable 64-bit image base offset datatype.static final DataTypeReusable POINTER datatype.static final DataTypeReusable QWORD datatype.static final SignedLeb128DataTypeReusable Signed LEB128 dynamic length data typestatic final DataTypeReusable STRING datatype.static final UnsignedLeb128DataTypeReusable Unsigned LEB128 dynamic length data typestatic final DataTypeReusable UTF16 string datatype.static final DataTypeReusable UTF8 string datatype.static final DataTypeReusable VOID datatype.static final DataTypeReusable WORD datatype. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidRecursively sets the givenDataand its components to big/little endianReturns a structure datatype representing the contents of the implementor of this interface.
-
Field Details
-
BYTE
Reusable BYTE datatype. -
WORD
Reusable WORD datatype. -
DWORD
Reusable DWORD datatype. -
QWORD
Reusable QWORD datatype. -
ASCII
Reusable ASCII datatype. -
STRING
Reusable STRING datatype. -
UTF8
Reusable UTF8 string datatype. -
UTF16
Reusable UTF16 string datatype. -
POINTER
Reusable POINTER datatype. -
VOID
Reusable VOID datatype. -
IBO32
Reusable 32-bit image base offset datatype. -
IBO64
Reusable 64-bit image base offset datatype. -
ULEB128
Reusable Unsigned LEB128 dynamic length data type -
SLEB128
Reusable Signed LEB128 dynamic length data type
-
-
Method Details
-
toDataType
Returns a structure datatype representing the contents of the implementor of this interface.For example, given:
class A { int foo; double bar; }The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.
- Returns:
- returns a structure datatype representing the implementor of this interface
- Throws:
DuplicateNameException- when a datatype of the same name already existsIOException- if an IO-related error occurs- See Also:
-
setEndian
Recursively sets the givenDataand its components to big/little endian
-