Configure IDA/Binary Ninja integration server endpoint through environment (#2746)

Use the `PWNDBG_[BINJA|IDA]_SERVER_HOST` and `PWNDBG_[BINJA|IDA]_SERVER_PORT`
environment variables to specify where the XMLRPC server should listen on.

This allows you to change the host to e.g. "0.0.0.0" to allow connecting from WSL to an
IDA/Binja running on Windows without having to touch the scripts everytime.
pull/2743/head
peace-maker 10 months ago committed by GitHub
parent cd2994bda4
commit 607b2c2f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,7 @@
from __future__ import annotations from __future__ import annotations
import ctypes import ctypes
import os
import sys import sys
import threading import threading
import xmlrpc.client import xmlrpc.client
@ -20,8 +21,8 @@ xmlrpc.client.MAXINT = 10**100
xmlrpc.client.MININT = -(10**100) xmlrpc.client.MININT = -(10**100)
host = "127.0.0.1" host = os.environ.get("PWNDBG_BINJA_SERVER_HOST", "127.0.0.1")
port = 31337 port = int(os.environ.get("PWNDBG_BINJA_SERVER_PORT", "31337"))
logger = binaryninja.log.Logger(0, "pwndbg-integration") logger = binaryninja.log.Logger(0, "pwndbg-integration")

@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
import datetime import datetime
import os
import threading import threading
import xmlrpc.client as xmlclient import xmlrpc.client as xmlclient
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
@ -48,8 +49,8 @@ xmlclient.Marshaller.dispatch[type(1 << 63)] = create_marshaller("<value><i8>%d<
xmlclient.Marshaller.dispatch[int] = create_marshaller("<value><i8>%d</i8></value>") xmlclient.Marshaller.dispatch[int] = create_marshaller("<value><i8>%d</i8></value>")
xmlclient.Marshaller.dispatch[idaapi.cfuncptr_t] = create_marshaller(just_to_str=True) xmlclient.Marshaller.dispatch[idaapi.cfuncptr_t] = create_marshaller(just_to_str=True)
host = "127.0.0.1" host = os.environ.get("PWNDBG_IDA_SERVER_HOST", "127.0.0.1")
port = 31337 port = int(os.environ.get("PWNDBG_IDA_SERVER_PORT", "31337"))
mutex = threading.Condition() mutex = threading.Condition()

Loading…
Cancel
Save