阅读量:0
先看结果
备份&重新生成文件
其中:pyovpn-2.0-py3.10.egg
具体版本看根据实际情况处理, 可以理解为pyovpn-2.0-pyx.x.egg
mkdir ~/crack cd ~/crack cp /usr/local/openvpn_as/lib/python/pyovpn-2.0-py3.10.egg{,.bak} cp /usr/local/openvpn_as/lib/python/pyovpn-2.0-py3.10.egg . unzip -q pyovpn-2.0-py3.10.egg cd ./pyovpn/lic/ mv uprop.pyc uprop2.pyc vim uprop.py (上面这一步结束,会打开一个新的文件,粘贴代码块的代码(去GitHub复制),保存文件。) python3 -O -m compileall uprop.py && mv __pycache__/uprop.*.pyc uprop.pyc cd ~/crack zip -rq pyovpn-2.0-py3.10.egg ./pyovpn ./EGG-INFO ./common mv ./pyovpn-2.0-py3.10.egg /usr/local/openvpn_as/lib/python/pyovpn-2.0-py3.10.egg systemctl restart openvpnas
核心代码
移至GitHub
注意import
需和mv uprop.pyc uprop2.pyc
保持一致
from pyovpn.lic import uprop2 xxxxxx