Python implementation decompile file

The disclosure is not convenient to decompile file, following some keywords and modify the event name, you can fill in accordance with their own circumstances

# -*- coding:utf8 -*-
import matplotlib.pyplot as plt
import numpy

test_data = []	
move_data = []
Value_X = 0
Value_Y = 0
f = open('文件路径', 'r')	//打开反编译的文件
data = f.read()
rows = data.split('\n')
# 创建二维列表
for row in rows:  # 每行遍历
    split_row = row.split(",")  # 通过指定分隔符','对字符串进行切片
    test_data.append(split_row)  # 在列表尾部添加字符串的元素

for i in range(len(test_data)):
    for j in range(len(test_data[0])):
        if (test_data[i][0] == "valueA"):
            test_data[i][0] = "操作1"
            test_data[i][1] += 'valueB:'
            test_data[i][2] = '操作A' + test_data[i][2] + '目标'
            test_data[i][3] = '操作B' + test_data[i][3] + '目标'
            x = test_data[i][2]
            y = test_data[i][3]
            move_data.append(x)
            move_data.append(y)

        elif (test_data[i][0] == "..." and test_data[i][1] == '1'):
            test_data[i][0] = "XX"
            del test_data[i][1]
            test_data[i][1] = "行动"

        elif (test_data[i][0] == "..." and test_data[i][1] == '0'):
            test_data[i][0] = "YY"
            del test_data[i][1]
            test_data[i][1] = "行动"

print(test_data)
print("=============")
print(move_data)

numbers = [i for i in range(30)]	#解析的数据放进列表
plt.show()

#将反编译的结果保存到新的文件
with open("文件路径\+_result.txt", "w") as f:
    f.write(str(test_data))

 

 

Published 58 original articles · won praise 31 · views 40000 +

Guess you like

Origin blog.csdn.net/qq_37504771/article/details/89293772