Skip to content

Commit

Permalink
client: set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
Browse files Browse the repository at this point in the history
By default, the _pb2 module will try using the locally installed protobuf
library which may be in conflict with the version being compiled.
By setting this envvar to `python`, we force the protobuf python wrapper
to parse the structs purely in python which is much slower, but will work
cross workstations with different protobof libraries
  • Loading branch information
doronz88 committed Oct 14, 2024
1 parent 8c22dbb commit 1a2c8dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rpcclient/rpcclient/darwin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import builtins
import json
import logging
import os
import plistlib
import typing
from collections import namedtuple
Expand Down Expand Up @@ -35,11 +36,14 @@
from rpcclient.darwin.time import Time
from rpcclient.darwin.xpc import Xpc
from rpcclient.exceptions import CfSerializationError, GettingObjectiveCClassError, MissingLibraryError
from rpcclient.protos.rpc_pb2 import CmdGetClassList, CmdShowClass, CmdShowObject
from rpcclient.structs.consts import RTLD_GLOBAL, RTLD_NOW
from rpcclient.symbol import Symbol
from rpcclient.symbols_jar import SymbolsJar

# 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 CmdGetClassList, CmdShowClass, CmdShowObject # noqa: E402

IsaMagic = namedtuple('IsaMagic', 'mask value')
ISA_MAGICS = [
# ARM64
Expand Down

0 comments on commit 1a2c8dd

Please sign in to comment.