GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BinaryAnalysisPlatform/bap-python: BAP python bindings

BranchesTags
Open more actions menu

Latest commit

 

History

48 Commits
48 Commits

Folders and files

NameName
Last commit message
Last commit date
src/bap
src/bap
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
conftest.py
conftest.py
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

BAP python bindings

Installing

Install python bindings with pip (after you have installed bap):

$ pip install bap

Alternatively you can just copy paste files into your project, or clone it with git-subtree.

Installing low-level bindings

An optional low-level interface, called [rpc] depends on the requests library and the bap-server package. To use it, you need to install them from pip and opam correspondigly:

$ pip install bap[rpc]
$ opam install bap-server

Installing development version

You can also install directly from github:

pip install git+git://github.com/BinaryAnalysisPlatform/bap-python.git

Using

>>> import bap
>>> proj = bap.run('/bin/true')
>>> main = proj.program.subs.find('main')
>>> entry = main.blks[0]
>>> next = main.blks.find(entry.jmps[0].target.arg)

For more information, read builtin documentation, for example with ipython:

    >>> bap?

Using low-level interface

The low-level interface provides an access to disassembler and image loader. It uses RPC interface to make calls to the library. So make sure that you have installed requests and bap-server (see Installation section).

    >>> import bap
    >>> print '\n'.join(insn.asm for insn in bap.disasm(b"\x48\x83\xec\x08"))
        decl    %eax
        subl    $0x8, %esp

A more complex example:

    >>> img = bap.image('coreutils_O0_ls')
    >>> sym = img.get_symbol('main')
    >>> print '\n'.join(insn.asm for insn in bap.disasm(sym))
        push    {r11, lr}
        add     r11, sp, #0x4
        sub     sp, sp, #0xc8
        ... <snip> ...

About

BAP python bindings

Topics

bapprogram-analysisprogram-verificationpythonreverse-engineering

Resources

Readme
MIT license
Activity
Custom properties

Stars

23 stars

Watchers

3 watching

Forks

12 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.