页面

2012年9月3日星期一

WinDbg and IDA to Improved Code Flow Analysis


First of all, may I copy some pieces of others' blog post:

IDA is hands down the best tool for static analysis. Its debugger on the other hand, when compared to the power of WinDbg is certainly lacking, IMHO. As such, I find myself wasting too much time switching between windows and manually highlighting and commenting instructions in IDA as I trace through them in WinDbg. Fortunately, the power of IDApython can be unleashed to reduce this tedium.
I was reading an older TippingPoint MindshaRE article from Cody Pierce entitled “Hit Tracing in WinDbg” and was inspired by his ideas to implement my own IDApython script to better integrate WinDbg with IDA. While, I may be recreating many of his efforts, my primary intent was to get better at scripting in IDApython while improving upon my static/dynamic analysis workflow.
The purpose of my script is to parse WinDbg log files for module base addresses, instruction addresses, references to register values, and pointer dereferences. Then, for every instruction you hit in your debug session, the corresponding instructions will be colored and commented accordingly and in a module base address-agnostic fashion.
Yes, I have the some thought. But when I test the idc file, I found a problem. This IDC script can not support the randomized address. Then I find the Matthew Graeber's script. This script is good, but cann't suite for some program that we don't have symbols. So I rewrite the script, hope can give you some help XD.

How to Use?

 Setp 1: set a breakpot where you want to start
 Setp 2: "g" to reach there
 Setp 3: ".logopen '<logfile>'" to open log file.
 Setp 4: "lmp" to get the memory map
 Setp 5: "pa <theend>" to the end address
 Setp 6: ".logclose" to close the log file.
 Setp 7: Open IDA script to load this script. That's all.

References:

1. Cody Pierce, “MindshaRE: Hit Tracing in WinDbg,” July 17, 2008, http://dvlabs.tippingpoint.com/blog/2008/07/17/mindshare-hit-tracing-in-windbg

2. Matthew Graeber, "Integrating WinDbg and IDA for Improved Code Flow Analysis", Saturday, July 30, 2011, http://www.exploit-monday.com/2011/07/integrating-windbg-and-ida-for-improved.html

没有评论:

发表评论