Building Assembly Control Flow Graph(CFG) at Runtime for Reverse Engineering Using Python

A control flow graph (CFG) in computer science is a representation, using graph notation, of all paths that might be traversed through a program during its execution. In this post I'm going share one python tool which I've written few days back to build control flow graph of any function at run-time very quickly.

What it Does?

This tool actually help you to visualize any function's control flow graph at time of its execution. It also gives de-reference information of executed instructions.



To build CFG of any function you need to provide the entry point and exit point of that particular function you want to analyze. In last part of this post I've have posted one video which demonstrates how to use this tool.

How it's gonna help?


This tool actually can help you to reverse complex functions by creating control flow graph of it at runtime. So it reduces reverse engineering efforts a lot in many cases. It also gives you de-reference information each and every instruction executed. From this information you can easily find out at any certain point which register is point to to which place (stack / heap).

Sample Control Flow Graph Generated by visdasm:


http://htmlpreview.github.io/?https://github.com/debasishm89/visdasm/blob/master/Report.html

Download:


This tool is available for download at my Github page:

How to Use this tool?[Video Demo]





This tool uses below libraries:

  1. Pydbg
  2. Pydasm
  3. Jquery [For control flow graph]
  4. JqueryUI [For control flow graph]
  5. PlumberJS[For control flow graph]
Last Words:

I'vent tested this script much. I am modifying this tool everyday. So in some cases it may throw dirty errors.

Comments

  1. CBSE board is the most preferred educational board in India. A large number of schools are affiliated to CBSE board all over India and abroad. Ever year,e publishers in India. Jharkhand 9th Class Revised Syllabus about 26 lakh students appear for the CBSE board Exams. Previous year trend shows that a maximum number of students qualified for competitive examinations like JEE, AIPMT etc, are mostly from CBSE board. CBSE syllabus is frequently.

    ReplyDelete
  2. The Collection Marts is platform where you can view latest designs about home décor and bedding. We have large range in different categories with finest fabric in cotton and silk. You can view not only present trends but also view huge collection with reasonable price. The Collection Marts can provide fast service about delivery as well as customer support too. Our products are not only self-made but also, well connected with markets to ensure for possibility of available designs if client want to purchase. The Collection Marts customer support open 24/7 to guide their customers about material or product stuff. cotton duvet sets king size , cotton razai price

    ReplyDelete
  3. "Thanks so much pertaining to giving everyone an update on this issue on your web-site. Thanks for your efforts and consideration of other people by
    making this blog available."

    사설토토
    카지노사이트
    파워볼

    ReplyDelete

Post a Comment