Skip to main content

A Python (3.x compatible) interface to the GNU Binary File Descriptor (BFD) and opcodes library.

Project description

PyBFD3

This clone of PyBFD mainly adds support for Python 3.x while keeping compatibility with Python 2.x. To prevent conflicts and possible confusion, the name of the module/package has changed to pybfd3

Because it seems that pybfd is no longer maintained, I decided to create my own independent repository.

Changelog

Version 0.1.5

  • Remove legacy distutils usage (thanks to @Bidski)

Version 0.1.4

  • Update PyBFD3 to be compatible with binutils > 2.29 (thanks to @Bidski)

Requirements

  • The binutils-dev package must be installed first.

Install

Method 1: Via Python Package Index (PyPI).

$ pip install pybfd3

Method 2: Local installation.

$ git clone https://github.com/b-2-r/pybfd3.git
$ pip install ./pybfd3

Note:

Depending on your pip version, you may need to add pip's --egg install option to successfully complete the installation.

Sample Session

$ cd pybfd3/examples
$ chmod +x sample-session.py
$ ./sample-session.py
Usage : ./sample-session.py <binary>
$ ./sample-session.py `which sudo`
[+] Creating BFD instance...
[+] File format     : Linker/assembler/compiler output.
[+] Architecture    : Intel 386 (9)
[+] BFD target name : elf64-x86-64
[+] Entry point     : 0x403970
[+] Sections        : 27
[+] Selected section information:
	Name   : .text
	Index  : 13
	Length : 59 Kbytes
0x402B60 SZ=2 BD=0 IT=1	push   r15
0x402B62 SZ=2 BD=0 IT=1	push   r14
0x402B64 SZ=2 BD=0 IT=1	push   r13
0x402B66 SZ=2 BD=0 IT=1	push   r12
0x402B68 SZ=1 BD=0 IT=1	push   rbp
0x402B69 SZ=1 BD=0 IT=1	push   rbx
0x402B6A SZ=5 BD=0 IT=1	mov    ebx,0x63ec80
0x402B6F SZ=3 BD=0 IT=1	mov    rbp,rsi
0x402B72 SZ=7 BD=0 IT=1	sub    rsp,0xb8
[...]

TODOs

  • improve get_symbols to not throwing an error if no symbols are present
  • macOS testing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybfd3-0.1.5.tar.gz (48.2 kB view details)

Uploaded Source

File details

Details for the file pybfd3-0.1.5.tar.gz.

File metadata

  • Download URL: pybfd3-0.1.5.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

File hashes

Hashes for pybfd3-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0a447537c0615a63e12ec65793edaef5d55b567b2c9fcb4eba8a03b094439a2a
MD5 60bd132e167ff94f1b132e7b9cc4288b
BLAKE2b-256 ba95a89b76ef4460d5fd00c30c3a408c0b9225e0c18b49677d6f2517e3e4f42f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page