DBG (ANALYSIS): formatting
This commit is contained in:
parent
8399a77015
commit
3cb5805d5c
|
@ -36,7 +36,8 @@ void ClientApiResolver::see(const Instruction_t Instr, const RegisterEmulator* r
|
|||
ttDebug("api: opcode is %x \n", (((n->outEdge->end))->instruction.BeaStruct.Instruction.Opcode) & 0xFF);
|
||||
ttDebug("api: opcode is %x \n", Analysis->graph()->node(n->outEdge->end->vaddr)->instruction.BeaStruct.Instruction.Opcode);
|
||||
|
||||
if(((n->outEdge->end))->instruction.BeaStruct.Instruction.Opcode == 0xFF){
|
||||
if(((n->outEdge->end))->instruction.BeaStruct.Instruction.Opcode == 0xFF)
|
||||
{
|
||||
tDebug("api: --> is API CALL\n", (duint)n->outEdge->end->instruction.BeaStruct.VirtualAddr);
|
||||
// there is an api call
|
||||
//DbgSetAutoCommentAt((duint)Instr.BeaStruct.VirtualAddr, "hi");
|
||||
|
|
|
@ -45,7 +45,8 @@ void ClientFunctionFinder::see(const Instruction_t Instr, const RegisterEmulator
|
|||
// there is a branching!
|
||||
if(n->outEdge->type == fa::RET)
|
||||
{
|
||||
if((duint) n->outEdge->end->instruction.BeaStruct.Instruction.AddrValue != Analysis->oep()){
|
||||
if((duint) n->outEdge->end->instruction.BeaStruct.Instruction.AddrValue != Analysis->oep())
|
||||
{
|
||||
// internal call
|
||||
DbgSetAutoFunctionAt((duint)n->outEdge->end->instruction.BeaStruct.Instruction.AddrValue, (duint)Instr.BeaStruct.VirtualAddr);
|
||||
tDebug("add function from "fhex" to "fhex"\n", (duint) n->outEdge->end->instruction.BeaStruct.Instruction.AddrValue, (duint)Instr.BeaStruct.VirtualAddr);
|
||||
|
|
|
@ -28,10 +28,12 @@ namespace fa
|
|||
{
|
||||
Node_t* workStart;
|
||||
Node_t* workEnd;
|
||||
if(!contains(nodes,startNode->vaddr)){
|
||||
if(!contains(nodes, startNode->vaddr))
|
||||
{
|
||||
nodes.insert(std::pair<duint, Node_t*>(startNode->vaddr, startNode));
|
||||
}
|
||||
if(!contains(nodes,endNode->vaddr)){
|
||||
if(!contains(nodes, endNode->vaddr))
|
||||
{
|
||||
nodes.insert(std::pair<duint, Node_t*>(endNode->vaddr, endNode));
|
||||
}
|
||||
|
||||
|
@ -39,7 +41,8 @@ namespace fa
|
|||
workEnd = &*(nodes.find(endNode->vaddr)->second);
|
||||
|
||||
|
||||
if (startNode->hasInstr && !((nodes.find(startNode->vaddr)->second))->hasInstr){
|
||||
if(startNode->hasInstr && !((nodes.find(startNode->vaddr)->second))->hasInstr)
|
||||
{
|
||||
ttDebug("updating old startnode");
|
||||
workStart->instruction = startNode->instruction;
|
||||
}
|
||||
|
@ -119,7 +122,8 @@ namespace fa
|
|||
|
||||
void FlowGraph::fillNodes()
|
||||
{
|
||||
for(std::map<duint, Node_t*>::iterator i=nodes.begin();i!=nodes.end();i++){
|
||||
for(std::map<duint, Node_t*>::iterator i = nodes.begin(); i != nodes.end(); i++)
|
||||
{
|
||||
i->second->hasInstr = true;
|
||||
i->second->instruction.BeaStruct = analysis->instruction_t(i->first).BeaStruct;
|
||||
if(i->second->instruction.BeaStruct.Instruction.Opcode == 0xFF)
|
||||
|
|
Loading…
Reference in New Issue