Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Analyser Class Reference

#include <analy.h>

Inheritance diagram for Analyser:

Object ClassAnalyser CoffAnalyser ElfAnalyser FLTAnalyser LEAnalyser MachoAnalyser NEAnalyser PEAnalyser PEFAnalyser XBEAnalyser List of all members.

Public Member Functions

void init ()
int load (ht_object_stream *f)
virtual void done ()
bool addAddressSymbol (Address *Addr, const char *Prefix, labeltype type, Location *infunc=NULL)
void addComment (Address *Addr, int line, const char *c)
bool addSymbol (Address *Addr, const char *label, labeltype type, Location *infunc=NULL)
virtual FILEOFS addressToFileofs (Address *Addr)=0
bool addXRef (Address *from, Address *to, xref_enum_t action)
void assignComment (Address *Addr, int line, const char *c)
bool assignSymbol (Address *Addr, const char *label, labeltype type, Location *infunc=NULL)
void assignXRef (Address *from, Address *to, xref_enum_t action)
virtual void beginAnalysis ()
virtual UINT bufPtr (Address *Addr, byte *buf, int size)=0
bool continueAnalysis ()
void continueAnalysisAt (Address *Addr)
virtual AddresscreateAddress ()=0
void dataAccess (Address *Addr, taccess access)
void deleteLocation (Address *Addr)
void deleteSymbol (Address *Addr)
bool deleteXRef (Address *from, Address *to)
void disableSymbol (Symbol *label)
void doBranch (branch_enum_t branch, OPCODE *opcode, int len)
void engageCodeanalyser ()
LocationenumLocations (Address *Addr)
LocationenumLocationsReverse (Address *Addr)
SymbolenumSymbolsByName (const char *at)
SymbolenumSymbolsByNameReverse (const char *at)
SymbolenumSymbols (Symbol *sym)
SymbolenumSymbolsReverse (Symbol *sym)
virtual taddr_typetype examineData (Address *Addr)
void finish ()
void freeLocation (Location *loc)
void freeLocations (Location *locs)
void freeComments (Location *loc)
void freeSymbol (Symbol *sym)
void freeSymbols (Symbol *syms)
LocationgetLocationByAddress (Address *Addr)
LocationgetLocationContextByAddress (Address *Addr)
int getLocationCount ()
LocationgetFunctionByAddress (Address *Addr)
LocationgetPreviousSymbolByAddress (Address *Addr)
virtual const char * getSegmentNameByAddress (Address *Addr)
SymbolgetSymbolByAddress (Address *Addr)
SymbolgetSymbolByName (const char *label)
const char * getSymbolNameByLocation (Location *loc)
int getSymbolCount ()
bool gotoAddress (Address *Addr, Address *func)
virtual void initCodeAnalyser ()
virtual void initDataAnalyser ()
virtual void initUnasm ()=0
virtual void log (const char *s)
virtual CPU_ADDR mapAddr (Address *Addr)
LocationnewLocation (Address *Addr)
LocationnewLocation (Location *&locs, Address *Addr)
SymbolnewSymbol (const char *label, Location *loc, labeltype type, Location *infunc)
SymbolnewSymbol (Symbol *&syms, const char *label, Location *loc, labeltype type)
virtual AddressnextValid (Address *Addr)=0
void optimizeLocationTree ()
void optimizeSymbolTree ()
bool popAddress (Address **Addr, Address **func)
void pushAddress (Address *Addr, Address *func)
virtual int queryConfig (int mode)
void setActive (bool mode)
void setLocationFunction (Location *a, Location *func)
void setLocationTreeOptimizeThreshold (int threshold)
void setDisasm (Disassembler *d)
void setSymbolTreeOptimizeThreshold (int threshold)
virtual void store (ht_object_stream *f)
virtual bool validAddress (Address *addr, tsectype action)=0
bool validCodeAddress (Address *addr)
bool validReadAddress (Address *addr)
bool validWriteAddress (Address *addr)
virtual AssemblercreateAssembler ()
virtual AddressfileofsToAddress (FILEOFS fileofs)
CommentListgetComments (Address *Addr)
const char * getDisasmStr (Address *Addr, int &length)
const char * getDisasmStrFormatted (Address *Addr)
int getDisplayMode ()
virtual const char * getName ()
virtual const char * getType ()
ht_treegetXRefs (Address *Addr)
bool isDirty ()
void makeDirty ()
void setDisplayMode (int enable, int disable)
void toggleDisplayMode (int toggle)

Public Attributes

Addressaddr
Addressinvalid_addr
ht_queueaddr_queue
int ops_parsed
bool active
Addressnext_explored
Addressfirst_explored
Addresslast_explored
bool next_address_is_invalid
Areaexplored
Areainitialized
Locationlocations
CodeAnalysercode
DataAnalyserdata
AnalyDisassembleranaly_disasm
Disassemblerdisasm
Symbolsymbols
int location_threshold
int symbol_threshold
int cur_addr_ops
int cur_label_ops
int max_opcode_length
Locationcur_func
bool dirty
int symbol_count
int location_count
int mode

Member Function Documentation

bool Analyser::addAddressSymbol Address Addr,
const char *  Prefix,
labeltype  type,
Location infunc = NULL
 

Definition at line 737 of file analy.cc.

References ADDRESS_STRING_FORMAT_COMPACT, addSymbol(), global_analyser_address_string_format, ht_snprintf(), label_prefix(), scvalid, and validAddress().

Referenced by ClassAnalyser::beginAnalysis(), dataAccess(), ht_aviewer::dataStringDialog(), and doBranch().

void Analyser::addComment Address Addr,
int  line,
const char *  c
 

Definition at line 758 of file analy.cc.

References CommentList::appendPreComment(), Location::comments, DPRINTF, CommentList::init(), and newLocation().

Referenced by assignComment(), XBEAnalyser::beginAnalysis(), PEFAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ClassAnalyser::beginAnalysis(), dataAccess(), ht_aviewer::dataStringDialog(), doBranch(), ElfAnalyser::initInsertSymbols(), and ht_aviewer::showComments().

virtual FILEOFS Analyser::addressToFileofs Address Addr  )  [pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by AnalyserHTOutput::endLine(), ht_aviewer::get_current_offset(), and ht_aviewer::pos_to_offset().

bool Analyser::addSymbol Address Addr,
const char *  label,
labeltype  type,
Location infunc = NULL
 

Definition at line 783 of file analy.cc.

References Location::addr, Address::compareTo(), data, dst_function, dst_location, dt_unknown, dt_unknown_data, Location::label, label_data, label_func, label_loc, label_unknown, Symbol::location, newLocation(), newSymbol(), scvalid, DataAnalyser::setAddressType(), DataAnalyser::setCodeAddressType(), taddr_type::type, Location::type, validAddress(), and validCodeAddress().

Referenced by addAddressSymbol(), and doBranch().

bool Analyser::addXRef Address from,
Address to,
xref_enum_t  action
 

Definition at line 829 of file analy.cc.

References compare_keys_ht_data(), DPRINTF, DUP_ADDR, ht_tree::get(), ht_tree::insert(), newLocation(), scvalid, validAddress(), and Location::xrefs.

Referenced by AnalyX86Disassembler::branchAddr(), doBranch(), AnalyX86Disassembler::examineOpcode(), ht_aviewer::searchForXRefs(), and ht_aviewer::showXRefs().

void Analyser::assignComment Address Addr,
int  line,
const char *  c
 

Definition at line 856 of file analy.cc.

References addComment().

bool Analyser::assignSymbol Address Addr,
const char *  label,
labeltype  type,
Location infunc = NULL
 

Definition at line 865 of file analy.cc.

References Location::addr, Address::compareTo(), data, disableSymbol(), dst_function, dst_location, dt_unknown, dt_unknown_data, Location::label, label_data, label_func, label_loc, label_unknown, Symbol::location, newLocation(), newSymbol(), scvalid, DataAnalyser::setAddressType(), DataAnalyser::setCodeAddressType(), taddr_type::type, Location::type, validAddress(), and validCodeAddress().

Referenced by XBEAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ht_aviewer::handlemsg(), ElfAnalyser::initInsertFakeSymbols(), and ElfAnalyser::initInsertSymbols().

void Analyser::assignXRef Address from,
Address to,
xref_enum_t  action
 

Definition at line 912 of file analy.cc.

References compare_keys_ht_data(), DPRINTF, DUP_ADDR, ht_tree::get(), ht_tree::insert(), newLocation(), scvalid, AddrXRef::type, validAddress(), and Location::xrefs.

void Analyser::beginAnalysis  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 942 of file analy.cc.

References analy_disasm, disasm, DPRINTF, gotoAddress(), invalid_addr, ops_parsed, Q_DO_ANALYSIS, queryConfig(), and setActive().

Referenced by XBEAnalyser::beginAnalysis(), PEFAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ClassAnalyser::beginAnalysis(), continueAnalysisAt(), and ht_aviewer::handlemsg().

virtual UINT Analyser::bufPtr Address Addr,
byte *  buf,
int  size
[pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by continueAnalysis(), dataAccess(), ht_aviewer::dataStringDialog(), doBranch(), AnalyserOutput::generateAddr(), getDisasmStr(), getDisasmStrFormatted(), ht_aviewer::handlemsg(), and srt_x86().

bool Analyser::continueAnalysis  ) 
 

Definition at line 958 of file analy.cc.

References active, Address::add(), Location::addr, addr, AF_FUNCTION_END, analy_disasm, assert, br_nobranch, branch_enum_t, buf, bufPtr(), byte, cur_func, Disassembler::decode(), Address::difference(), disasm, doBranch(), DPRINTF, Disassembler::duplicateInsn(), AnalyDisassembler::examineOpcode(), finish(), Location::flags, Disassembler::getSize(), gotoAddress(), invalid_addr, AnalyDisassembler::isBranch(), last_explored, len, mapAddr(), max_opcode_length, MAX_OPS_PER_CONTINUE, newLocation(), next_address_is_invalid, next_explored, num_ops_parsed, OPCODE, ops_parsed, Disassembler::selectNext(), Disassembler::str(), UINT, validCodeAddress(), and Disassembler::validInsn().

Referenced by ht_aviewer::idle().

void Analyser::continueAnalysisAt Address Addr  ) 
 

Definition at line 1029 of file analy.cc.

References active, beginAnalysis(), data, disasm, DPRINTF, dst_function, pushAddress(), Q_DO_ANALYSIS, queryConfig(), sccode, DataAnalyser::setCodeAddressType(), and validAddress().

Referenced by ht_aviewer::handlemsg().

virtual Address* Analyser::createAddress  )  [pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by ht_aviewer::convertViewerPosToAddress(), ht_analy_sub::getline(), ht_aviewer::handlemsg(), ht_analy_sub::next_line_id(), ht_analy_sub::prev_line_id(), ht_aviewer::qword_to_pos(), and ht_aviewer::ref_sel().

Assembler * Analyser::createAssembler  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1051 of file analy.cc.

References NULL.

Referenced by ht_aviewer::handlemsg().

void Analyser::dataAccess Address Addr,
taccess  access
 

Definition at line 1059 of file analy.cc.

References acoffset, addAddressSymbol(), addComment(), addr, ADDRESS_STRING_FORMAT_LEADING_ZEROS, assert, buf, bufPtr(), byte, data, Disassembler::decode(), disasm, analy_string::done(), DPRINTF, dst_cunknown, dst_ibyte, dst_idword, dst_iword, dst_string, dt_code, dt_unknown, getLocationByAddress(), global_analyser_address_string_format, ht_snprintf(), label_data, label_func, analy_string::length(), log(), LPRFX_DTA, LPRFX_DTU, LPRFX_OFS, make_valid_name(), mapAddr(), max_opcode_length, MIN, analy_string::name(), OPCODE, pushAddress(), analy_string::render_string(), scinitialized, scvalid, DataAnalyser::setArrayAddressType(), DataAnalyser::setCodeAddressType(), DataAnalyser::setIntAddressType(), taccess::size, string_test(), taddr_type::type, Location::type, taccess::type, UINT, validAddress(), validCodeAddress(), and Disassembler::validInsn().

Referenced by AnalyX86Disassembler::branchAddr(), and AnalyX86Disassembler::examineOpcode().

void Analyser::deleteLocation Address Addr  ) 
 

Definition at line 1130 of file analy.cc.

References AF_DELETED, disableSymbol(), Location::flags, getLocationByAddress(), Location::label, location_count, and NULL.

Referenced by ht_aviewer::handlemsg().

void Analyser::deleteSymbol Address Addr  ) 
 

Definition at line 1144 of file analy.cc.

References disableSymbol(), getLocationByAddress(), Location::label, NULL, and symbol_count.

Referenced by ht_aviewer::handlemsg().

bool Analyser::deleteXRef Address from,
Address to
 

Definition at line 1157 of file analy.cc.

References ht_tree::del(), DPRINTF, getLocationByAddress(), scvalid, validAddress(), and Location::xrefs.

Referenced by ht_aviewer::showXRefs().

void Analyser::disableSymbol Symbol label  ) 
 

Definition at line 1177 of file analy.cc.

References Symbol::location, and NULL.

Referenced by assignSymbol(), deleteLocation(), and deleteSymbol().

void Analyser::doBranch branch_enum_t  branch,
OPCODE *  opcode,
int  len
 

Definition at line 1187 of file analy.cc.

References Address::add(), addAddressSymbol(), addComment(), Location::addr, addr, ADDRESS_STRING_FORMAT_COMPACT, ADDRESS_STRING_FORMAT_LEADING_ZEROS, addSymbol(), addXRef(), AF_FUNCTION_END, analy_disasm, br_call, br_jump, br_jXX, br_return, branch_enum_t, AnalyDisassembler::branchAddr(), buf, bufPtr(), byte, Address::compareTo(), cur_func, Disassembler::decode(), disasm, DUP_ADDR, Location::flags, getSymbolByAddress(), global_analyser_address_string_format, ht_snprintf(), invalid_addr, AnalyDisassembler::isBranch(), Address::isValid(), label_func, label_loc, label_prefix(), len, log(), LPRFX_LOC, LPRFX_STUB, LPRFX_SUB, LPRFX_WRAP, mapAddr(), max_opcode_length, MIN, Symbol::name, newLocation(), next_address_is_invalid, OPCODE, pushAddress(), scvalid, validAddress(), validCodeAddress(), xrefcall, and xrefjump.

Referenced by continueAnalysis().

void Analyser::done  )  [virtual]
 

Reimplemented from Object.

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 694 of file analy.cc.

References addr, addr_queue, analy_disasm, code, data, ht_clist::destroy(), disasm, AnalyDisassembler::done(), Object::done(), DataAnalyser::done(), CodeAnalyser::done(), Area::done(), explored, first_explored, freeLocations(), freeSymbols(), initialized, invalid_addr, last_explored, locations, next_explored, setActive(), and symbols.

Referenced by XBEAnalyser::done(), PEFAnalyser::done(), PEAnalyser::done(), NEAnalyser::done(), MachoAnalyser::done(), LEAnalyser::done(), ht_aviewer::done(), FLTAnalyser::done(), ElfAnalyser::done(), CoffAnalyser::done(), ClassAnalyser::done(), and ht_aviewer::handlemsg().

void Analyser::engageCodeanalyser  ) 
 

Definition at line 1298 of file analy.cc.

References DPRINTF, Q_ENGAGE_CODE_ANALYSER, and queryConfig().

Location * Analyser::enumLocations Address Addr  ) 
 

Definition at line 1318 of file analy.cc.

References Location::addr, AF_DELETED, Location::flags, locations, and NULL.

Referenced by ht_aviewer::dataStringDialog(), and AnalyserOutput::generateAddr().

Location * Analyser::enumLocationsReverse Address Addr  ) 
 

Definition at line 1343 of file analy.cc.

References Location::addr, AF_DELETED, Location::flags, locations, and NULL.

Referenced by getFunctionByAddress(), getLocationContextByAddress(), getPreviousSymbolByAddress(), and AnalyserOutput::prevLine().

Symbol * Analyser::enumSymbols Symbol sym  ) 
 

Definition at line 1419 of file analy.cc.

References enumSymbolsByName(), Symbol::name, and NULL.

Referenced by export_to_sym(), SymbolBox::getFirst(), SymbolBox::getNext(), and SymbolBox::quickfindCompletition().

Symbol * Analyser::enumSymbolsByName const char *  at  ) 
 

Definition at line 1372 of file analy.cc.

References Symbol::location, Symbol::name, NULL, and symbols.

Referenced by enumSymbols(), SymbolBox::quickfind(), and SymbolBox::quickfindCompletition().

Symbol * Analyser::enumSymbolsByNameReverse const char *  at  ) 
 

Definition at line 1402 of file analy.cc.

References Symbol::location, Symbol::name, NULL, and symbols.

Referenced by enumSymbolsReverse().

Symbol * Analyser::enumSymbolsReverse Symbol sym  ) 
 

Definition at line 1428 of file analy.cc.

References enumSymbolsByNameReverse(), Symbol::name, and NULL.

Referenced by SymbolBox::getLast(), and SymbolBox::getPrev().

taddr_typetype Analyser::examineData Address Addr  )  [virtual]
 

Definition at line 1441 of file analy.cc.

References DPRINTF, dt_unknown, scinitialized, taddr_typetype, validAddress(), and validReadAddress().

Address * Analyser::fileofsToAddress FILEOFS  fileaddr  )  [virtual]
 

converts |FILEOFS fileaddr| to |Address|

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1548 of file analy.cc.

References DUP_ADDR, FILEOFS, and invalid_addr.

Referenced by ht_aviewer::offset_to_pos().

void Analyser::finish  ) 
 

called once every time the analyser has nothing more to do.

Definition at line 1557 of file analy.cc.

References addr, cur_func, DPRINTF, NULL, and setActive().

Referenced by continueAnalysis().

void Analyser::freeComments Location loc  ) 
 

Definition at line 1598 of file analy.cc.

References Location::comments, ht_clist::destroy(), and NULL.

Referenced by freeLocation(), and ht_aviewer::showComments().

void Analyser::freeLocation Location loc  ) 
 

Definition at line 1569 of file analy.cc.

References Location::addr, ht_tree::destroy(), freeComments(), and Location::xrefs.

Referenced by freeLocations().

void Analyser::freeLocations Location locs  ) 
 

Definition at line 1586 of file analy.cc.

References freeLocation(), Location::left, and Location::right.

Referenced by done().

void Analyser::freeSymbol Symbol sym  ) 
 

Definition at line 1611 of file analy.cc.

References Symbol::name.

Referenced by freeSymbols().

void Analyser::freeSymbols Symbol syms  ) 
 

Definition at line 1623 of file analy.cc.

References freeSymbol(), Symbol::left, and Symbol::right.

Referenced by done().

CommentList * Analyser::getComments Address Addr  ) 
 

Definition at line 1635 of file analy.cc.

References Location::comments, getLocationByAddress(), and NULL.

Referenced by ht_aviewer::showComments().

const char * Analyser::getDisasmStr Address Addr,
int &  length
 

Definition at line 1660 of file analy.cc.

References addr_sym_func, buf, bufPtr(), byte, Disassembler::decode(), DIS_STYLE_HEX_ASMSTYLE, DIS_STYLE_HEX_NOZEROPAD, disasm, DISASM_STRF_SMALL_FORMAT, Disassembler::getSize(), mapAddr(), max_opcode_length, MIN, NULL, OPCODE, scinitialized, Disassembler::strf(), and validAddress().

Referenced by AnalyInfoline::gettext(), and ht_aviewer::handlemsg().

const char * Analyser::getDisasmStrFormatted Address Addr  ) 
 

Definition at line 1681 of file analy.cc.

References addr_sym_func, addr_sym_func_context, buf, bufPtr(), byte, Disassembler::decode(), DIS_STYLE_HEX_ASMSTYLE, DIS_STYLE_HEX_NOZEROPAD, disasm, DISASM_STRF_SMALL_FORMAT, mapAddr(), max_opcode_length, MIN, NULL, OPCODE, and Disassembler::strf().

Referenced by ht_aviewer::handlemsg().

int Analyser::getDisplayMode  ) 
 

Definition at line 1704 of file analy.cc.

References mode.

Referenced by ht_aviewer::searchForXRefs().

Location * Analyser::getFunctionByAddress Address Addr  ) 
 

Definition at line 1492 of file analy.cc.

References Location::addr, AF_FUNCTION_END, AF_FUNCTION_SET, enumLocationsReverse(), Location::flags, getLocationByAddress(), NULL, and Location::thisfunc.

Referenced by AnalyInfoline::gettext(), ht_aviewer::handlemsg(), ht_aviewer::pos_to_string(), ht_aviewer::showCallChain(), and ht_aviewer::showXRefs().

Location * Analyser::getLocationByAddress Address Addr  ) 
 

Definition at line 1466 of file analy.cc.

References locations.

Referenced by dataAccess(), deleteLocation(), deleteSymbol(), deleteXRef(), AnalyserOutput::generateAddr(), getComments(), getFunctionByAddress(), getPreviousSymbolByAddress(), getSymbolByAddress(), getXRefs(), ht_aviewer::pos_to_string(), ht_aviewer::showComments(), and validCodeAddress().

Location * Analyser::getLocationContextByAddress Address Addr  ) 
 

Definition at line 1474 of file analy.cc.

References Address::add(), Location::addr, Address::compareTo(), dt_unknown, DUP_ADDR, enumLocationsReverse(), taddr_type::length, NULL, taddr_type::type, and Location::type.

Referenced by ht_aviewer::canCreateAddress().

int Analyser::getLocationCount  ) 
 

Definition at line 1721 of file analy.cc.

References locations.

Referenced by AnalyserInformation::idle(), and store().

const char * Analyser::getName  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1731 of file analy.cc.

Referenced by AnalyserTxtOutput::header(), ht_aviewer::idle(), and AnalyserInformation::idle().

Location * Analyser::getPreviousSymbolByAddress Address Addr  ) 
 

Definition at line 1506 of file analy.cc.

References Location::addr, AF_FUNCTION_END, enumLocationsReverse(), Location::flags, getLocationByAddress(), Location::label, and NULL.

Referenced by ht_aviewer::handlemsg(), and ht_aviewer::showSymbols().

const char * Analyser::getSegmentNameByAddress Address Addr  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1758 of file analy.cc.

References NULL.

Referenced by AnalyInfoline::gettext().

Symbol * Analyser::getSymbolByAddress Address Addr  ) 
 

Definition at line 1766 of file analy.cc.

References getLocationByAddress(), Location::label, and NULL.

Referenced by doBranch(), and ht_aviewer::handlemsg().

Symbol * Analyser::getSymbolByName const char *  label  ) 
 

Definition at line 1534 of file analy.cc.

References symbols.

Referenced by ht_aviewer::handlemsg(), ElfAnalyser::initInsertSymbols(), SymbolBox::quickfind(), SymbolBox::quickfindCompletition(), and ht_aviewer::symbol_handler().

int Analyser::getSymbolCount  ) 
 

Definition at line 1748 of file analy.cc.

References symbols.

Referenced by SymbolBox::calcCount(), SymbolBox::idle(), AnalyserInformation::idle(), SymbolBox::init(), and store().

const char * Analyser::getSymbolNameByLocation Location loc  ) 
 

Definition at line 1539 of file analy.cc.

References Location::label, Symbol::name, and NULL.

Referenced by AnalyInfoline::gettext(), and ht_aviewer::showXRefs().

const char * Analyser::getType  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1776 of file analy.cc.

Referenced by AnalyserInformation::idle().

ht_tree * Analyser::getXRefs Address Addr  ) 
 

Definition at line 1784 of file analy.cc.

References getLocationByAddress(), NULL, and Location::xrefs.

Referenced by ht_aviewer::showXRefs().

bool Analyser::gotoAddress Address Addr,
Address func
 

Definition at line 1794 of file analy.cc.

References Area::add(), addr, Area::contains(), cur_func, Address::difference(), DPRINTF, DUP_ADDR, explored, Area::findNext(), first_explored, Address::isValid(), last_explored, newLocation(), next_explored, popAddress(), setLocationFunction(), and validCodeAddress().

Referenced by beginAnalysis(), and continueAnalysis().

void Analyser::init  ) 
 

Reimplemented from Object.

Definition at line 489 of file analy.cc.

References active, addr, addr_queue, analy_disasm, ANALY_TRANSLATE_SYMBOLS, cur_addr_ops, cur_func, cur_label_ops, dirty, disasm, explored, first_explored, Area::init(), ht_clist::init(), initCodeAnalyser(), initDataAnalyser(), initialized, initUnasm(), invalid_addr, last_explored, location_count, locations, max_opcode_length, mode, next_address_is_invalid, next_explored, NULL, ops_parsed, setLocationTreeOptimizeThreshold(), setSymbolTreeOptimizeThreshold(), symbol_count, and symbols.

Referenced by XBEAnalyser::init(), PEFAnalyser::init(), PEAnalyser::init(), NEAnalyser::init(), MachoAnalyser::init(), LEAnalyser::init(), FLTAnalyser::init(), ElfAnalyser::init(), CoffAnalyser::init(), and ClassAnalyser::init().

void Analyser::initCodeAnalyser  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1850 of file analy.cc.

References code, and CodeAnalyser::init().

Referenced by init(), XBEAnalyser::initCodeAnalyser(), PEFAnalyser::initCodeAnalyser(), PEAnalyser::initCodeAnalyser(), NEAnalyser::initCodeAnalyser(), MachoAnalyser::initCodeAnalyser(), LEAnalyser::initCodeAnalyser(), FLTAnalyser::initCodeAnalyser(), ElfAnalyser::initCodeAnalyser(), CoffAnalyser::initCodeAnalyser(), and ClassAnalyser::initCodeAnalyser().

void Analyser::initDataAnalyser  )  [virtual]
 

Definition at line 1859 of file analy.cc.

References data, and DataAnalyser::init().

Referenced by init().

virtual void Analyser::initUnasm  )  [pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by init().

bool Analyser::isDirty  ) 
 

Definition at line 1868 of file analy.cc.

References dirty.

Referenced by ht_aviewer::get_pindicator_str(), and ht_file_window::handlemsg().

int Analyser::load ht_object_stream st  )  [virtual]
 

loads object from object stream.

Returns:
ht_stream errorcode

Reimplemented from Object.

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 622 of file analy.cc.

References active, addr, addr_queue, DataAnalyser::analy, AnalyDisassembler::analy, analy_disasm, code, cur_addr_ops, cur_func, cur_label_ops, data, dirty, AnalyDisassembler::disasm, disasm, explored, first_explored, GET_BOOL, ht_layer_stream::get_error(), GET_INT_DEC, GET_INT_HEX, GET_OBJECT, ht_object_stream::getObject(), initialized, invalid_addr, last_explored, location_count, location_threshold, locations, max_opcode_length, mode, newLocation(), next_address_is_invalid, next_explored, NULL, ops_parsed, setLocationTreeOptimizeThreshold(), setSymbolTreeOptimizeThreshold(), some_analyser_active, symbol_count, symbol_threshold, and symbols.

Referenced by XBEAnalyser::load(), PEFAnalyser::load(), PEAnalyser::load(), NEAnalyser::load(), MachoAnalyser::load(), LEAnalyser::load(), FLTAnalyser::load(), ElfAnalyser::load(), CoffAnalyser::load(), and ClassAnalyser::load().

void Analyser::log const char *  s  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 1876 of file analy.cc.

Referenced by dataAccess(), and doBranch().

void Analyser::makeDirty  ) 
 

Definition at line 1884 of file analy.cc.

References dirty.

Referenced by ht_aviewer::handlemsg(), ht_aviewer::searchForXRefs(), ht_aviewer::showComments(), and ht_aviewer::showXRefs().

CPU_ADDR Analyser::mapAddr Address Addr  )  [virtual]
 

Definition at line 1892 of file analy.cc.

References Address::putIntoCPUAddress().

Referenced by continueAnalysis(), dataAccess(), doBranch(), AnalyserOutput::generateAddr(), getDisasmStr(), getDisasmStrFormatted(), and ht_aviewer::handlemsg().

Location * Analyser::newLocation Location *&  locs,
Address Addr
 

Definition at line 1905 of file analy.cc.

References Location::addr, AF_DELETED, Address::compareTo(), DUP_ADDR, Location::flags, Location::left, location_count, newLocation(), Location::right, and smalloc0().

Location * Analyser::newLocation Address Addr  ) 
 

Definition at line 1922 of file analy.cc.

References locations.

Referenced by addComment(), addSymbol(), addXRef(), assignSymbol(), assignXRef(), XBEAnalyser::beginAnalysis(), PEFAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), continueAnalysis(), doBranch(), gotoAddress(), load(), newLocation(), DataAnalyser::setAddressType(), DataAnalyser::setArrayAddressType(), DataAnalyser::setCodeAddressType(), DataAnalyser::setFloatAddressType(), and DataAnalyser::setIntAddressType().

Symbol * Analyser::newSymbol Symbol *&  syms,
const char *  label,
Location loc,
labeltype  type
 

Definition at line 1930 of file analy.cc.

References ht_strdup(), label_unknown, Symbol::left, Symbol::location, Symbol::name, newSymbol(), Symbol::right, smalloc0(), symbol_count, and Symbol::type.

Symbol * Analyser::newSymbol const char *  label,
Location loc,
labeltype  type,
Location infunc
 

Definition at line 1953 of file analy.cc.

References Symbol::location, setLocationFunction(), and symbols.

Referenced by addSymbol(), assignSymbol(), and newSymbol().

virtual Address* Analyser::nextValid Address Addr  )  [pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by AnalyserOutput::generateAddr().

void Analyser::optimizeLocationTree  ) 
 

Definition at line 1966 of file analy.cc.

References cur_addr_ops, and location_threshold.

void Analyser::optimizeSymbolTree  ) 
 

Definition at line 1975 of file analy.cc.

References cur_label_ops, and symbol_threshold.

bool Analyser::popAddress Address **  Addr,
Address **  func
 

Definition at line 1984 of file analy.cc.

References AddressQueueItem::addr, addr_queue, ht_clist::count(), ht_queue::dequeue(), DPRINTF, DUP_ADDR, and AddressQueueItem::func.

Referenced by gotoAddress().

void Analyser::pushAddress Address Addr,
Address func
 

Definition at line 2005 of file analy.cc.

References Location::addr, addr_queue, cur_func, DPRINTF, ht_queue::enqueue(), Address::isValid(), and validCodeAddress().

Referenced by XBEAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ClassAnalyser::beginAnalysis(), continueAnalysisAt(), dataAccess(), doBranch(), and ElfAnalyser::initInsertSymbols().

int Analyser::queryConfig int  mode  )  [virtual]
 

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 2022 of file analy.cc.

Referenced by beginAnalysis(), continueAnalysisAt(), and engageCodeanalyser().

void Analyser::setActive bool  mode  ) 
 

Definition at line 2123 of file analy.cc.

References active, and some_analyser_active.

Referenced by beginAnalysis(), done(), and finish().

void Analyser::setDisasm Disassembler d  ) 
 

Definition at line 2162 of file analy.cc.

References disasm, Disassembler::getOpcodeMetrics(), and max_opcode_length.

Referenced by AnalyDisassembler::initDisasm().

void Analyser::setDisplayMode int  enable,
int  disable
 

Definition at line 2141 of file analy.cc.

References mode.

Referenced by ht_aviewer::handlemsg(), ht_aviewer::init(), and ht_aviewer::searchForXRefs().

void Analyser::setLocationFunction Location a,
Location func
 

Definition at line 2150 of file analy.cc.

References AF_FUNCTION_END, AF_FUNCTION_SET, Location::flags, and Location::thisfunc.

Referenced by gotoAddress(), and newSymbol().

void Analyser::setLocationTreeOptimizeThreshold int  threshold  ) 
 

Definition at line 2177 of file analy.cc.

References cur_addr_ops, and location_threshold.

Referenced by XBEAnalyser::beginAnalysis(), PEFAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ClassAnalyser::beginAnalysis(), NEAnalyser::init(), LEAnalyser::init(), CoffAnalyser::init(), ClassAnalyser::init(), init(), and load().

void Analyser::setSymbolTreeOptimizeThreshold int  threshold  ) 
 

Definition at line 2186 of file analy.cc.

References cur_label_ops, and symbol_threshold.

Referenced by XBEAnalyser::beginAnalysis(), PEFAnalyser::beginAnalysis(), PEAnalyser::beginAnalysis(), NEAnalyser::beginAnalysis(), MachoAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), FLTAnalyser::beginAnalysis(), ElfAnalyser::beginAnalysis(), CoffAnalyser::beginAnalysis(), ClassAnalyser::beginAnalysis(), NEAnalyser::init(), LEAnalyser::init(), CoffAnalyser::init(), ClassAnalyser::init(), init(), and load().

void Analyser::store ht_object_stream st  )  [virtual]
 

stores object.

Reimplemented from Object.

Reimplemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Definition at line 2079 of file analy.cc.

References active, Location::addr, addr, addr_queue, analy_disasm, code, cur_func, data, dirty, disasm, explored, first_explored, getLocationCount(), getSymbolCount(), initialized, last_explored, location_threshold, locations, max_opcode_length, mode, next_explored, NULL, ops_parsed, PUT_BOOL, PUT_INT_DEC, PUT_INT_HEX, PUT_OBJECT, ht_object_stream::putInfo(), ht_object_stream::putIntDec(), ht_object_stream::putObject(), symbol_threshold, and symbols.

Referenced by XBEAnalyser::store(), PEFAnalyser::store(), PEAnalyser::store(), NEAnalyser::store(), MachoAnalyser::store(), LEAnalyser::store(), FLTAnalyser::store(), ElfAnalyser::store(), CoffAnalyser::store(), and ClassAnalyser::store().

void Analyser::toggleDisplayMode int  toggle  ) 
 

Definition at line 2195 of file analy.cc.

References mode.

virtual bool Analyser::validAddress Address addr,
tsectype  action
[pure virtual]
 

Implemented in ClassAnalyser, CoffAnalyser, ElfAnalyser, FLTAnalyser, LEAnalyser, MachoAnalyser, NEAnalyser, PEAnalyser, PEFAnalyser, and XBEAnalyser.

Referenced by addAddressSymbol(), addSymbol(), addXRef(), assignSymbol(), assignXRef(), AnalyX86Disassembler::branchAddr(), AnalyPPCDisassembler::branchAddr(), AnalyAlphaDisassembler::branchAddr(), continueAnalysisAt(), dataAccess(), ht_aviewer::dataStringDialog(), deleteXRef(), doBranch(), AnalyserHTOutput::endLine(), examineData(), AnalyX86Disassembler::examineOpcode(), AnalyserOutput::generateAddr(), getDisasmStr(), ht_aviewer::gotoAddress(), ht_aviewer::handlemsg(), ht_aviewer::qword_to_pos(), srt_x86(), validCodeAddress(), validReadAddress(), and validWriteAddress().

bool Analyser::validCodeAddress Address addr  ) 
 

Definition at line 2203 of file analy.cc.

References dt_code, dt_unknown, getLocationByAddress(), sccode, taddr_type::type, Location::type, and validAddress().

Referenced by addSymbol(), assignSymbol(), NEAnalyser::beginAnalysis(), LEAnalyser::beginAnalysis(), continueAnalysis(), dataAccess(), doBranch(), AnalyserOutput::generateAddr(), gotoAddress(), and pushAddress().

bool Analyser::validReadAddress Address addr  ) 
 

Definition at line 2215 of file analy.cc.

References scread, and validAddress().

Referenced by examineData().

bool Analyser::validWriteAddress Address addr  ) 
 

Definition at line 2223 of file analy.cc.

References scwrite, and validAddress().


Member Data Documentation

bool Analyser::active
 

Definition at line 300 of file analy.h.

Referenced by continueAnalysis(), continueAnalysisAt(), export_to_sym(), ht_aviewer::exportFileDialog(), generate_html_output(), AnalyserOutput::generateFile(), ht_aviewer::generateOutputDialog(), ht_aviewer::idle(), init(), load(), setActive(), and store().

Address* Analyser::addr
 

Definition at line 296 of file analy.h.

Referenced by AnalyX86Disassembler::branchAddr(), continueAnalysis(), dataAccess(), doBranch(), done(), AnalyX86Disassembler::examineOpcode(), finish(), gotoAddress(), init(), load(), and store().

ht_queue* Analyser::addr_queue
 

Definition at line 298 of file analy.h.

Referenced by done(), init(), load(), popAddress(), pushAddress(), and store().

AnalyDisassembler* Analyser::analy_disasm
 

Definition at line 308 of file analy.h.

Referenced by beginAnalysis(), continueAnalysis(), doBranch(), done(), init(), load(), and store().

CodeAnalyser* Analyser::code
 

Definition at line 306 of file analy.h.

Referenced by done(), initCodeAnalyser(), load(), and store().

int Analyser::cur_addr_ops
 

Definition at line 312 of file analy.h.

Referenced by init(), load(), optimizeLocationTree(), and setLocationTreeOptimizeThreshold().

Location* Analyser::cur_func
 

Definition at line 314 of file analy.h.

Referenced by continueAnalysis(), doBranch(), finish(), gotoAddress(), init(), load(), pushAddress(), and store().

int Analyser::cur_label_ops
 

Definition at line 312 of file analy.h.

Referenced by init(), load(), optimizeSymbolTree(), and setSymbolTreeOptimizeThreshold().

DataAnalyser* Analyser::data
 

Definition at line 307 of file analy.h.

Referenced by addSymbol(), assignSymbol(), continueAnalysisAt(), dataAccess(), ht_aviewer::dataStringDialog(), done(), initDataAnalyser(), load(), and store().

bool Analyser::dirty
 

Definition at line 315 of file analy.h.

Referenced by init(), isDirty(), load(), makeDirty(), and store().

Disassembler* Analyser::disasm
 

Definition at line 309 of file analy.h.

Referenced by beginAnalysis(), continueAnalysis(), continueAnalysisAt(), dataAccess(), doBranch(), done(), generate_html_output(), AnalyserOutput::generateAddr(), getDisasmStr(), getDisasmStrFormatted(), ht_aviewer::handlemsg(), AnalyserInformation::idle(), init(), load(), AnalyserOutput::prevLine(), setDisasm(), srt_x86(), store(), and test_srt().

Area* Analyser::explored
 

Definition at line 303 of file analy.h.

Referenced by AnalyserTxtOutput::beginLine(), AnalyserHTOutput::beginLine(), done(), generate_html_output(), gotoAddress(), init(), load(), and store().

Address * Analyser::first_explored
 

Definition at line 301 of file analy.h.

Referenced by done(), gotoAddress(), init(), load(), and store().

Area* Analyser::initialized
 

Reimplemented from Object.

Definition at line 304 of file analy.h.

Referenced by done(), init(), load(), ht_analy_sub::search(), and store().

Address* Analyser::invalid_addr
 

Definition at line 297 of file analy.h.

Referenced by beginAnalysis(), continueAnalysis(), doBranch(), done(), fileofsToAddress(), init(), and load().

Address * Analyser::last_explored
 

Definition at line 301 of file analy.h.

Referenced by continueAnalysis(), done(), gotoAddress(), init(), load(), and store().

int Analyser::location_count
 

Definition at line 318 of file analy.h.

Referenced by deleteLocation(), init(), load(), and newLocation().

int Analyser::location_threshold
 

Definition at line 311 of file analy.h.

Referenced by load(), optimizeLocationTree(), setLocationTreeOptimizeThreshold(), and store().

Location* Analyser::locations
 

Definition at line 305 of file analy.h.

Referenced by done(), enumLocations(), enumLocationsReverse(), getLocationByAddress(), getLocationCount(), init(), load(), newLocation(), and store().

int Analyser::max_opcode_length
 

Definition at line 313 of file analy.h.

Referenced by continueAnalysis(), dataAccess(), doBranch(), AnalyserHTOutput::endLine(), AnalyserOutput::generateAddr(), getDisasmStr(), getDisasmStrFormatted(), init(), load(), setDisasm(), and store().

int Analyser::mode
 

Definition at line 395 of file analy.h.

Referenced by AnalyserHTOutput::beginLine(), AnalyserHTOutput::endLine(), AnalyserOutput::generateAddr(), getDisplayMode(), init(), load(), setDisplayMode(), store(), and toggleDisplayMode().

bool Analyser::next_address_is_invalid
 

Definition at line 302 of file analy.h.

Referenced by continueAnalysis(), doBranch(), init(), and load().

Address* Analyser::next_explored
 

Definition at line 301 of file analy.h.

Referenced by continueAnalysis(), done(), gotoAddress(), init(), load(), and store().

int Analyser::ops_parsed
 

Definition at line 299 of file analy.h.

Referenced by beginAnalysis(), continueAnalysis(), ht_aviewer::idle(), init(), load(), and store().

int Analyser::symbol_count
 

Definition at line 317 of file analy.h.

Referenced by deleteSymbol(), init(), load(), and newSymbol().

int Analyser::symbol_threshold
 

Definition at line 311 of file analy.h.

Referenced by load(), optimizeSymbolTree(), setSymbolTreeOptimizeThreshold(), and store().

Symbol* Analyser::symbols
 

Definition at line 310 of file analy.h.

Referenced by done(), enumSymbolsByName(), enumSymbolsByNameReverse(), getSymbolByName(), getSymbolCount(), init(), load(), newSymbol(), and store().


The documentation for this class was generated from the following files:
Generated on Fri May 7 21:15:54 2004 by doxygen 1.3.5