Skip to content

Commit

Permalink
Clean parsing log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mxz297 committed Nov 19, 2016
1 parent a64a474 commit d43f8e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dataflowAPI/h/SymEval.h
Expand Up @@ -96,7 +96,7 @@ struct Variable {
}
friend std::ostream& operator<<(std::ostream& stream, const Variable& c)
{
stream << c.format() << std::endl;
stream << c.format();
return stream;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ struct Constant {
}
friend std::ostream& operator<<(std::ostream& stream, const Constant& c)
{
stream << c.format() << std::endl;
stream << c.format();
return stream;
}

Expand Down Expand Up @@ -290,7 +290,7 @@ DATAFLOW_EXPORT const std::string format() const {
};
friend std::ostream& operator<<(std::ostream& stream, const ROSEOperation& c)
{
stream << c.format() << std::endl;
stream << c.format();
return stream;
}

Expand Down
11 changes: 6 additions & 5 deletions parseAPI/src/IndirectAnalyzer.C
Expand Up @@ -17,8 +17,8 @@ using namespace Dyninst::InstructionAPI;


bool IndirectControlFlowAnalyzer::NewJumpTableAnalysis(std::vector<std::pair< Address, Dyninst::ParseAPI::EdgeTypeEnum > >& outEdges) {
// if (block->last() == 0xfa10) dyn_debug_parsing = 1; else dyn_debug_parsing = 0;

// if (block->last() == 0x47947) dyn_debug_parsing = 1; else dyn_debug_parsing = 0;
// if (block->last() == 0x52460) dyn_debug_parsing=1; else dyn_debug_parsing=0;
parsing_printf("Apply indirect control flow analysis at %lx\n", block->last());
parsing_printf("Looking for thunk\n");

Expand Down Expand Up @@ -120,10 +120,10 @@ void IndirectControlFlowAnalyzer::FindAllThunks() {
parsing_printf("%s[%d]: failed to get pointer to instruction by offset\n",FILE__, __LINE__);
return;
}
parsing_printf("Looking for thunk in block [%lx,%lx).", b->start(), b->end());
InstructionDecoder dec(buf, b->end() - b->start(), b->obj()->cs()->getArch());
InsnAdapter::IA_IAPI block(dec, b->start(), b->obj() , b->region(), b->obj()->cs(), b);
while (block.getAddr() < b->end()) {
Address cur = b->start();
while (cur < b->end()) {
if (block.getInstruction()->getCategory() == c_CallInsn && block.isThunk()) {
bool valid;
Address addr;
Expand All @@ -144,7 +144,8 @@ void IndirectControlFlowAnalyzer::FindAllThunks() {
parsing_printf("\tfind thunk at %lx, storing value %lx to %s\n", block.getAddr(), t.value , t.reg.name().c_str());
}
}
block.advance();
cur += block.getInstruction()->size();
if (cur < b->end()) block.advance();
}
}
}
Expand Down

0 comments on commit d43f8e4

Please sign in to comment.