From 4f249baddaf1a91f23d36c66b089e3d51bb2f86a Mon Sep 17 00:00:00 2001 From: doronz88 Date: Mon, 14 Oct 2024 16:24:40 +0300 Subject: [PATCH] client: add `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` to base --- src/rpcclient/rpcclient/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rpcclient/rpcclient/client.py b/src/rpcclient/rpcclient/client.py index 08345a9..9f64801 100644 --- a/src/rpcclient/rpcclient/client.py +++ b/src/rpcclient/rpcclient/client.py @@ -27,8 +27,6 @@ from rpcclient.lief import Lief from rpcclient.network import Network from rpcclient.processes import Processes -from rpcclient.protos.rpc_pb2 import Argument, CmdCall, CmdDlclose, CmdDlopen, CmdDlsym, CmdDummyBlock, CmdExec, \ - CmdListDir, CmdPeek, CmdPoke, Response from rpcclient.protosocket import ProtoSocket from rpcclient.structs.consts import EAGAIN, ECONNREFUSED, EEXIST, EISDIR, ENOENT, ENOTDIR, ENOTEMPTY, EPERM, EPIPE, \ RTLD_NEXT @@ -36,6 +34,11 @@ from rpcclient.symbols_jar import SymbolsJar from rpcclient.sysctl import Sysctl +# make sure imports from the *_pb2 modules don't depend on the locally installed protobuf version +os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python' +from rpcclient.protos.rpc_pb2 import Argument, CmdCall, CmdDlclose, CmdDlopen, CmdDlsym, CmdDummyBlock, CmdExec, \ + CmdListDir, CmdPeek, CmdPoke, Response # noqa E402 + tty_support = False try: import termios