当前位置:网站首页>关于超星脚本出现乱码问题
关于超星脚本出现乱码问题
2022-07-06 09:23:00 【叶、慕】
这种情况在挂载脚本后无法答题,任何关于答题脚本的脚本都无法使用。
看这个字体,已经读不出原文了,一开始以为是加密尝试使用加密算法破解,然后用BP、其他工具尝试解码无果。
之后尝试用编码集解码,结果也以失败告终。网上搜索也没有解决。
最后我抱着试一试的心态去试了试繁简转换,开始不相信居然怎么简单,超星程序员难道划水,然后转换成功了,成功还原的原题。下面是我用Python还原的输出
#coding = utf-8
from zhconv import convert
code_lib = []
scr_lib = []
real_lib = []
code = '俄国十月擛擭擮辟了世掷擩产擪级擨擢主义擛擭的擝时擫'
scr = '俄国十月革命开辟了世界世界无产阶级社会主义革命的新时代'
for i in code:
decode = ord(i)
code_lib.append(decode)
for j in scr:
decode = ord(j)
scr_lib.append(decode)
for k in range(len(code_lib)):
real = code_lib[k] - scr_lib[k]
real_lib.append(real)
print(code_lib)
print(scr_lib)
print('---------差数--------')
print(real_lib)
print(decode)
decode = convert(scr,'zh-hans')
print(decode)
转换成功
pip install zhconv
这里需要用到zhconv库
要快速写出修改后的JS脚本:对于Python代码转换为JS代码
pip install jiphy
需要使用jiphy库,至于一些JS转换后的一些问题实际问题实际解决
最后总结,乱码问题就是繁简转换,所以只要在原来的JS脚本搜索题目上加上繁简转换功能应该能解决。解决方案比如,让整个网页源代码实现繁体转换为简体后再载入JS脚本。
#coding = utf-8
from zhconv import convert
import jiphy
def Decode(scr):
decode = convert(scr,'zh-hans')
return decode
def PyToJs(scr):
js = jiphy.to.python(scr)
return js
def JsToPy(scr):
py = jiphy.to.javascript(scr)
return py
if __name__ == '__main__':
#test
word = '繁体字'
decode = Decode(word)
print(decode)
js = 'JS代码'
py = JsToPy(js)
print(py)
边栏推荐
- Overview of LNMP architecture and construction of related services
- Package bedding of components
- HackMyvm靶机系列(2)-warrior
- Experiment 6 inheritance and polymorphism
- Network technology related topics
- Harmonyos JS demo application development
- How does SQLite count the data that meets another condition under the data that has been classified once
- sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现
- AQS details
- Captcha killer verification code identification plug-in
猜你喜欢
中间件漏洞复现—apache
"Gold, silver and four" job hopping needs to be cautious. Can an article solve the interview?
[VMware abnormal problems] problem analysis & Solutions
Record once, modify password logic vulnerability actual combat
Interpretation of iterator related "itertools" module usage
SystemVerilog discusses loop loop structure and built-in loop variable I
captcha-killer验证码识别插件
Solutions to common problems in database development such as MySQL
Wei Shen of Peking University revealed the current situation: his class is not very good, and there are only 5 or 6 middle-term students left after leaving class
7-7 7003 combination lock (PTA program design)
随机推荐
Which is more advantageous in short-term or long-term spot gold investment?
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
7-11 mechanic mustadio (PTA program design)
Experiment 7 use of common classes (correction post)
7-14 error ticket (PTA program design)
Xray and burp linkage mining
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
Based on authorized access, cross host, and permission allocation under sqlserver
Experiment 7 use of common classes
内网渗透之内网信息收集(二)
How to understand the difference between technical thinking and business thinking in Bi?
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
HackMyvm靶機系列(3)-visions
Hackmyvm target series (1) -webmaster
Tencent map circle
JVM memory model concept
Sword finger offer 23 - print binary tree from top to bottom
Force deduction 152 question multiplier maximum subarray
JDBC看这篇就够了
《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案