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

bfd, binary-analysis, c, low-level, python2, python3, reverse-engineering, security
pip install pybfd3==0.1.5



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.


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)


  • The binutils-dev package must be installed first.


Method 1: Via Python Package Index (PyPI).

$ pip install pybfd3

Method 2: Local installation.

$ git clone
$ pip install ./pybfd3


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
$ ./
Usage : ./ <binary>
$ ./ `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


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