资源简介
cocos2dx lua 加密工具,使用时将pyd拷贝到Python27\DLLs中,运行xxteaEncry.py
原理详见http://blog.csdn.net/cloud95/article/details/38110009
代码片段和文件信息
import xxteaModule
import os
def ReadFile(filePath):
file_object = open(filePath‘rb‘)
all_the_text = file_object.read()
file_object.close()
return all_the_text
def WriteFile(filePathall_the_text):
file_object = open(filePath‘wb‘)
file_object.write(all_the_text)
file_object.close()
def BakFile(filePathall_the_text):
file_bak = filePath[:len(filePath)-3] + ‘bak‘
WriteFile(file_bakall_the_text)
def ListLua(path):
fileList = []
for rootdirsfiles in os.walk(path):
for eachfiles in files:
if eachfiles[-4:] == ‘.lua‘ :
fileList.append(root + ‘/‘ + eachfiles)
return fileList
def EncodeWithXxteaModule(filePathkeysignment):
all_the_text = ReadFile(filePath)
if all_the_text[:len(signment)] == signment :
return
#bak lua
BakFile(filePathall_the_text)
encrypt = xxteaModule.encrypt(all_the_textkey)
signment = signment + encrypt
WriteFile(filePathsignment)
def EncodeLua(projectPathkeysignment):
path = projectPath + ‘/src‘
fileList = ListLua(path)
for files in fileList:
EncodeWithXxteaModule(fileskeysignment)
def FixCpp(projectPathkeysignment):
filePath = projectPath + ‘/frameworks/runtime-src/Classes/AppDelegate.cpp‘
all_the_text = ReadFile(filePath)
#bak cpp
BakFile(filePathall_the_text)
pos = all_the_text.find(‘stack->setXXTEAKeyAndSign‘)
left = all_the_text.find(‘(‘pos)
right = all_the_text.find(‘;‘pos)
word = str.format(‘(“%s“ strlen(“%s“) “%s“ strlen(“%s“))‘ % (keykeysignmentsignment))
all_the_text = all_the_text[:left] + word + all_the_text[right:-1]
WriteFile(filePathall_the_text)
projectPath = “D:/cocosIDEWork/aseGame/“
key = “123“
signment = “cloud“
EncodeLua(projectPathkeysignment)
FixCpp(projectPathkeysignment)
print “encode ok“
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2047 2014-07-25 10:09 xxteaEncry.py
文件 7680 2014-07-24 16:03 xxteaModule.pyd
- 上一篇:Yolov3所需数据预处理python文件
- 下一篇:python python
相关资源
-
决策树ID3算法实验_数据集car_databa
- cocos2dx开发的球球大作战源码
- python3 + wxpython 实现RSA加密聊天室
- Lua语言程序设计合集8本
- python实现图像的混沌加密解密
- 用PYTHON实现的各类经典加解密算法
- pytracking/pytracking/evaluation/tracker.py
- python爬虫 破解js加密有道词典案列的
- luajit 2.1.0 bate解密工具
- python之des加密算法
- excel转化成lua 表
- SOCKET实现DES加密的全双工聊天程序
- Game Programming with Python Lua And Ruby
- pycrypto-2.6.1
-
ba
se家族加密解密.py - 智联招聘爬虫,破解md5加密反扒,2
- python 简单的加密解密软件
- python加密解密技术
- DES图像加密
- python des加密模块
- python实现md5以及rsa加密方式
- python实现md5加密方式
- python实现简单的加密通信
- Python中通过PyPDF2实现PDF加密资源以及
评论
共有 条评论