当前位置:网站首页>关于超星脚本出现乱码问题
关于超星脚本出现乱码问题
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)
边栏推荐
- Strengthen basic learning records
- HackMyvm靶机系列(5)-warez
- 7-9 make house number 3.0 (PTA program design)
- Load balancing ribbon of microservices
- Package bedding of components
- Middleware vulnerability recurrence Apache
- HackMyvm靶机系列(4)-vulny
- SQL injection
- Hackmyvm target series (2) -warrior
- Sqqyw (indifferent dot icon system) vulnerability recurrence and 74cms vulnerability recurrence
猜你喜欢
Web vulnerability - File Inclusion Vulnerability of file operation
Hackmyvm Target Series (3) - vues
搭建域环境(win)
Hackmyvm target series (2) -warrior
How does SQLite count the data that meets another condition under the data that has been classified once
xray與burp聯動 挖掘
7-5 staircase upgrade (PTA program design)
Intranet information collection of Intranet penetration (2)
Solutions to common problems in database development such as MySQL
攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)
随机推荐
[err] 1055 - expression 1 of order by clause is not in group by clause MySQL
搭建域环境(win)
Tencent map circle
7-4 hash table search (PTA program design)
List and data frame of R language experiment III
Package bedding of components
Internet Management (Information Collection)
XSS (cross site scripting attack) for security interview
Interpretation of iterator related "itertools" module usage
HackMyvm靶机系列(5)-warez
HackMyvm靶機系列(3)-visions
Intel oneapi - opening a new era of heterogeneity
How to test whether an object is a proxy- How to test if an object is a Proxy?
An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
Strengthen basic learning records
Callback function ----------- callback
Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]
Hackmyvm target series (1) -webmaster
The United States has repeatedly revealed that the yield of interest rate hiked treasury bonds continued to rise
Attack and defense world misc practice area (GIF lift table ext3)