https://github.com/hugsy/ida-headless
IDA (sort of) headless
https://github.com/hugsy/ida-headless
decompiler disassembler ida-pro python remoting rpyc
Last synced: over 1 year ago
JSON representation
IDA (sort of) headless
- Host: GitHub
- URL: https://github.com/hugsy/ida-headless
- Owner: hugsy
- License: mit
- Created: 2021-07-07T19:45:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-17T19:30:59.000Z (over 2 years ago)
- Last Synced: 2025-03-18T21:50:34.952Z (over 1 year ago)
- Topics: decompiler, disassembler, ida-pro, python, remoting, rpyc
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 23
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ida-headless
IDA (sort of) headless
## Idea
Embed RPyc in IDA to expose IDA's API externally, by a background thread that runs the TCP server. Also in iPython this
provides autocomplete.
Props to https://github.com/vrtadmin/FIRST-plugin-ida/blob/master/first_plugin_ida/first.py#L87
for the workaround on the threading issue, for IDA Pro >= 7.2
## Quick start
```python
>>> import rpyc
>>> c = rpyc.connect("ida.rpyc.server", 18812)
#
# IDA namespace will be in `c.root`
#
>>> c.root.idaapi.get_root_filename()
'ntoskrnl.exe'
>>> hex( c.root.idc.here() )
0x140088194
>>> c.root.idaapi.jumpto( 0x1400881EE )
True
```
For more facility, you can alias it:
```python
>>> idc = c.root.idc
```
Then, it becomes super readable
```python
>>> idc.jumpto( idc.get_name_ea_simple("DriverEntry") )
True
>>> idc.set_cmt( idc.here(), "@hugsy was here", 1)
True
```
For generator objects, you now need to use the wrapper `c.root.iterate()`.
Example:
```python
>>> idc = c.root.idc
>>> idautils = c.root.idautils
>>> for ea in c.root.iterate( idautils.Functions() ):
... print( idc.get_func_name(ea) )
```
Blame HexRays for making their API more confusing at every release.
## Links
- https://www.hex-rays.com/products/ida/support/ida74_idapython_no_bc695_porting_guide.shtml
- Same but for Binary Ninja -> https://github.com/hugsy/binja-headless
## Demo
[](https://youtu.be/obX2GreSsFU)