Class Section
- All Implemented Interfaces:
StructConverter
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(long address) Returns true if the section contains the given addresslongintgetAlign()intgetDataStream(MachHeader header) Returns an input stream to underlying bytes of this section.intgetFlags()intintintintintintlonggetSize()intgetType()booleanReturns true if this section has EXECUTE permission.booleanisRead()Returns true if this section has READ permission.booleanisWrite()Returns true if this section has WRITE permission.voidsetSectionName(String name) voidsetSegmentName(String name) Returns a structure datatype representing the contents of the implementor of this interface.toString()
-
Constructor Details
-
Section
- Throws:
IOException
-
-
Method Details
-
getRelocations
-
isRead
public boolean isRead()Returns true if this section has READ permission.NOTE: On a real system, sections don't have their own permissions, only the segments they live in do. However, Ghidra needs finer-grained control for analysis to work correctly, so we take control over section permissions to fit our needs.
- Returns:
- true if this section has READ permission
-
isWrite
public boolean isWrite()Returns true if this section has WRITE permission.NOTE: On a real system, sections don't have their own permissions, only the segments they live in do. However, Ghidra needs finer-grained control for analysis to work correctly, so we take control over section permissions to fit our needs.
- Returns:
- true if this section has WRITE permission
-
isExecute
public boolean isExecute()Returns true if this section has EXECUTE permission.NOTE: On a real system, sections don't have their own permissions, only the segments they live in do. However, Ghidra needs finer-grained control for analysis to work correctly, so we take control over section permissions to fit our needs.
- Returns:
- true if this section has EXECUTE permission
-
getDataStream
Returns an input stream to underlying bytes of this section.- Parameters:
header- The Mach-O header- Returns:
- an input stream to underlying bytes of this section
- Throws:
IOException- if an i/o error occurs.
-
getSectionName
-
setSectionName
-
getSegmentName
-
setSegmentName
-
getAddress
public long getAddress() -
getSize
public long getSize() -
getOffset
public int getOffset() -
getAlign
public int getAlign() -
getRelocationOffset
public int getRelocationOffset() -
getNumberOfRelocations
public int getNumberOfRelocations() -
getFlags
public int getFlags() -
getType
public int getType() -
getAttributes
public int getAttributes() -
getReserved1
public int getReserved1() -
getReserved2
public int getReserved2() -
getReserved3
public int getReserved3() -
contains
public boolean contains(long address) Returns true if the section contains the given address- Parameters:
address- The address to check- Returns:
- True if the section contains the given address; otherwise, false
-
toDataType
Description copied from interface:StructConverterReturns 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.
- Specified by:
toDataTypein interfaceStructConverter- 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:
-
toString
-