Class ProgramByteSource

java.lang.Object
ghidra.features.base.memsearch.bytesource.ProgramByteSource
All Implemented Interfaces:
AddressableByteSource

public class ProgramByteSource extends Object implements AddressableByteSource
AddressableByteSource implementation for a Ghidra Program
  • Constructor Details

    • ProgramByteSource

      public ProgramByteSource(Program program)
  • Method Details

    • getBytes

      public int getBytes(Address address, byte[] bytes, int length)
      Description copied from interface: AddressableByteSource
      Retrieves the byte values for an address range.
      Specified by:
      getBytes in interface AddressableByteSource
      Parameters:
      address - The address of the first byte in the range
      bytes - the byte array to store the retrieved byte values
      length - the number of bytes to retrieve
      Returns:
      the number of bytes actually retrieved
    • getSearchableRegions

      public List<SearchRegion> getSearchableRegions()
      Description copied from interface: AddressableByteSource
      Returns a list of memory regions where each region has an associated address set of valid addresses that can be read.
      Specified by:
      getSearchableRegions in interface AddressableByteSource
      Returns:
      a list of readable regions
    • invalidate

      public void invalidate()
      Description copied from interface: AddressableByteSource
      Invalidates any caching of byte values. This intended to provide a hint in debugging scenario that we are about to issue a sequence of byte value requests where we are re-acquiring previous requested byte values to look for changes.
      Specified by:
      invalidate in interface AddressableByteSource
    • getCanonicalLocation

      public ProgramLocation getCanonicalLocation(Address address)
      Description copied from interface: AddressableByteSource
      Convert byte source address to the canonical (static) location
      Specified by:
      getCanonicalLocation in interface AddressableByteSource
      Parameters:
      address - address to be converted
      Returns:
      canonical location
    • rebaseFromCanonical

      public Address rebaseFromCanonical(ProgramLocation location)
      Description copied from interface: AddressableByteSource
      Rebase a canonical location in the current byte source
      Specified by:
      rebaseFromCanonical in interface AddressableByteSource
      Parameters:
      location - location to be rebased
      Returns:
      address for new byte source
    • getProgram

      public Program getProgram()