Skip to content

Commit

Permalink
Adds debug code to see if all is going good
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanSalwan committed Feb 6, 2015
1 parent a77895a commit 706d0e6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/analysis/formatStringBug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

void formatStringBugAnalysis(unsigned long insAddr, unsigned long rdi)
{
list<UINT64>::iterator i;
std::string content = std::string((const char *)rdi);
std::stringstream str;

Expand Down
8 changes: 7 additions & 1 deletion src/components/Trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ Trace::~Trace()
delete this->symbolicEngine;
}


/* Add an instruction in the trace */
void Trace::addInstruction(Tritinst *instruction)
{
this->instructions.push_back(instruction);
}

/* Returns the instructions list in the trace */
std::list<Tritinst *> &Trace::getInstructions()
{
return this->instructions;
}

9 changes: 9 additions & 0 deletions src/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ INT32 Usage()

VOID Fini(INT32, VOID *)
{

// /* Currently used to test if all going good */
// std::cout << std::endl << std::endl << "[DEBUG] ---------------------------" << std::endl;
// std::list<Tritinst *>::iterator i;
// for(i = trace->getInstructions().begin(); i != trace->getInstructions().end(); i++){
// std::cout << (*i)->getAddress() << " " << (*i)->numberOfElements() << " " << (*i)->getDisassembly() << std::endl;
// }

/* Delete the trace */
delete trace;
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/includes/Trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Trace {
~Trace();

void addInstruction(Tritinst *instruction);
std::list<Tritinst *> &getInstructions();
};

#endif /* !_TRACE_H_ */
Expand Down

0 comments on commit 706d0e6

Please sign in to comment.