Class GccAnalysisUtils
java.lang.Object
ghidra.app.plugin.exceptionhandlers.gcc.GccAnalysisUtils
Utility methods for use by the gcc exception handling analysis.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte
Reads a byte from the program's memory at the indicated address.static void
Reads buffer.length number of bytes from the program's memory starting at the indicated address.static long
Reads a double word from the program's memory starting at the indicated address.static long
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
Reads a word from the program's memory starting at the indicated address.
-
Constructor Details
-
GccAnalysisUtils
public GccAnalysisUtils()
-
-
Method Details
-
readByte
Reads a byte from the program's memory at the indicated address.- Parameters:
program
- the program containing the byte to readaddr
- the address to start reading- Returns:
- the byte
- Throws:
MemoryAccessException
- if the byte can't be read.
-
readWord
Reads a word from the program's memory starting at the indicated address.- Parameters:
program
- the program containing the bytes to readaddr
- the address to start reading- Returns:
- the word
- Throws:
MemoryAccessException
- if 2 bytes can't be read.
-
readDWord
Reads a double word from the program's memory starting at the indicated address.- Parameters:
program
- the program containing the bytes to readaddr
- the address to start reading- Returns:
- the double word
- Throws:
MemoryAccessException
- if 4 bytes can't be read.
-
readQWord
Reads a quad word from the program's memory starting at the indicated address.- Parameters:
program
- the program containing the bytes to readaddr
- 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 readaddr
- the address to start readingbuffer
- 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
-