Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ByteInfo Struct Reference

Mantain info for a byte of file. More...

#include <byteinfo.h>

List of all members.

Public Types

enum  TPriority {
  priNone, priCheckOnly, priFiller, priConstant,
  priApi, priHeuristics, priExport, priSafeHeuristics,
  priSafeExport, priEntryPoint, priMax = priEntryPoint
}
 How sure is program about this byte. More...

enum  TType {
  typeNone, typeInstruction = typeNone, typeLoader, typeInteger,
  typePointer, typeASCIIZ, typeMax = typeASCIIZ
}
 Type of byte (contained in an instruction, a string, etc). More...


Public Methods

 ByteInfo ()
void Reset ()
 Delete all info for this byte. More...

void SetPriority (enum TPriority pri)
enum TPriority GetPriority () const
void SetType (enum TType typ)
enum TType GetType () const
void SetIsPrevInstruction ()
 Mark this istruction have another instruction before (and is not a unconditional jump). More...

int IsPrevInstruction () const
void SetIsLabel ()
 This byte if target of a jump or a data referenced from an instruction/constant. More...

int IsLabel () const
void SetContinue ()
 Used to handle long data. More...

int Continue () const

Public Attributes

uchar len
 len of istruction/data, for long data (>32) use ByteInfos::GetLen. More...


Private Attributes

uchar priority
uchar flag
uchar type


Detailed Description

Mantain info for a byte of file.

Definition at line 36 of file byteinfo.h.


Member Enumeration Documentation

enum ByteInfo::TPriority
 

How sure is program about this byte.

Enumeration values:
priNone  not code.
priCheckOnly  internal use.
priFiller  what's this?
priConstant  a constant in code reference this.
priApi  code exported.
priHeuristics  discovered by heuristic, not very safe.
priExport  code exported.
priSafeHeuristics  discovered by heuristic, safe.
priSafeExport  code exported, surely code.
priEntryPoint  executed starting from entry-point.
priMax 

Definition at line 42 of file byteinfo.h.

Referenced by CodeParser::AddExportTempFlow(), CodeParser::AddTempFlow(), CodeParser::CheckCode(), CodeParser::CheckCodeRecursively(), CodeParser::CheckForAddress(), CodeParser::ExecuteComplexReferenceMemory(), GetPriority(), THeuristicMotor::Process(), CodeParser::ScanCode(), CodeParser::SetCodeRange(), SetPriority(), CodeParser::WriteCode(), and WritePriority().

00043   {
00044     priNone,           /**< not code */
00045                 priCheckOnly,      /**< internal use */
00046                 priFiller,         /**< what's this? */
00047                 priConstant,       /**< a constant in code reference this */
00048                 priApi,            /**< code exported */
00049                 priHeuristics,     /**< discovered by heuristic, not very safe */
00050                 priExport,         /**< code exported */
00051                 priSafeHeuristics, /**< discovered by heuristic, safe */
00052     priSafeExport,     /**< code exported, surely code */
00053                 priEntryPoint,     /**< executed starting from entry-point */
00054                 priMax = priEntryPoint
00055   };

enum ByteInfo::TType
 

Type of byte (contained in an instruction, a string, etc).

Enumeration values:
typeNone 
typeInstruction  instruction.
typeLoader  used by loader, resource or other.
typeInteger  part of an integer.
typePointer  a pointer.
typeASCIIZ  asciiz string.
typeMax 

Definition at line 59 of file byteinfo.h.

Referenced by GetType(), and SetType().

00060   {
00061     typeNone, 
00062                 typeInstruction = typeNone, /**< instruction */
00063                 typeLoader,                 /**< used by loader, resource or other */
00064                 typeInteger,                /**< part of an integer */
00065                 typePointer,                /**< a pointer */
00066                 typeASCIIZ,                 /**< asciiz string */
00067     typeMax = typeASCIIZ
00068   };


Constructor & Destructor Documentation

ByteInfo::ByteInfo   [inline]
 

Definition at line 72 of file byteinfo.h.

References flag, len, priNone, priority, type, and typeNone.

00072 :len(0),priority(priNone),flag(0),type(typeNone) {};


Member Function Documentation

int ByteInfo::Continue   const [inline]
 

Definition at line 103 of file byteinfo.h.

References flag.

Referenced by ByteInfos::GetLen().

00103 { return flag&4; };

enum TPriority ByteInfo::GetPriority   const [inline]
 

Definition at line 81 of file byteinfo.h.

References TPriority.

Referenced by CodeParser::CheckForAddress(), CodeParser::ExecuteComplexReferenceMemory(), CodeParser::ResetCodeRange(), and CodeParser::ScanCode().

00082   { return static_cast<enum TPriority>(priority); };

enum TType ByteInfo::GetType   const [inline]
 

Definition at line 85 of file byteinfo.h.

References TType.

Referenced by IsCodePointer(), CodeParser::ScanCode(), and CodeParser::WriteCode().

00085 { return static_cast<enum TType>(type); };

int ByteInfo::IsLabel   const [inline]
 

Definition at line 98 of file byteinfo.h.

References flag.

00098 { return flag&2; };

int ByteInfo::IsPrevInstruction   const [inline]
 

Definition at line 93 of file byteinfo.h.

References flag.

00093 { return flag&1; };

void ByteInfo::Reset   [inline]
 

Delete all info for this byte.

Definition at line 76 of file byteinfo.h.

References flag, len, priNone, priority, type, and typeNone.

Referenced by CodeParser::ResetCodeRange().

00076 { priority = priNone; len = 0; flag = 0; type = typeNone; };

void ByteInfo::SetContinue   [inline]
 

Used to handle long data.

Definition at line 102 of file byteinfo.h.

References flag.

Referenced by ByteInfos::SetLen().

00102 { flag |= 4; };

void ByteInfo::SetIsLabel   [inline]
 

This byte if target of a jump or a data referenced from an instruction/constant.

Definition at line 97 of file byteinfo.h.

References flag.

Referenced by CodeParser::CheckForAddress(), and CodeParser::ScanCode().

00097 { flag |= 2; };

void ByteInfo::SetIsPrevInstruction   [inline]
 

Mark this istruction have another instruction before (and is not a unconditional jump).

Definition at line 92 of file byteinfo.h.

References flag.

Referenced by CodeParser::ScanCode().

00092 { flag |= 1; };

void ByteInfo::SetPriority enum TPriority    pri [inline]
 

Definition at line 79 of file byteinfo.h.

References _PRG_ASSERT, priMax, priority, and TPriority.

Referenced by CodeParser::CheckForAddress(), CodeParser::ExcludeFileRange(), CodeParser::ExecuteComplexReferenceMemory(), CodeParser::Parse(), and CodeParser::ScanCode().

00080   { _PRG_ASSERT(pri>=0 && pri<=priMax); priority = static_cast<uchar>(pri); };

void ByteInfo::SetType enum TType    typ [inline]
 

Definition at line 83 of file byteinfo.h.

References _PRG_ASSERT, TType, type, and typeMax.

Referenced by CodeParser::CheckForAddress(), CodeParser::ExcludeFileRange(), CodeParser::ExecuteComplexReferenceMemory(), and CodeParser::Parse().

00084   { _PRG_ASSERT(typ>=0 && typ<=typeMax); type = static_cast<uchar>(typ); };


Member Data Documentation

uchar ByteInfo::flag [private]
 

Definition at line 106 of file byteinfo.h.

Referenced by ByteInfo(), Continue(), IsLabel(), IsPrevInstruction(), Reset(), SetContinue(), SetIsLabel(), and SetIsPrevInstruction().

uchar ByteInfo::len
 

len of istruction/data, for long data (>32) use ByteInfos::GetLen.

Definition at line 69 of file byteinfo.h.

Referenced by ByteInfo(), CodeParser::CheckForAddress(), CodeParser::ExecuteComplexReferenceMemory(), ByteInfos::GetLen(), IsCodePointer(), CodeParser::Parse(), Reset(), CodeParser::ResetCodeRange(), CodeParser::ScanCode(), and ByteInfos::SetLen().

uchar ByteInfo::priority [private]
 

Definition at line 105 of file byteinfo.h.

Referenced by ByteInfo(), Reset(), and SetPriority().

uchar ByteInfo::type [private]
 

Definition at line 107 of file byteinfo.h.

Referenced by ByteInfo(), Reset(), and SetType().


The documentation for this struct was generated from the following file:
Generated on Mon Jan 13 22:20:36 2003 for perdr by doxygen1.2.15