资源简介
subl3207_Linux64.tar.xz
代码片段和文件信息
#!/usr/bin/env python3
#coding=utf-8
import os
import sys
def isRoot():
return os.getuid()==0
def getSudoUid():
if os.environ[‘SUDO_UID‘]:
return int(os.environ[‘SUDO_UID‘])
return 0
def getSudoGid():
if os.environ[‘SUDO_GID‘]:
return int(os.environ[‘SUDO_GID‘])
return 0
def createSubl():
# data=[‘#!/bin/sh\n‘‘LD_PRELOAD=‘+currentPath+‘/sublime_text_fcitx.so exec ‘+currentPath+‘/sublime_text “$@“‘]
# fsubl=open(sublPath‘w‘)
# fsubl.writelines(data)
# fsubl.close()
# os.chmod(sublPath0o755)
# os.chown(sublPathmyuidmygid)
os.system(‘sudo ln -f -s ‘+currentPath+‘/sublime_text ‘+sublPath)
def createDesktop():
fdesk=open(desktopFile‘w‘)
fdesk.writelines(‘‘‘[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code markup and prose
Exec=‘‘‘+sublPath+‘‘‘ %F
Terminal=false
MimeType=text/plain;
Icon=‘‘‘+currentPath+‘‘‘/Icon/128x128/sublime-text.png
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;
[Desktop Action Window]
Name=New Window
Exec=‘‘‘+sublPath+‘‘‘ -n
OnlyShowIn=Unity;
[Desktop Action Document]
Name=New File
Exec=‘‘‘+sublPath+‘‘‘ --command new_file
OnlyShowIn=Unity;‘‘‘)
fdesk.close()
os.chown(desktopFilemyuidmygid)
def uninstall():
os.remove(sublPath)
os.remove(desktopFile)
def addtoHOSTS():
denyList=[
‘www.sublimetext.com‘
‘license.sublimehq.com‘
‘45.55.255.55‘
‘45.55.41.223‘
]
hostlines=[]
fhosts=open(‘/etc/hosts‘‘r+‘)
hostlines=fhosts.readlines()
for url in denyList:
has=False
for row in hostlines:
if url in row.lower():
has=True
break
if not has:
fhosts.writelines(‘127.0.0.1 ‘+url+‘\n‘)
fhosts.close()
def crack():
pos=-1
mainprogram=‘sublime_text‘
with open(mainprogram‘rb+‘) as f:
pos=f.read().find(bytes([0x97 0x94 0x0D 0x00 0x4F 0xB4 0x0D 0x00 0xAF 0xC5 0x0D]))
if pos>=0:
print(‘破解程序\t‘end=‘‘)
with open(mainprogram‘rb+‘) as f:
f.seek(pos0)
f.write(bytes([000]))
print(‘完成‘)
if __name__==‘__main__‘:
if not isRoot():
print(‘请尝试运行 sudo‘__file__)
sys.exit(-1)
if len(sys.argv)>1 and sys.argv[1]==‘-u‘:
uninstall()
sys.exit(0)
if not os.path.exists(‘./sublime_text‘):
print(‘请将此脚本放在sublime_text执行程序所在目录中‘)
sys.exit(-1)
crack()
currentPath=os.getcwd()
homedir=os.environ[‘HOME‘]
desktopFile=homedir+‘/.local/share/applications/sublime_text.desktop‘
os.makedirs(homedir+‘/.local/share/applications/‘exist_ok=True)
sublPath=‘/usr/local/bin/subl‘
os.makedirs(‘/usr/local/bin/‘exist_ok=True)
myuid=getSudoUid()
mygid=getSudoGid()
addtoHOSTS()
createSubl()
createDesktop()
相关资源
- Burp1.7.11.zip
- 74系列芯片中文手册.rar
- ipc-tm-650大全(英文版).rar
- CamelinAction(2ndEd).pdf
- 相控阵天线的结构与电性能研究.pdf
- FinePrint7.20Pdffactary4.8.rar
- _超宽带无线电基础.rar
- deloitte-cn-tech-trends-zh-2019.pdf
- stm32万年历报告.doc
- zw_chapter13.zip
- zw_EnterpriseArchitect(EA)汉化包.zip
- zw_1stopt5.0.zip
- zw_摄像头实时监控与报警系统Opencv.
- 矩阵分析与应用.pdf
- Swift:面向协议编程_11020624_4033650.ep
- Setup.msi
- 13.3.zip
- 13.2.zip
- 改价精灵安装包.exe
- GBT20274信息安全技术信息系统安全保障
- IMX178LQJ.zip
- LearningOpenCV.7z
- unity2017-winANDmacCrack.zip
- Xshell.zip
- 重构改善既有代码的设计高清版.pdf
- 30337《基于HyperLynx90的信号和电源完整
- 老虎淘客系统5.99.17代理系统2.97微擎系
- s轨迹无碳小车全套资料.rar
- zw_bbbbbbbbo-10475799-算法设计与分析习题
- 数据可视化源码.rar
评论
共有 条评论