Get in touch
2543934363
gsatactical@gmail.com

GLOBAL SECURITY AGENCY (GSA)

Integrating WinDbg and IDA for Improved Code Flow Analysis

Matt • July 30, 2011

1

00495001 calc!CCalcEngine::DoOperation =

0:000> BP 00495001
0:000> g

Entering in 1000 / 4 in calc
Breakpoint 0 hit
eax=00439220 ebx=0069c420 ecx=0069c278 edx=00000000 esi=0069c278 edi=00000000
eip=00495001 esp=0032e95c ebp=0032ea4c iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000206
calc!CCalcEngine::DoOperation:
00495001 6a1c push 1Ch

Step through function until return instruction
0:000> PT
eax=00000000 ebx=0069c420 ecx=00495051 edx=00445310 esi=0069c278 edi=00000000
eip=00495051 esp=0032e95c ebp=0032ea4c iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
calc!CCalcEngine::DoOperation+0xfa:
00495051 c20c00 ret 0Ch
0:000> g
0:004> .logopen "calc.log"

The following dump is the result of the operation 1000/4 in the function without stepping into calls (using the PA command):
  
  
Here is what the graph of DoOperation looks like before 1000 / 4 is performed:

Here is what the graph of DoOperation looks like after 1000 / 4 is performed:

You can see the highlighted instructions and the values of any referenced registers and pointers.

Hopefully, by now you can see the power of IDApython in improving your analysis workflow. If you use this script, I welcome your feedback!

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
By ZenBusiness Admin September 19, 2023
The new season is a great reason to make and keep resolutions. Whether it’s eating right or cleaning out the garage, here are some tips for making and keeping resolutions.
By ZenBusiness Admin September 19, 2023
There are so many good reasons to communicate with site visitors. Tell them about sales and new products or update them with tips and information.
By ZenBusiness Admin September 19, 2023
Write about something you know. If you don’t know much about a specific topic that will interest your readers, invite an expert to write about it.
By ron June 27, 2023
Recently, I had the privilege to write a detailed analysis of CVE-2023-34362, which is series of several vulnerabilities in the MOVEit file transfer application that lead to remote code execution. One of the several vulnerabilities involved an ISAPI module - specifically, the MoveITISAPI.dll ISAPI extension. One of the many vulnerabilities that comprised the MOVEit RCE was a header-injection issue, where the ISAPI application parsed headers differently than the .net application. This point is going to dig into how to analyze and reverse engineer an ISAPI-based service! This wasn’t the first time in the recent past I’d had to work on something written as an ISAPI module, and each time I feel like I have to start over and remember how it’s supposed to work. This time, I thought I’d combine my hastily-scrawled notes with some Googling, and try to write something that I (and others) can use in the future. As such, this will be a quick intro to ISAPI applications from the angle that matters to me - how to reverse engineer and debug them! I want to preface this with: I’m not a Windows developer, and I’ve never run an IIS server on purpose. That means that I am approaching this with brute-force ignorance! I don’t have a lot of background context nor do I know the correct terminology for a lot of this stuff. Instead, I’m going to treat these are typical DLLs from typical applications, and approach them as such.
By Richard Bejtlich June 25, 2023
Cybersecurity is a social and policy problem, not a scientific or technical problem. Cybersecurity is also a wicked problem. In a landmark 1973 article, Dilemmas in a General Theory of Planning , urban planners Horst W. J. Rittel and Melvin M. Webber described wicked problems in these terms:
By Richard Bejtlich October 31, 2020
#securityonepercent
By Richard Bejtlich October 23, 2020
MITRE ATT&CK
By Richard Bejtlich April 7, 2020
disturbing story today
By Richard Bejtlich March 27, 2020
Google Books
More Posts
Share by: