Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
MapState Class Reference

A container for hints about the data-type layout of an address space. More...

#include <varmap.hh>

Public Member Functions

 MapState (AddrSpace *spc, const RangeList &rn, const RangeList &pm, Datatype *dt)
 Constructor. More...
 
 ~MapState (void)
 Destructor.
 
bool initialize (void)
 Initialize the hint collection for iteration. More...
 
void gatherSymbols (const EntryMap *rangemap)
 Add Symbol information as hints to the collection. More...
 
void gatherVarnodes (const Funcdata &fd)
 Add stack Varnodes as hints to the collection. More...
 
void gatherHighs (const Funcdata &fd)
 Add HighVariables as hints to the collection. More...
 
void gatherOpen (const Funcdata &fd)
 Add pointer references as hints to the collection. More...
 

Detailed Description

A container for hints about the data-type layout of an address space.

A collection of data-type hints for the address space (as RangeHint objects) can be collected from Varnodes, HighVariables or other sources, using the gatherVarnodes(), gatherHighs(), and gatherOpen() methods. This class can then sort and iterate through the RangeHint objects.

Constructor & Destructor Documentation

◆ MapState()

MapState::MapState ( AddrSpace spc,
const RangeList rn,
const RangeList pm,
Datatype dt 
)

Constructor.

Parameters
spcis the address space being analyzed
rnis the subset of addresses within the address space to analyze
pmis subset of ranges within the address space considered to be parameters
dtis the default data-type

Member Function Documentation

◆ gatherHighs()

void MapState::gatherHighs ( const Funcdata fd)

Add HighVariables as hints to the collection.

Add a RangeHint corresponding to each HighVariable that is mapped to our address space for the given function.

Parameters
fdis the given function

◆ gatherOpen()

void MapState::gatherOpen ( const Funcdata fd)

Add pointer references as hints to the collection.

For any Varnode that looks like a pointer into our address space, create an open RangeHint. The size of the object may not be known.

Parameters
fdis the given function

◆ gatherSymbols()

void MapState::gatherSymbols ( const EntryMap rangemap)

Add Symbol information as hints to the collection.

Run through all Symbols in the given map and create a corresponding RangeHint to this collection for each Symbol.

Parameters
rangemapis the given map of Symbols

◆ gatherVarnodes()

void MapState::gatherVarnodes ( const Funcdata fd)

Add stack Varnodes as hints to the collection.

Add a RangeHint corresponding to each Varnode stored in the address space for the given function. The current knowledge of the Varnode's data-type is included as part of the hint.

Parameters
fdis the given function

◆ initialize()

bool MapState::initialize ( void  )

Initialize the hint collection for iteration.

Sort the collection and add a special terminating RangeHint

Returns
true if the collection isn't empty (and iteration can begin)

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