Package ghidra.program.util
Class AddressEvaluator
java.lang.Object
ghidra.program.util.AddressEvaluator
The
AddressEvaluator
class provides a way to evaluate a string
that represents an address and resolve it to an address for a particular program.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Address
Utility method for creating an Address object from a byte array.static Address
Gets a legitimate address for the specified program as indicated by the string.static Address
Gets a legitimate address for the specified program as indicated by the string.static Long
protected static boolean
parseToList
(String s, AddressFactory af, SymbolTable st, List<Object> list)
-
Constructor Details
-
AddressEvaluator
public AddressEvaluator()
-
-
Method Details
-
evaluate
Gets a legitimate address for the specified program as indicated by the string.- Parameters:
p
- the program to use for determining the address.baseAddr
- the base address to use for relative addressing.s
- string representation of the address desired.- Returns:
- the address. Otherwise, return null if the string fails to evaluate to a unique legitimate address.
-
evaluateToLong
-
parseToList
protected static boolean parseToList(String s, AddressFactory af, SymbolTable st, List<Object> list) -
evaluate
Gets a legitimate address for the specified program as indicated by the string.- Parameters:
p
- the program to use for determining the address.s
- string representation of the address desired.- Returns:
- the address. Otherwise, return null if the string fails to evaluate to a legitimate address.
-
evaluate
Utility method for creating an Address object from a byte array. The Address object may or may not be a legitimate Address in the program's address space. This method is meant to provide a way of creating an Address object from a sequence of bytes that can be used for additional tests and comparisons.- Parameters:
p
- - program being analyzed.addrBytes
- - byte array to use containing the values the address will be constructed from.- Returns:
- - Address object constructed from the addrBytes array. Returns null if the program is null, addrBytes is null, or the length of addrBytes does not match the default Pointer size or does not contain a valid offset.
-