Giter VIP home page Giter VIP logo

windbg-trace's Introduction

WinDBG-Trace

These scripts enable a user to trace the Windows API calls of any Portable Executable file.

Dependencies

Install Windows 7 (in particular I installed Windows 7 Enterprise Service Pack 1)

Install WinDBG (included with Windows Driver Kit 8.1): https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit

Install VisualStudio 2013 (to compile tests)

Citations and Credit

https://www.codeproject.com/articles/6084/windows-debuggers-part-1-a-windbg-tutorial#\_Toc64133680 https://blogs.msdn.microsoft.com/debuggingtoolbox/2007/04/13/windbg-script-tracing-api-calls/

The script.txt file is taken directly from Roberto Alexis Farah's blog http://blogs.msdn.com/debuggingtoolbox/ I simply modified one line. All credit should be given to him.

Running

Open a Command Prompt and run:

PROMPT> trace.bat path\to\test.exe

Output

On your Desktop you'll see a new folder "LogExts".

In this folder you'll see two files ending in *.lgv and *.txt

The LGV file can be opened with the logviewer application (in the same directory as windbg.exe). This is a detailed view of the program's API sequence.

The TXT file can be opened with notepad or any text editor. This version of API sequence is not as detailed as the LGV file, but hopefully provides enough detail so you can parse it with a simple script and extract whatever data you need.

Running Tests

Open VisualStudio Developer Console and run:

PROMPT> cd tests
PROMPT> cl simple.cpp
PROMPT> cl multithread.cpp
PROMPT> cl multiprocess.cpp
PROMPT> cd ..

PROMPT> trace.bat tests\simple.exe
PROMPT> trace.bat tests\multithread.exe
PROMPT> trace.bat "tests\multiprocess.exe C:\Windows\notepad.exe"

Benefits

What's nice about this is that the batch file (trace.bat) will automatically download the most up-to-date symbols from Microsoft so you don't have to. It does all the work so you can do all the playing :)

Limitations

It cannot automatically log child processes activities.

windbg-trace's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.