应用场景
16进制数相邻位置交换
# 导入文本
with open('C:/Users/DELL/Desktop/WinHex64.txt', 'r') as f:
content = f.read()
content = content.strip().replace("\n"," ").replace(" ","")
content=list(content)
content[::2],content[1::2]=content[1::2],content[::2]
result = ''.join(content)
with open('C:/Users/DELL/Desktop/flag.txt', 'w') as g:
g.write(result)
倒置
with open('desktop','rb') as f:
with open('flag','wb') as g:
g.write(f.read()[::-1])
1 条评论
aaa
aaa