Class GccAnalysisUtils
java.lang.Object
ghidra.app.plugin.exceptionhandlers.gcc.GccAnalysisUtils
Utility methods for use by the gcc exception handling analysis.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getSLEB128Length
(Program program, Address addr) Gets the size of a signed little endian base 128 integer.static int
getULEB128Length
(Program program, Address addr) Gets the size of an unsigned little endian base 128 integer.static 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 long
readSLEB128
(Program program, Address addr) Reads an signed little endian base 128 integer from memory.static long
readULEB128
(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.
-
readULEB128
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:
- the unsigned LEB128 integer.
-
getULEB128Length
Gets the size of an unsigned little endian base 128 integer.- Parameters:
program
- the program with memory to be read.addr
- the address in memory to begin reading the unsigned LEB128.- Returns:
- the length of the unsigned LEB128 integer.
-
readSLEB128
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:
- the signed LEB128 integer.
-
getSLEB128Length
Gets the size of a signed little endian base 128 integer.- Parameters:
program
- the program with memory to be read.addr
- the address in memory to begin reading the signed LEB128.- Returns:
- the length of the signed LEB128 integer.
-