Package ghidra.app.plugin.exceptionhandlers.gcc

# Class GccAnalysisUtils

java.lang.Object
ghidra.app.plugin.exceptionhandlers.gcc.GccAnalysisUtils

public class GccAnalysisUtils extends Object
Utility methods for use by the gcc exception handling analysis.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GccAnalysisUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static byte`
  `readByte(Program program, Address addr)`
  Reads a byte from the program's memory at the indicated address.
  `static void`
  `readBytes(Program program, Address addr, byte[] buffer)`
  Reads buffer.length number of bytes from the program's memory starting at the indicated address.
  `static long`
  `readDWord(Program program, Address addr)`
  Reads a double word from the program's memory starting at the indicated address.
  `static long`
  `readQWord(Program program, Address addr)`
  Reads a quad word from the program's memory starting at the indicated address.
  `static LEB128Info`
  `readSLEB128Info(Program program, Address addr)`
  Reads an signed little endian base 128 integer from memory.
  `static LEB128Info`
  `readULEB128Info(Program program, Address addr)`
  Reads an unsigned little endian base 128 integer from memory.
  `static int`
  `readWord(Program program, Address addr)`
  Reads a word from the program's memory starting at the indicated address.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GccAnalysisUtils

    public GccAnalysisUtils()

- ## Method Details

  - ### readByte

    public static byte readByte(Program program, Address addr) throws MemoryAccessException
    Reads a byte from the program's memory at the indicated address.
    Parameters:
      `program` - the program containing the byte to read
      `addr` - the address to start reading
    Returns:
      the byte
    Throws:
      `MemoryAccessException` - if the byte can't be read.

  - ### readWord

    public static int readWord(Program program, Address addr) throws MemoryAccessException
    Reads a word from the program's memory starting at the indicated address.
    Parameters:
      `program` - the program containing the bytes to read
      `addr` - the address to start reading
    Returns:
      the word
    Throws:
      `MemoryAccessException` - if 2 bytes can't be read.

  - ### readDWord

    public static long readDWord(Program program, Address addr) throws MemoryAccessException
    Reads a double word from the program's memory starting at the indicated address.
    Parameters:
      `program` - the program containing the bytes to read
      `addr` - the address to start reading
    Returns:
      the double word
    Throws:
      `MemoryAccessException` - if 4 bytes can't be read.

  - ### readQWord

    public static long readQWord(Program program, Address addr) throws MemoryAccessException
    Reads a quad word from the program's memory starting at the indicated address.
    Parameters:
      `program` - the program containing the bytes to read
      `addr` - the address to start reading
    Returns:
      the quad word
    Throws:
      `MemoryAccessException` - if 8 bytes can't be read.

  - ### readBytes

    public static void readBytes(Program program, Address addr, byte[] buffer) throws MemoryAccessException
    Reads buffer.length number of bytes from the program's memory starting at the indicated address.
    Parameters:
      `program` - the program containing the bytes to read
      `addr` - the address to start reading
      `buffer` - the array to save the bytes that were read.
    Throws:
      `MemoryAccessException` - if the expected number of bytes can't be read.

  - ### readULEB128Info

    public static LEB128Info readULEB128Info(Program program, Address addr) throws MemoryAccessException
    Reads an unsigned little endian base 128 integer from memory.
    Parameters:
      `program` - the program with memory to be read.
      `addr` - the address in memory to begin reading the unsigned LEB128.
    Returns:
      `LEB128Info` (value + metadata)
    Throws:
      `MemoryAccessException`

  - ### readSLEB128Info

    public static LEB128Info readSLEB128Info(Program program, Address addr) throws MemoryAccessException
    Reads an signed little endian base 128 integer from memory.
    Parameters:
      `program` - the program with memory to be read.
      `addr` - the address in memory to begin reading the signed LEB128.
    Returns:
      `LEB128Info` (value + metadata)
    Throws:
      `MemoryAccessException`