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

PEAnalyser Class Reference

#include <pe_analy.h>

Inheritance diagram for PEAnalyser:

Analyser Object List of all members.

Public Member Functions

void init (ht_pe_shared_data *Pe_shared, ht_streamfile *File)
int load (ht_object_stream *f)
virtual void done ()
virtual OBJECT_ID object_id () const
virtual void beginAnalysis ()
virtual UINT bufPtr (Address *Addr, byte *buf, int size)
bool convertAddressToRVA (Address *addr, RVA *r)
virtual AddresscreateAddress ()
AddresscreateAddress32 (dword addr)
AddresscreateAddress64 (qword high_addr)
virtual AssemblercreateAssembler ()
virtual const char * getName ()
virtual const char * getType ()
virtual void initCodeAnalyser ()
virtual void initUnasm ()
virtual void log (const char *msg)
virtual AddressnextValid (Address *Addr)
virtual void store (ht_object_stream *f)
virtual int queryConfig (int mode)
virtual bool validAddress (Address *Addr, tsectype action)
virtual AddressfileofsToAddress (FILEOFS fileofs)
virtual FILEOFS addressToFileofs (Address *Addr)
virtual char * getSegmentNameByAddress (Address *Addr)

Public Attributes

ht_pe_shared_datape_shared
ht_streamfilefile
Areavalidarea

Member Function Documentation

FILEOFS PEAnalyser::addressToFileofs Address Addr  )  [virtual]
 

Implements Analyser.

Definition at line 373 of file pe_analy.cc.

References convertAddressToRVA(), FILEOFS, INVALID_FILE_OFS, pe_rva_to_ofs(), pe_shared, RVA, scinitialized, ht_pe_shared_data::sections, and validAddress().

Referenced by bufPtr().

void PEAnalyser::beginAnalysis  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 87 of file pe_analy.cc.

References Area::add(), Address::add(), Analyser::addComment(), ht_pe_import_function::address, ht_pe_export_function::address, AF_FUNCTION_END, Analyser::assignSymbol(), Analyser::beginAnalysis(), ht_pe_import_function::byname, ht_pe_export_function::byname, COFF_DLL, COFF_OPTMAGIC_PE32, ht_pe_shared_data::coffheader, ht_clist::count(), createAddress32(), createAddress64(), ht_pe_shared_data::dimports, dst_idword, dst_iqword, Object::duplicate(), export_func_name(), ht_pe_shared_data::exports, Location::flags, ht_pe_import::funcs, ht_pe_export::funcs, ht_clist::get(), getSegmentNameByAddress(), ht_snprintf(), import_func_name(), ht_pe_shared_data::imports, label_func, ht_pe_import_function::libidx, ht_pe_import::libs, MAX, MIN, ht_pe_import_function::name, ht_pe_import_library::name, ht_pe_export_function::name, Analyser::newLocation(), NULL, ht_pe_shared_data::opt_magic, ht_pe_import_function::ordinal, ht_pe_export_function::ordinal, ht_pe_shared_data::pe32, ht_pe_shared_data::pe64, pe_shared, Analyser::pushAddress(), random_permutation(), scinitialized, scvalid, pe_section_headers::section_count, pe_section_headers::sections, ht_pe_shared_data::sections, DataAnalyser::setIntAddressType(), Analyser::setLocationTreeOptimizeThreshold(), Analyser::setSymbolTreeOptimizeThreshold(), UINT, validAddress(), and validarea.

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

Implements Analyser.

Definition at line 284 of file pe_analy.cc.

References addressToFileofs(), assert, buf, file, FILEOFS, INVALID_FILE_OFS, ht_stream::read(), ht_streamfile::seek(), size, and UINT.

bool PEAnalyser::convertAddressToRVA Address addr,
RVA r
 

Definition at line 295 of file pe_analy.cc.

References ATOM_ADDRESS_FLAT_32, ATOM_ADDRESS_FLAT_64, ATOM_ADDRESS_X86_FLAT_32, Object::object_id(), ht_pe_shared_data::pe32, ht_pe_shared_data::pe64, pe_shared, qword, QWORD_GET_HI, QWORD_GET_LO, and RVA.

Referenced by addressToFileofs(), getSegmentNameByAddress(), and validAddress().

Address * PEAnalyser::createAddress  )  [virtual]
 

Implements Analyser.

Definition at line 336 of file pe_analy.cc.

References COFF_MACHINE_I386, COFF_MACHINE_I486, COFF_MACHINE_I586, COFF_OPTMAGIC_PE64, ht_pe_shared_data::coffheader, ht_pe_shared_data::opt_magic, and pe_shared.

Address * PEAnalyser::createAddress32 dword  addr  ) 
 

Definition at line 316 of file pe_analy.cc.

References COFF_MACHINE_I386, COFF_MACHINE_I486, COFF_MACHINE_I586, ht_pe_shared_data::coffheader, and pe_shared.

Referenced by beginAnalysis(), fileofsToAddress(), ht_pe_import_viewer::select_entry(), ht_pe_export_viewer::select_entry(), and ht_pe_dimport_viewer::select_entry().

Address * PEAnalyser::createAddress64 qword  high_addr  ) 
 

Definition at line 331 of file pe_analy.cc.

Referenced by beginAnalysis(), fileofsToAddress(), ht_pe_import_viewer::select_entry(), ht_pe_export_viewer::select_entry(), and ht_pe_dimport_viewer::select_entry().

Assembler * PEAnalyser::createAssembler  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 357 of file pe_analy.cc.

References COFF_MACHINE_I386, COFF_MACHINE_I486, COFF_MACHINE_I586, ht_pe_shared_data::coffheader, Object::init(), NULL, pe_shared, X86_ADDRSIZE32, and X86_OPSIZE32.

void PEAnalyser::done  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 77 of file pe_analy.cc.

References Analyser::done(), Area::done(), and validarea.

Address * PEAnalyser::fileofsToAddress FILEOFS  fileofs  )  [virtual]
 

converts |FILEOFS fileaddr| to |Address|

Reimplemented from Analyser.

Definition at line 602 of file pe_analy.cc.

References COFF_OPTMAGIC_PE32, createAddress32(), createAddress64(), FILEOFS, ht_pe_shared_data::opt_magic, ht_pe_shared_data::pe32, ht_pe_shared_data::pe64, pe_ofs_to_rva(), pe_shared, RVA, and ht_pe_shared_data::sections.

const char * PEAnalyser::getName  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 413 of file pe_analy.cc.

References file, and ht_stream::get_desc().

char * PEAnalyser::getSegmentNameByAddress Address Addr  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 394 of file pe_analy.cc.

References convertAddressToRVA(), NULL, pe_rva_is_valid(), pe_rva_to_section(), pe_shared, RVA, pe_section_headers::sections, and ht_pe_shared_data::sections.

Referenced by beginAnalysis().

const char * PEAnalyser::getType  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 421 of file pe_analy.cc.

void PEAnalyser::init ht_pe_shared_data Pe_shared,
ht_streamfile File
 

Definition at line 48 of file pe_analy.cc.

References file, Analyser::init(), Area::init(), pe_shared, and validarea.

void PEAnalyser::initCodeAnalyser  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 429 of file pe_analy.cc.

References Analyser::initCodeAnalyser().

void PEAnalyser::initUnasm  )  [virtual]
 

Implements Analyser.

Definition at line 485 of file pe_analy.cc.

References COFF_MACHINE_ALPHA, COFF_MACHINE_I386, COFF_MACHINE_I486, COFF_MACHINE_I586, COFF_MACHINE_IA64, COFF_MACHINE_POWERPC_BE, COFF_MACHINE_POWERPC_LE, COFF_MACHINE_R10000, COFF_MACHINE_R3000, COFF_MACHINE_R4000, COFF_MACHINE_UNKNOWN, COFF_OPTMAGIC_PE64, ht_pe_shared_data::coffheader, DPRINTF, errorbox, ht_pe_shared_data::il, ht_pe_shared_data::opt_magic, pe_shared, and warnbox.

int PEAnalyser::load ht_object_stream f  )  [virtual]
 

loads object from object stream.

Returns:
ht_stream errorcode

Reimplemented from Analyser.

Definition at line 63 of file pe_analy.cc.

References GET_OBJECT, Analyser::load(), and validarea.

void PEAnalyser::log const char *  msg  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 552 of file pe_analy.cc.

Address * PEAnalyser::nextValid Address Addr  )  [virtual]
 

Implements Analyser.

Definition at line 565 of file pe_analy.cc.

References Area::findNext(), and validarea.

OBJECT_ID PEAnalyser::object_id  )  const [virtual]
 

Returns:
unique object id.

Reimplemented from Object.

Definition at line 276 of file pe_analy.cc.

References ATOM_PE_ANALYSER.

int PEAnalyser::queryConfig int  mode  )  [virtual]
 

Reimplemented from Analyser.

Definition at line 587 of file pe_analy.cc.

References Q_DO_ANALYSIS, Q_ENGAGE_CODE_ANALYSER, and Q_ENGAGE_DATA_ANALYSER.

void PEAnalyser::store ht_object_stream st  )  [virtual]
 

stores object.

Reimplemented from Analyser.

Definition at line 573 of file pe_analy.cc.

References PUT_OBJECT, Analyser::store(), and validarea.

bool PEAnalyser::validAddress Address Addr,
tsectype  action
[virtual]
 

Implements Analyser.

Definition at line 619 of file pe_analy.cc.

References COFF_SCN_CNT_CODE, COFF_SCN_MEM_EXECUTE, COFF_SCN_MEM_READ, COFF_SCN_MEM_WRITE, convertAddressToRVA(), pe_rva_is_physical(), pe_rva_to_section(), pe_shared, RVA, sccode, scinitialized, scread, screadwrite, scvalid, scwrite, pe_section_headers::sections, and ht_pe_shared_data::sections.

Referenced by addressToFileofs(), and beginAnalysis().


Member Data Documentation

ht_streamfile* PEAnalyser::file
 

Definition at line 31 of file pe_analy.h.

Referenced by bufPtr(), getName(), and init().

ht_pe_shared_data* PEAnalyser::pe_shared
 

Definition at line 30 of file pe_analy.h.

Referenced by addressToFileofs(), beginAnalysis(), convertAddressToRVA(), createAddress(), createAddress32(), createAssembler(), fileofsToAddress(), getSegmentNameByAddress(), init(), initUnasm(), and validAddress().

Area* PEAnalyser::validarea
 

Definition at line 32 of file pe_analy.h.

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


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