50行python过字符串静态处理
v36 = 0;
v11 = 101;
v30 = 46;
v19 = 97;
v9 = 28769;
v23 = 111;
v13 = 111;
v25 = 97;
v28 = 111;
v17 = 46;
v21 = 122;
v26 = 116;
v27 = 105;
v35 = 116;
v14 = 98;
v15 = 105;
v12 = 27950;
v22 = 108;
v34 = 115;
v32 = 108;
v33 = 105;
v24 = 99;
v10 = 12656;
v20 = 119;
v29 = 110;
v16 = 25964;
v8 = 778923875;
v18 = 26217;
v31 = 112;
v5 = objc_msgSend(&OBJC_CLASS___NSString, "stringWithUTF8String:", &v8);
v6 = (unsigned int)+[gAEfdwoIDCCQSqSbiVcStbigdskXDgpYvPcIQVzM jCKeedzMtBIZYvvqwHKQceVQlQcXDEpeLrdTrPEG:content:](
&OBJC_CLASS___gAEfdwoIDCCQSqSbiVcStbigdskXDgpYvPcIQVzM,
"jCKeedzMtBIZYvvqwHKQceVQlQcXDEpeLrdTrPEG:content:",
v5,
v4);
【50行python过字符串静态处理】看到这种形式,就是打散字符串的处理方式,我们写个python脚本快速搞定
#-*- coding:utf-8 -*-
from tkinter import *
from tkinter.scrolledtext import ScrolledTextdef parse(textin, textout):
input = textin.get(0.0, END)
d = dict()
for line in input.split('\n'):
if line.find('=') == -1:
continue
k, v = tuple(line.split('='))
k = k.strip()
v = v.strip().replace(';
', '')
try:
if k.find('[') != -1:
k = int(k.split('[')[1].split(']')[0])
if v.startswith('0x') or v.startswith('0X'):
v = int(v, base=16)
else:
v = int(v)
d[k] = v
elif k.find('_') != -1:
k = int(k.split('_')[1], base=16)
if v.startswith('0x') or v.startswith('0X'):
v = int(v, base=16)
else:
v = int(v)
d[k] = v
elif k.startswith('v'):
k = int(k.replace('v', ''))
if v.startswith('0x') or v.startswith('0X'):
v = int(v, base=16)
else:
v = int(v)
d[k] = v
except Exception as e:
textout.insert(INSERT, str(e))
return
s = ''
for item in sorted(d.keys()):
v = d[item]
while v != 0:
s += chr(v & 255)
v = (v >> 8)
textout.insert(INSERT, s)root = Tk()
textin = ScrolledText(root)
textin.pack()
btn = Button(root, text="parse")
btn.pack()
textout = ScrolledText(root)
textout.pack()
btn.bind("", lambda event:parse(textin, textout))
root.mainloop()
文章图片
image.png
推荐阅读
- 太平之莲
- 七年之痒之后
- 牛人进化+|牛人进化+ 按自己的意愿过一生
- python学习之|python学习之 实现QQ自动发送消息
- 2021-02-10(找不回的“年味”……)
- 逻辑回归的理解与python示例
- 生命过客——第10章|生命过客——第10章 初为人母
- python自定义封装带颜色的logging模块
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- 【Leetcode/Python】001-Two|【Leetcode/Python】001-Two Sum