-
Hi! I have some issues getting the remote debugger up and running. This is a clean Win10 vm with Binja Personal and PyCharm Pro. Clean venv with python3.10 Issue at hand: [Default] Traceback (most recent call last):
[Default] File "C:\Users\n\AppData\Roaming\Binary Ninja\plugins\decrypt_string\__init__.py", line 9, in <module>
[Default] connect_pycharm_debugger()
[Default] File "C:\Program Files\Vector35\BinaryNinja\plugins\..\python\binaryninja\__init__.py", line 356, in connect_pycharm_debugger
[Default] import pydevd_pycharm # type: ignore
[Default] File "C:\Users\n\AppData\Roaming\Binary Ninja\python310\site-packages\pydevd_pycharm.py", line 3, in <module>
[Default] from pydevd import settrace
[Default] File "C:\Users\n\AppData\Roaming\Binary Ninja\python310\site-packages\pydevd.py", line 16, in <module>
[Default] from _pydevd_bundle.pydevd_collect_try_except_info import collect_return_info
[Default] ModuleNotFoundError: No module named '_pydevd_bundle.pydevd_collect_try_except_info'
[PythonPlugin] Python plugin 'decrypt_string' could not be loaded Plugin: from binaryninja import *
from binaryninja.log import log_info
import sys
print(sys.path)
connect_pycharm_debugger()
class DecodeString(binaryninja.Transform):
name = "Decode String"
description = "Decode String"
input_type = "Raw"
output_type = "Raw"
transform_type = binaryninja.TransformType.DecodeTransform
def perform_decode(self, data, params):
"""
void* rax_2 = HeapAlloc(hHeap: GetProcessHeap(), dwFlags: HEAP_ZERO_MEMORY, dwBytes: sx.q(arg2))
for (int32_t i = 0; i u< arg2; i = i + 1)
char var_24_1 = 0x13
if (modu.dp.d(0:i, 2) == 0)>
var_24_1 = 0x37
*(rax_2 + zx.q(i)) = *(arg1 + zx.q(i)) ^ var_24_1
return rax_2
"""
log_info("Performing decode")
result = bytearray()
for i in range(len(data)):
if i % 2 == 0:
result.append(data[i] ^ 0x13)
else:
result.append(data[i] ^ 0x37)
return result
def perform_encode(self, data, params):
return self.perform_decode(data, params)
# Register plugin
DecodeString.register() Preferences: Pip list: pip list
Package Version
-------------- -----------
colorama 0.4.4
pip 23.2.1
pydantic 1.7.3
pydev 0.0.1
pydevd 2.10.0
pydevd-pycharm 211.7142.13
setuptools 68.2.0
wheel 0.41.2 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
I have created an issue #4904 and will look into it |
Beta Was this translation helpful? Give feedback.
-
Hi @N0K0, did you install the correct version of binaryninja-api/python/__init__.py Line 357 in 7df8225 If so, can you check if the file |
Beta Was this translation helpful? Give feedback.
-
Setup a new clean venv: Installed the suggested version from the current PyCharm
pip list:
Traceback:
sys.path:
But now that i'm looking around the internet some more: Many have the same issue in a bunch of different contexts..
Can't really seen any good reason for this issue, as the only site package with content is the venv one, and that should only contain pycharms version of pydevd |
Beta Was this translation helpful? Give feedback.
-
Wait a sec, it get more interesting!
Running this command actually solved the issue. This is then in the context of the venv under binary_ninja_plugin, after i've wiped everything from the user content folder site-packages. Not sure where we should take this next now :S |
Beta Was this translation helpful? Give feedback.
-
I have created an issue for it so I am marking this as answered |
Beta Was this translation helpful? Give feedback.
I have created an issue for it so I am marking this as answered