Class SwiftUtils

java.lang.Object
ghidra.app.util.bin.format.swift.SwiftUtils

public class SwiftUtils extends Object
Swift-related utility methods
  • Field Details

  • Constructor Details

    • SwiftUtils

      public SwiftUtils()
  • Method Details

    • isSwift

      public static boolean isSwift(Program program)
      Checks if the given Program is a Swift program
      Parameters:
      program - The Program to check
      Returns:
      True if the given Program is a Swift program; otherwise, false
    • isSwift

      public static boolean isSwift(List<String> sectionNames)
      Checks if the given List of section names contains a Swift section name
      Parameters:
      sectionNames - The List of section names to check
      Returns:
      True if the given List of section names contains a Swift section name; otherwise, false
    • getSwiftBlocks

      public static List<MemoryBlock> getSwiftBlocks(SwiftSection section, Program program)
      Gets a List of MemoryBlocks that match the given SwiftSection
      Parameters:
      section - The SwiftSection
      program - The Program
      Returns:
      A List of MemoryBlocks that match the given SwiftSection
    • relativeString

      public static String relativeString(BinaryReader reader) throws IOException
      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, the BinaryReader will be positioned directly after the initial relative pointer that was read.
      Parameters:
      reader - A BinaryReader positioned at the start of relative string pointer
      Returns:
      The read string
      Throws:
      IOException - if there was an IO-related problem during the reads