decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::SegmentedResolver Class Reference

A resolver for segmented architectures. More...

#include <architecture.hh>

Inheritance diagram for ghidra::SegmentedResolver:
ghidra::AddressResolver

Public Member Functions

 SegmentedResolver (Architecture *g, AddrSpace *sp, SegmentOp *sop)
 
virtual Address resolve (uintb val, int4 sz, const Address &point, uintb &fullEncoding)
 

Virtual destructor

More...
 

Private Attributes

Architectureglb
 The architecture owning the segmented space.
 
AddrSpacespc
 The address space being segmented.
 
SegmentOpsegop
 The segment operator.
 

Detailed Description

A resolver for segmented architectures.

When the decompiler is attempting to resolve embedded constants as pointers, this class tries to recover segment info for near pointers by looking up tracked registers in context

Constructor & Destructor Documentation

◆ SegmentedResolver()

ghidra::SegmentedResolver::SegmentedResolver ( Architecture g,
AddrSpace sp,
SegmentOp sop 
)
inline

Construct a segmented resolver

Parameters
gis the owning Architecture
spis the segmented space
sopis the segment operator

Member Function Documentation

◆ resolve()

Address ghidra::SegmentedResolver::resolve ( uintb  val,
int4  sz,
const Address point,
uintb &  fullEncoding 
)
virtual

Virtual destructor

The main resolver method.

Given a native constant in a specific context, resolve what address is being referred to. The constant can be a partially encoded pointer, in which case the full pointer encoding is recovered as well as the address. Whether or not a pointer is partially encoded or not is determined by the sz parameter, indicating the number of bytes in the pointer. A value of -1 here indicates that the pointer is known to be a full encoding.

Parameters
valis constant to be resolved to an address
szis the size of val in context (or -1).
pointis the address at which this constant is being used
fullEncodingis used to hold the full pointer encoding if val is a partial encoding
Returns
the resolved Address

Implements ghidra::AddressResolver.

References ghidra::AddrSpace::addressToByte(), and ghidra::calc_mask().


The documentation for this class was generated from the following files: