headless-ida


Nameheadless-ida JSON
Version 0.5.5 PyPI version JSON
download
home_page
SummaryHeadless IDA
upload_time2024-02-05 18:54:39
maintainer
docs_urlNone
author
requires_python>=3
licenseMIT License Copyright (c) 2023 Han Dai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ida headless idapro hexrays
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img alt="Headless IDA" src="https://raw.githubusercontent.com/DennyDai/headless-ida/main/headless-ida.png" width="128">
</p>
<h1 align="center">Headless IDA</h1>

[![Latest Release](https://img.shields.io/pypi/v/headless-ida.svg)](https://pypi.python.org/pypi/headless-ida/)
[![PyPI Statistics](https://img.shields.io/pypi/dm/headless-ida.svg)](https://pypistats.org/packages/headless-ida)
[![License](https://img.shields.io/github/license/DennyDai/headless-ida.svg)](https://github.com/DennyDai/headless-ida/blob/main/LICENSE)

# Install
```bash
pip install headless-ida
```

# Usage

### Use it as a normal Python module.
```python
# Initialize HeadlessIda
from headless_ida import HeadlessIda
headlessida = HeadlessIda("/path/to/idat64", "/path/to/binary")

# Import IDA Modules (make sure you have initialized HeadlessIda first)
import idautils
import ida_name

# Or Import All IDA Modules at Once (idaapi is not imported by default)
# from headless_ida.ida_headers import *

# Have Fun
for func in idautils.Functions():
    print(f"{hex(func)} {ida_name.get_ea_name(func)}")
```

### Use it as a command line tool.
```bash
# Interactive Console
$ headless-ida /path/to/idat64 /path/to/binary
Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import idautils
>>> list(idautils.Functions())[0:10]
[16384, 16416, 16432, 16448, 16464, 16480, 16496, 16512, 16528, 16544]
>>> 


# Run IDAPython Script
$ headless-ida /path/to/idat64 /path/to/binary idascript.py


# One-liner
$ headless-ida /path/to/idat64 /path/to/binary -c "import idautils; print(list(idautils.Functions())[0:10])"


# In case you like IPython
$ headless-ida /path/to/idat64 /path/to/binary -c "import IPython; IPython.embed();"
```

# Advanced Usage
## Remote Server

### Start a Headless IDA server
```bash
$ headless-ida-server /path/to/idat64 localhost 1337 &
```

### Connect to the server in Python script
```python
# Initialize HeadlessIda
from headless_ida import HeadlessIdaRemote
headlessida = HeadlessIdaRemote("localhost", 1337, "/path/to/local/binary")

# Import IDA Modules (make sure you have initialized HeadlessIda first)
import idautils
import ida_name

# Have Fun
for func in idautils.Functions():
    print(f"{hex(func)} {ida_name.get_ea_name(func)}")
```

### Connect to the server in command line
```bash
# Interactive Console
$ headless-ida localhost:1337 /path/to/local/binary
# Run IDAPython Script
$ headless-ida localhost:1337 /path/to/local/binary idascript.py
# One-liner
$ headless-ida localhost:1337 /path/to/local/binary -c "import idautils; print(list(idautils.Functions())[0:10])"
```


# Resources
- [Headless IDA Examples](https://github.com/DennyDai/headless-ida/tree/main/examples)
- [IDAPython Official Documentation](https://www.hex-rays.com/products/ida/support/idapython_docs/)
- [IDAPython Official Examples](https://github.com/idapython/src/tree/master/examples)

# Known Issues
### `from XXX import *`
 - Using `from XXX import *` syntax with certain ida modules (like idaapi, ida_ua, etc.) is currently unsupported due to SWIG and RPyC compatibility issues. We recommend importing specific items with `from XXX import YYY, ZZZ`, or importing the entire module using `import XXX`.
 - The issue arises because SWIG, employed for creating Python bindings for C/C++ code, generates intermediary objects (SwigVarlink) that RPyC, our remote procedure call mechanism, cannot serialize or transmit correctly.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "headless-ida",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "ida,headless,idapro,hexrays",
    "author": "",
    "author_email": "Han Dai <pypi@han.do>",
    "download_url": "https://files.pythonhosted.org/packages/65/c3/f90d32ca213423a30bb8f89ee75fc5f6f46127e95462345bb1ce8fb30b10/headless-ida-0.5.5.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img alt=\"Headless IDA\" src=\"https://raw.githubusercontent.com/DennyDai/headless-ida/main/headless-ida.png\" width=\"128\">\n</p>\n<h1 align=\"center\">Headless IDA</h1>\n\n[![Latest Release](https://img.shields.io/pypi/v/headless-ida.svg)](https://pypi.python.org/pypi/headless-ida/)\n[![PyPI Statistics](https://img.shields.io/pypi/dm/headless-ida.svg)](https://pypistats.org/packages/headless-ida)\n[![License](https://img.shields.io/github/license/DennyDai/headless-ida.svg)](https://github.com/DennyDai/headless-ida/blob/main/LICENSE)\n\n# Install\n```bash\npip install headless-ida\n```\n\n# Usage\n\n### Use it as a normal Python module.\n```python\n# Initialize HeadlessIda\nfrom headless_ida import HeadlessIda\nheadlessida = HeadlessIda(\"/path/to/idat64\", \"/path/to/binary\")\n\n# Import IDA Modules (make sure you have initialized HeadlessIda first)\nimport idautils\nimport ida_name\n\n# Or Import All IDA Modules at Once (idaapi is not imported by default)\n# from headless_ida.ida_headers import *\n\n# Have Fun\nfor func in idautils.Functions():\n    print(f\"{hex(func)} {ida_name.get_ea_name(func)}\")\n```\n\n### Use it as a command line tool.\n```bash\n# Interactive Console\n$ headless-ida /path/to/idat64 /path/to/binary\nPython 3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n(InteractiveConsole)\n>>> import idautils\n>>> list(idautils.Functions())[0:10]\n[16384, 16416, 16432, 16448, 16464, 16480, 16496, 16512, 16528, 16544]\n>>> \n\n\n# Run IDAPython Script\n$ headless-ida /path/to/idat64 /path/to/binary idascript.py\n\n\n# One-liner\n$ headless-ida /path/to/idat64 /path/to/binary -c \"import idautils; print(list(idautils.Functions())[0:10])\"\n\n\n# In case you like IPython\n$ headless-ida /path/to/idat64 /path/to/binary -c \"import IPython; IPython.embed();\"\n```\n\n# Advanced Usage\n## Remote Server\n\n### Start a Headless IDA server\n```bash\n$ headless-ida-server /path/to/idat64 localhost 1337 &\n```\n\n### Connect to the server in Python script\n```python\n# Initialize HeadlessIda\nfrom headless_ida import HeadlessIdaRemote\nheadlessida = HeadlessIdaRemote(\"localhost\", 1337, \"/path/to/local/binary\")\n\n# Import IDA Modules (make sure you have initialized HeadlessIda first)\nimport idautils\nimport ida_name\n\n# Have Fun\nfor func in idautils.Functions():\n    print(f\"{hex(func)} {ida_name.get_ea_name(func)}\")\n```\n\n### Connect to the server in command line\n```bash\n# Interactive Console\n$ headless-ida localhost:1337 /path/to/local/binary\n# Run IDAPython Script\n$ headless-ida localhost:1337 /path/to/local/binary idascript.py\n# One-liner\n$ headless-ida localhost:1337 /path/to/local/binary -c \"import idautils; print(list(idautils.Functions())[0:10])\"\n```\n\n\n# Resources\n- [Headless IDA Examples](https://github.com/DennyDai/headless-ida/tree/main/examples)\n- [IDAPython Official Documentation](https://www.hex-rays.com/products/ida/support/idapython_docs/)\n- [IDAPython Official Examples](https://github.com/idapython/src/tree/master/examples)\n\n# Known Issues\n### `from XXX import *`\n - Using `from XXX import *` syntax with certain ida modules (like idaapi, ida_ua, etc.) is currently unsupported due to SWIG and RPyC compatibility issues. We recommend importing specific items with `from XXX import YYY, ZZZ`, or importing the entire module using `import XXX`.\n - The issue arises because SWIG, employed for creating Python bindings for C/C++ code, generates intermediary objects (SwigVarlink) that RPyC, our remote procedure call mechanism, cannot serialize or transmit correctly.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Han Dai  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Headless IDA",
    "version": "0.5.5",
    "project_urls": {
        "documentation": "https://github.com/DennyDai/headless-ida",
        "homepage": "https://github.com/DennyDai/headless-ida",
        "repository": "https://github.com/DennyDai/headless-ida"
    },
    "split_keywords": [
        "ida",
        "headless",
        "idapro",
        "hexrays"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "727054e2658c856a6da0a6b2697302eaec8c39c553ff96fcc400632f6e6f3ced",
                "md5": "ead3106680df3794fc8dfbd50c1ee53e",
                "sha256": "3beaea956064e1214acd8d34276a3d36c8548a7fba95f90bf9e443777b695381"
            },
            "downloads": -1,
            "filename": "headless_ida-0.5.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ead3106680df3794fc8dfbd50c1ee53e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 9166,
            "upload_time": "2024-02-05T18:54:38",
            "upload_time_iso_8601": "2024-02-05T18:54:38.066967Z",
            "url": "https://files.pythonhosted.org/packages/72/70/54e2658c856a6da0a6b2697302eaec8c39c553ff96fcc400632f6e6f3ced/headless_ida-0.5.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65c3f90d32ca213423a30bb8f89ee75fc5f6f46127e95462345bb1ce8fb30b10",
                "md5": "1a58f6122fde9322044d8daff55fdd9c",
                "sha256": "fb795e9bffa83b2e246e0c47f6cd3965e9acc6fe7ec163aba555cb2dc12b71bd"
            },
            "downloads": -1,
            "filename": "headless-ida-0.5.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1a58f6122fde9322044d8daff55fdd9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 8537,
            "upload_time": "2024-02-05T18:54:39",
            "upload_time_iso_8601": "2024-02-05T18:54:39.772837Z",
            "url": "https://files.pythonhosted.org/packages/65/c3/f90d32ca213423a30bb8f89ee75fc5f6f46127e95462345bb1ce8fb30b10/headless-ida-0.5.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-05 18:54:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DennyDai",
    "github_project": "headless-ida",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "headless-ida"
}
        
Elapsed time: 0.17508s