首页
社区
课程
招聘
关于ret-sync无法使用 idb错误之类报错信息的调试
发表于: 2023-4-10 22:05 5819

关于ret-sync无法使用 idb错误之类报错信息的调试

2023-4-10 22:05
5819

1.
把插件打开调试模式,根据报错内容搜索代码--

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# otherwise, look in various known default paths
if sys.platform == 'win32':
    PYTHON_BIN = 'python.exe'
    PYTHON_PATHS = PY_WIN_DEFAULTS
 
    # add paths from %LOCALAPPDATA%
    for ladp in PY_WIN_LOCAL_DEFAULTS:
        PYTHON_PATHS.add(os.path.expandvars(ladp))
 
elif sys.platform.startswith('linux') or sys.platform == 'darwin':
    PYTHON_BIN = 'python'
    PYTHON_PATHS = PY_LINUX_DEFAULTS
 
else:
    rs_log("plugin initialization failed: unknown platform \"%s\"\n"
           "       please fix PYTHON_PATH/PYTHON_BIN in %s/rsconfig.py\n"
           % (sys.platform, PLUGIN_DIR))
 
    raise RuntimeError
 
for pp in PYTHON_PATHS:
    interpreter = os.path.realpath(os.path.normpath(os.path.join(pp, PYTHON_BIN)))
    if os.path.exists(interpreter):
        return interpreter
 
rs_log("plugin initialization failed: Python interpreter not found\n"
       "       please fix PYTHON_PATH/PYTHON_BIN in %s/rsconfig.py\n" % PLUGIN_DIR)
 
raise RuntimeError

copilot给的解释:

 

The first thing we do is check if the spawn module is available. The spawn
module is part of the distutils package that is installed with Python. The
spawn module provides a find_executable function that searches through the
PATH to find the first executable file that matches the name passed to it.
If the spawn module is not available, we will use a hard-coded list of
default paths for the Python interpreter.
If the spawn module is available, we will try to find the Python interpreter
using it. If we find it, we will return it. If we don't find it, we will
give a warning to the user and continue with our hard-coded list of paths.
We will search through our hard-coded list of paths for the Python
interpreter. If we find it, we will return it. If we don't find it, we will
give an error to the user and terminate the plugin. ""
中文:
以上代码的功能是:获取在当前机器上可用的Python解释器的路径。为此,它首先会检查是否可以使用spawn_module来搜索Python解释器的路径,如果可用,它将使用find_executable()函数查找第一个Python解释器的路径,并返回找到的路径,如果在UWP(Universal Windows Platform)目录中找到,则会跳过该路径。如果不可以使用spawn_module,它将使用根据当前操作系统平台定义的Python解释器路径表来搜索Python解释器,并返回第一个找到的Python解释器的路径,如果找不到,则在rs_log日志中输出一条错误消息,并产生一个RuntimeError异常。

 

(我不会python,大佬勿喷)

 

得出结论:1.python路径错误,2,python版本错误.ret-sync只支持python 2.7-3,现在python一般用的3.8肯定错误
解决方案:下载python2.7 把环境变量 path指向python2.7


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//