Class ObjectiveC1_Utilities
java.lang.Object
ghidra.app.util.bin.format.objectiveC.ObjectiveC1_Utilities
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Applies the data type at the specified address.static void
clear
(ObjectiveC2_State state, MemoryBlock block) Clears the code units defined in the given memory block.static final void
static final void
createMethods
(ObjectiveC1_State state) static Namespace
createNamespace
(Program program, String... namespacePath) Creates a namespace hierarchy using the list of strings specified in namespacePath.static Address
createPointerAndReturnAddressBeingReferenced
(Program program, Address address) Applies a pointer data type at the specified address and returns the address being referenced.static String
createString
(Program program, Address address) Applies a string data type at the specified address and returns the string object.static Symbol
createSymbol
(Program program, Namespace parentNamespace, String symbolName, Address symbolAddress) Creates a symbol.static String
dereferenceAsciiString
(BinaryReader reader, boolean is32bit) Dereferences a string pointer and returns the string.static final void
fixupReferences
(ObjectiveC1_State state) This method will remove references to the NULL address and it will adjust THUMB references to no longer be offcut.static final String
formatAsObjectiveC
(Function function, ObjectiveC_MethodType methodType) static final String
formatAsObjectiveC
(FunctionSignature signature, ObjectiveC_MethodType methodType, boolean appendSemicolon) static Namespace
getClassNamespace
(Program program, Namespace parentNamespace, String namespaceName) Returns the class inside the given parent name space.static boolean
Returns true if the given address is zero.static boolean
Returns true if the address is THUMB code.static boolean
Returns true if the address is THUMB code.static long
readNextIndex
(BinaryReader reader, boolean is32bit) Reads the next index value.static void
setThumbBit
(ObjectiveC1_State state, Address address) If needed, sets the TMode bit at the specified address.static Address
Manufactures an address from the given long.
-
Constructor Details
-
ObjectiveC1_Utilities
public ObjectiveC1_Utilities()
-
-
Method Details
-
clear
Clears the code units defined in the given memory block.- Throws:
Exception
-
readNextIndex
Reads the next index value. If is32bit is true, then 4 bytes will be read to form index. Otherwise, 8 bytes will be read to form index.- Throws:
IOException
-
dereferenceAsciiString
public static String dereferenceAsciiString(BinaryReader reader, boolean is32bit) throws IOException Dereferences a string pointer and returns the string. If 32-bit only reads a 32-bit pointer.- Throws:
IOException
-
isNull
Returns true if the given address is zero. -
isThumb
Returns true if the address is THUMB code. -
isThumb
Returns true if the address is THUMB code. -
setThumbBit
If needed, sets the TMode bit at the specified address. -
toAddress
Manufactures an address from the given long. -
applyData
public static void applyData(Program program, DataType dt, Address address) throws CodeUnitInsertionException Applies the data type at the specified address.- Throws:
CodeUnitInsertionException
-
createString
Applies a string data type at the specified address and returns the string object. -
createPointerAndReturnAddressBeingReferenced
public static Address createPointerAndReturnAddressBeingReferenced(Program program, Address address) throws CodeUnitInsertionException Applies a pointer data type at the specified address and returns the address being referenced.- Throws:
CodeUnitInsertionException
-
getClassNamespace
public static Namespace getClassNamespace(Program program, Namespace parentNamespace, String namespaceName) throws DuplicateNameException, InvalidInputException Returns the class inside the given parent name space. If it does not exist, then create it and return it. -
createSymbol
public static Symbol createSymbol(Program program, Namespace parentNamespace, String symbolName, Address symbolAddress) throws InvalidInputException Creates a symbol. TODO - make symbols primary?- Throws:
InvalidInputException
-
createNamespace
public static Namespace createNamespace(Program program, String... namespacePath) throws DuplicateNameException, InvalidInputException Creates a namespace hierarchy using the list of strings specified in namespacePath. -
formatAsObjectiveC
-
formatAsObjectiveC
public static final String formatAsObjectiveC(FunctionSignature signature, ObjectiveC_MethodType methodType, boolean appendSemicolon) throws IllegalStateException - Throws:
IllegalStateException
-
createMethods
-
createInstanceVariablesC2_OBJC2
-
fixupReferences
This method will remove references to the NULL address and it will adjust THUMB references to no longer be offcut.
-