Giter VIP home page Giter VIP logo

pygdb's Introduction

Minimal C Debugger in Python

The goal of this project is to make a c debugger, similar to gdb, in python. This is exclusively for educational purposes :)

This debugger works by using the ptrace system call. A good chunk of the theory is here.

Features

  • Read function names from binaries
  • Set breakpoints
  • Read registers
  • Continue to next breakpoint
  • Read/Set Memory

Setup

  • Install Vagrant
  • git clone https://github.com/theicfire/pygdb
  • cd pygdb
  • vagrant up -- will take a bit of time
  • vagrant ssh

Now run these commands in the VM:

  • cd /vagrant
  • make test

All the tests should pass!

Example Usage

  • cd /vagrant
  • make
  • objdump -d hello
  • Find somewhere to break. In this case we'll pick the start of the program: 8048080
  • Start the debugger: make interactive
  • Load the hello binary: exec-file hello
  • Set a breakpoint: b 0x8048080
  • Run the binary: run. Nothing will seem to happen, but the program has started to run and hit a breakpoint.
  • Get the registers. You'll notice eip is one after our breakpoint. regs
  • Step one instruction. s.
  • Get the registers again. regs. Notice that edx == 0x7, just like the assembly said it should have been.
  • Continue (Should finish): c
  • Quit: q

Future Priorities

  • Get this to run on 64 bit machines
  • Add any number of features that GDB has

pygdb's People

Contributors

theicfire avatar

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.