Class ObjectiveC1_Utilities
- java.lang.Object
- 
- ghidra.app.util.bin.format.objectiveC.ObjectiveC1_Utilities
 
- 
 public final class ObjectiveC1_Utilities extends java.lang.Object
- 
- 
Constructor SummaryConstructors Constructor Description ObjectiveC1_Utilities()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyData(Program program, DataType dt, Address address)Applies the data type at the specified address.static voidclear(ObjectiveC2_State state, MemoryBlock block)Clears the code units defined in the given memory block.static voidcreateInstanceVariablesC2_OBJC2(ObjectiveC2_State state)static voidcreateMethods(ObjectiveC1_State state)static NamespacecreateNamespace(Program program, java.lang.String... namespacePath)Creates a namespace hierarchy using the list of strings specified in namespacePath.static DatacreatePointer(Program program, Address address)Applies a pointer data type at the specified address and returns the newly created data object.static AddresscreatePointerAndReturnAddressBeingReferenced(Program program, Address address)Applies a pointer data type at the specified address and returns the address being referenced.static java.lang.StringcreateString(Program program, Address address)Applies a string data type at the specified address and returns the string object.static SymbolcreateSymbol(Program program, Namespace parentNamespace, java.lang.String symbolName, Address symbolAddress)Creates a symbol.static java.lang.StringdereferenceAsciiString(BinaryReader reader, boolean is32bit)Dereferences a string pointer and returns the string.static voidfixupReferences(ObjectiveC1_State state)This method will remove references to the NULL address and it will adjust THUMB references to no longer be offcut.static java.lang.StringformatAsObjectiveC(Function function, ObjectiveC_MethodType methodType)static java.lang.StringformatAsObjectiveC(FunctionSignature signature, ObjectiveC_MethodType methodType, boolean appendSemicolon)static NamespacegetClassNamespace(Program program, Namespace parentNamespace, java.lang.String namespaceName)Returns the class inside the given parent name space.static booleanisNull(Address address)Returns true if the given address is zero.static booleanisThumb(Program program, long address)Returns true if the address is THUMB code.static booleanisThumb(Program program, Address address)Returns true if the address is THUMB code.static longreadNextIndex(BinaryReader reader, boolean is32bit)Reads the next index value.static voidsetThumbBit(ObjectiveC1_State state, Address address)If needed, sets the TMode bit at the specified address.static AddresstoAddress(Program program, long offset)Manufactures an address from the given long.
 
- 
- 
- 
Method Detail- 
clearpublic static void clear(ObjectiveC2_State state, MemoryBlock block) throws java.lang.Exception Clears the code units defined in the given memory block.- Throws:
- java.lang.Exception
 
 - 
readNextIndexpublic static long readNextIndex(BinaryReader reader, boolean is32bit) throws java.io.IOException 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:
- java.io.IOException
 
 - 
dereferenceAsciiStringpublic static java.lang.String dereferenceAsciiString(BinaryReader reader, boolean is32bit) throws java.io.IOException Dereferences a string pointer and returns the string. If 32-bit only reads a 32-bit pointer.- Throws:
- java.io.IOException
 
 - 
isNullpublic static boolean isNull(Address address) Returns true if the given address is zero.
 - 
isThumbpublic static boolean isThumb(Program program, Address address) Returns true if the address is THUMB code.
 - 
isThumbpublic static boolean isThumb(Program program, long address) Returns true if the address is THUMB code.
 - 
setThumbBitpublic static void setThumbBit(ObjectiveC1_State state, Address address) If needed, sets the TMode bit at the specified address.
 - 
toAddresspublic static Address toAddress(Program program, long offset) Manufactures an address from the given long.
 - 
applyDatapublic static void applyData(Program program, DataType dt, Address address) throws CodeUnitInsertionException, DataTypeConflictException Applies the data type at the specified address.
 - 
createStringpublic static java.lang.String createString(Program program, Address address) Applies a string data type at the specified address and returns the string object.
 - 
createPointerAndReturnAddressBeingReferencedpublic static Address createPointerAndReturnAddressBeingReferenced(Program program, Address address) throws CodeUnitInsertionException, DataTypeConflictException Applies a pointer data type at the specified address and returns the address being referenced.
 - 
createPointerpublic static Data createPointer(Program program, Address address) Applies a pointer data type at the specified address and returns the newly created data object.
 - 
getClassNamespacepublic static Namespace getClassNamespace(Program program, Namespace parentNamespace, java.lang.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.
 - 
createSymbolpublic static Symbol createSymbol(Program program, Namespace parentNamespace, java.lang.String symbolName, Address symbolAddress) throws InvalidInputException Creates a symbol. TODO - make symbols primary?- Throws:
- InvalidInputException
 
 - 
createNamespacepublic static Namespace createNamespace(Program program, java.lang.String... namespacePath) throws DuplicateNameException, InvalidInputException Creates a namespace hierarchy using the list of strings specified in namespacePath.
 - 
formatAsObjectiveCpublic static final java.lang.String formatAsObjectiveC(Function function, ObjectiveC_MethodType methodType) 
 - 
formatAsObjectiveCpublic static final java.lang.String formatAsObjectiveC(FunctionSignature signature, ObjectiveC_MethodType methodType, boolean appendSemicolon) throws java.lang.IllegalStateException - Throws:
- java.lang.IllegalStateException
 
 - 
createMethodspublic static final void createMethods(ObjectiveC1_State state) 
 - 
createInstanceVariablesC2_OBJC2public static final void createInstanceVariablesC2_OBJC2(ObjectiveC2_State state) 
 - 
fixupReferencespublic 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.
 
- 
 
-