{"id":27953814,"url":"https://github.com/binaryanalysisplatform/bap-python","last_synced_at":"2025-05-07T17:14:59.436Z","repository":{"id":56246888,"uuid":"66367496","full_name":"BinaryAnalysisPlatform/bap-python","owner":"BinaryAnalysisPlatform","description":"BAP python bindings","archived":false,"fork":false,"pushed_at":"2023-12-01T21:53:13.000Z","size":69,"stargazers_count":20,"open_issues_count":4,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T17:14:53.750Z","etag":null,"topics":["bap","program-analysis","program-verification","python","reverse-engineering"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BinaryAnalysisPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-23T13:04:06.000Z","updated_at":"2023-08-09T13:16:41.000Z","dependencies_parsed_at":"2023-12-01T22:42:53.855Z","dependency_job_id":null,"html_url":"https://github.com/BinaryAnalysisPlatform/bap-python","commit_stats":{"total_commits":35,"total_committers":9,"mean_commits":3.888888888888889,"dds":0.4571428571428572,"last_synced_commit":"038282376361fa790232819aff37af84cbcf5f9c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryAnalysisPlatform%2Fbap-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryAnalysisPlatform%2Fbap-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryAnalysisPlatform%2Fbap-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryAnalysisPlatform%2Fbap-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryAnalysisPlatform","download_url":"https://codeload.github.com/BinaryAnalysisPlatform/bap-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922320,"owners_count":21825639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bap","program-analysis","program-verification","python","reverse-engineering"],"created_at":"2025-05-07T17:14:58.655Z","updated_at":"2025-05-07T17:14:59.424Z","avatar_url":"https://github.com/BinaryAnalysisPlatform.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"BAP python bindings\n\n# Installing\n\nInstall python bindings with pip (after you have installed `bap`):\n\n```bash\n$ pip install bap\n```\n\nAlternatively you can just copy paste files into your project, or clone it\nwith git-subtree.\n\n\n## Installing low-level bindings\n\nAn optional low-level interface, called [rpc] depends on the requests\nlibrary and the bap-server package. To use it, you need to install\nthem from pip and opam correspondigly:\n\n```bash\n$ pip install bap[rpc]\n$ opam install bap-server\n```\n\n## Installing development version\n\nYou can also install directly from github:\n\n```bash\npip install git+git://github.com/BinaryAnalysisPlatform/bap-python.git\n````\n\n# Using\n\n```python\n\u003e\u003e\u003e import bap\n\u003e\u003e\u003e proj = bap.run('/bin/true')\n\u003e\u003e\u003e main = proj.program.subs.find('main')\n\u003e\u003e\u003e entry = main.blks[0]\n\u003e\u003e\u003e next = main.blks.find(entry.jmps[0].target.arg)\n```\n\nFor more information, read builtin documentation, for example with\n`ipython`:\n\n```python\n    \u003e\u003e\u003e bap?\n```\n\n\n# Using low-level interface\n\nThe low-level interface provides an access to disassembler and image\nloader. It uses RPC interface to make calls to the library. So make\nsure that you have installed `requests` and `bap-server` (see\nInstallation section).\n\n\n```python\n    \u003e\u003e\u003e import bap\n    \u003e\u003e\u003e print '\\n'.join(insn.asm for insn in bap.disasm(b\"\\x48\\x83\\xec\\x08\"))\n        decl    %eax\n        subl    $0x8, %esp\n```\n\nA more complex example:\n\n```python\n    \u003e\u003e\u003e img = bap.image('coreutils_O0_ls')\n    \u003e\u003e\u003e sym = img.get_symbol('main')\n    \u003e\u003e\u003e print '\\n'.join(insn.asm for insn in bap.disasm(sym))\n        push    {r11, lr}\n        add     r11, sp, #0x4\n        sub     sp, sp, #0xc8\n        ... \u003csnip\u003e ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryanalysisplatform%2Fbap-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinaryanalysisplatform%2Fbap-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryanalysisplatform%2Fbap-python/lists"}