Package ghidra.app.util.bin.format.swift
Class SwiftUtils
java.lang.Object
ghidra.app.util.bin.format.swift.SwiftUtils
Swift-related utility methods
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PointerTypedef
Apointer
to a relative 4-byte offsetstatic final PointerTypedef
Astring pointer
to a 4-byte relative offsetstatic final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<MemoryBlock> getSwiftBlocks
(SwiftSection section, Program program) static boolean
Checks if the givenProgram
is a Swift programstatic boolean
Checks if the givenList
of section names contains a Swift section namestatic String
relativeString
(BinaryReader reader) Reads the integer at the current index and uses it as a relative pointer to read and return a string at that location.
-
Field Details
-
SWIFT_COMPILER
- See Also:
-
PTR_RELATIVE
Apointer
to a relative 4-byte offset -
PTR_STRING
Astring pointer
to a 4-byte relative offset
-
-
Constructor Details
-
SwiftUtils
public SwiftUtils()
-
-
Method Details
-
isSwift
Checks if the givenProgram
is a Swift program -
isSwift
Checks if the givenList
of section names contains a Swift section name -
getSwiftBlocks
- Parameters:
section
- TheSwiftSection
program
- TheProgram
- Returns:
- A
List
ofMemoryBlock
s that match the givenSwiftSection
-
relativeString
Reads the integer at the current index and uses it as a relative pointer to read and return a string at that location. When the read completes, theBinaryReader
will be positioned directly after the initial relative pointer that was read.- Parameters:
reader
- ABinaryReader
positioned at the start of relative string pointer- Returns:
- The read string
- Throws:
IOException
- if there was an IO-related problem during the reads
-