Skip to content
/ ldbg Public

ldbg is a simple debugging python API for x86 and x86-64 ELF executables.

Notifications You must be signed in to change notification settings

Njord0/ldbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ldbg

ldbg is a simple debugging python API for x86 and x86-64 ELF executables.

About

ldbg is basically a wrapper around linux ptrace utility, made for automatizing your reverse-engineering tasks or building your own tiny debugger from scratch!

The exposed python API is meant to be simple to use and to understand, the documentation is available here.

Installation

ldbg can be installed by cloning this repository and running the setup.py script :

$ git clone https://github.com/njord0/ldbg
$ cd ldbg
$ python3 -m pip install requirements.txt
$ python3 setup.py install

Example

from ldbg import Debugger
import ldbg

p  = Debugger.debug('./executable')

print(f'Process started with PID: {p.pid}')
print(f'The process is stopped at the entry point by default, {hex(p.get_instruction_pointer())}')

try:
    p.pcontinue()
except ldbg.ProcessExitedException as e:
    print('The process exited with code: ', e.n)
    
print(
    p.stdout.read() 
) ## printing the output of the program

Where executable can either be a x86 or a x86-64 ELF file.

More examples are available here

About

ldbg is a simple debugging python API for x86 and x86-64 ELF executables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published