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

code.cpp File Reference

#include "global.h"
#include "signfile.hpp"
#include "module.h"
#include "code.h"
#include "codeglob.h"
#include "x86istr.h"
#include "heuristic.h"
#include "codescan.h"
#include "utils/f77auto_ptr"

Go to the source code of this file.

Functions

void WriteInstruction (const Instruction &instruction, FILE *file)
int GetInstruction (ObjectModule &module, vma_t address, Instruction &instruction)
void ParseCode (CSignFile &file, uint32_t imageBase, vma_t entryPoint, const RVAFileTranslator &rva, const Symbols &symbols, const Symbols &exportedSymbols, bool hasRelocation, const RelocationInfos &relocationInfos)


Function Documentation

int GetInstruction ObjectModule   module,
vma_t    address,
Instruction   instruction
 

Definition at line 634 of file code.cpp.

References InstructionDecoder::Decode(), ObjectModule::GetDataReader(), ObjectModule::GetRelocationInfos(), and vma_t.

Referenced by CodeParser::_ReverseScan(), CodeParser::ExecuteComplexReference(), CodeParser::ExecuteComplexReferenceMemory(), CodeParser::Parse(), ScanningComplexReg::ProcessInstruction(), and THeuristicMotor::THeuristicMotor().

00635 {
00636   // legge l'istruzione
00637   InstructionDecoder decoder(module.GetRelocationInfos());
00638         ObjectModule::DataReader reader = module.GetDataReader(address);
00639   return decoder.Decode(instruction,reader);
00640 }

void ParseCode CSignFile   file,
uint32_t    imageBase,
vma_t    entryPoint,
const RVAFileTranslator   rva,
const Symbols   symbols,
const Symbols   exportedSymbols,
bool    hasRelocation,
const RelocationInfos   relocationInfos
 

Definition at line 1217 of file code.cpp.

01218 {
01219   CodeParser* p = new CodeParser;
01220   p->Parse(file,imageBase,entryPoint,rva,symbols,exportedSymbols,hasRelocation,relocationInfos);
01221   delete p;
01222 }

void WriteInstruction const Instruction   instruction,
FILE *    file
 

Definition at line 52 of file code.cpp.

References Instruction::Write().

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

00053 {
00054   char buffer[80];
00055   instruction.Write(buffer);
00056   fprintf(file,"%s\n",buffer);
00057 }


Generated on Mon Jan 13 22:20:35 2003 for perdr by doxygen1.2.15