jsc和luac文件 xxtea 解密.
# -*- coding: utf-8 -*-
import xxtea
import os src = "./assets/src"
dst = "./assets/srcd" xxtea_sign = ""
xxtea_key = "fc9853c5-78f9-55"
xxtea_sign_len = len(xxtea_sign)
xxtea_key_len = len(xxtea_key) files = []
exts = [".luac",".jsc"] def deep_iterate_dir(rootDir):
for lists in os.listdir(rootDir):
path = os.path.join(rootDir, lists)
if os.path.isdir(path):
deep_iterate_dir(path)
elif os.path.isfile(path):
ext = os.path.splitext(path)[1]
if ext in exts:
files.append(path) # 处理一个文件
def handle_file(file):
with open(file,"rb") as fd:
con = fd.read()
c2 = xxtea.decrypt(con, xxtea_key,padding=False)
fd.close()
return c2 # 保存文件
def save_file(file,outData):
dst_rootpath = os.path.split(file)[0]
try:
# print "creating dir (%s)" % (dst_rootpath)
os.makedirs(dst_rootpath)
except OSError:
if os.path.exists(dst_rootpath) == False:
# There was an error on creation, so make sure we know about it
raise Exception("Error: create directory %s failed." % dst_rootpath) if file.endswith("c"):
file = file[:-1]
with open(file,"wb") as fd:
con = fd.write(outData)
fd.close() # 获取绝对路径
def normalize_path(i):
tmp = os.path.normpath(i)
if not os.path.isabs(tmp):
tmp = os.path.abspath(tmp)
return tmp # 获取相对路径
def get_relative_path(luafile):
try:
pos = luafile.index(src)
return luafile[len(src)+1:]
except ValueError:
raise Exception("get_relative_path error") def handle_all_files():
for file in files:
con = handle_file(file)
if con:
path = os.path.join(dst,get_relative_path(file))
save_file(path,con)
else:
print ("handle %s file error" % file) def main():
global src
global dst
src = normalize_path(src)
dst = normalize_path(dst) if not os.path.exists(dst):
os.makedirs(dst) deep_iterate_dir(src)
handle_all_files() if __name__ == "__main__":
main()
jsc和luac文件 xxtea 解密.的更多相关文章
- Code笔记之:对使用zend加密后的php文件进行解密
对使用zend加密后的php文件进行解密 使用zend加密后的php文件用notpad++打开会出现类似的乱码 下面使用解密工具进行解密 http://pan.baidu.com/s/1i3n4ysX ...
- linux环境下给文件加密/解密的方法
原文地址:linix环境下给文件加密/解密的方法 作者:oracunix 一. 利用 vim/vi 加密:优点:加密后,如果不知道密码,就看不到明文,包括root用户也看不了:缺点:很明显让别人知 ...
- ref:使用Dezender对zend加密后的php文件进行解密
ref:http://www.cnblogs.com/88223100/ 使用Dezender对zend加密后的php文件进行解密 在开发中需要修改一些php文件,部分是通过zend加密的,记事本 ...
- linux 使用vim文件加密/解密的方法
一. 利用 vim/vi 加密:优点:加密后,如果不知道密码,就看不到明文,包括root用户也看不了:缺点:很明显让别人知道加密了,容易让别人把加密的文件破坏掉,包括内容破坏和删除: vi编辑器相信大 ...
- L脚本语言实现文件加解密
L脚本语言中能够对内存对象进行AES加解密.我们能够非常easy地实现文件加解密 #scp #定义一个秘钥字符串 定义:字符串,str1,abcdefg 打开:文件,file1,c:\1.txt 打开 ...
- Spring boot RSA 文件加密解密
github项目地址 rsa_demo ##测试 加密D:/hello/test.pdf 文件,生成加密后的文件 testNeedDecode.pdf 对testNeedDecode.pdf 文件进行 ...
- 使用Dezender对zend加密后的php文件进行解密
在开发中需要修改一些php文件,部分是通过zend加密的,记事本打开之后是这样的: 此时需要使用Dezender进行解密,下载链接如下: Dezender.7z 下载后解压到C盘(路径不要带有中文), ...
- android 中文件加密 解密 算法实战
现在项目里面有一个需求,本项目里面下载的视频和文档都不允许通过其他的播放器播放,在培训机构里面这样的需求很多.防止有人交一份钱,把所有的课件就拷给了别人.这样的事情培训机构肯定是不愿意的.现在我项目里 ...
- 文件加密 解密 pdftk openssl gpg vim
openssl加密和解密 . openssl des -salt -in file -out file.des openssl des -d -salt -in file.des -out file ...
随机推荐
- 阿里云ECS封25端口导致wordpress无法发送邮件的解决
在有人评论你的文章,wordpress默认会尝试向博主发送邮件,而如果你用的是阿里云ECS,你会发现评论已经成功了,但是由于邮件发送失败会导致用户评论后页面就卡住了,原因就在于阿里云的ECS目前已经全 ...
- js 滚动条滑动
toTop() { let top = document.documentElement.scrollTop || document.body.scrollTop; // 实现滚动效果 const t ...
- vue 实例化使用模板
var vm = new Vue({ el:"", data:{ }, methods:{ } })
- 透过面试题掌握Redis【持续更新中】
本文已收录到1.1K Star的Github开源项目<面试指北>,想要了解更多内容,大家可以看一看这个项目,希望大家帮忙给一个star,谢谢了! <面试指北>项目地址:http ...
- react中路由不起作用的奇怪现象
同样的两段Router代码,为什么一段正常,一段不起作用(也没有任何错误log提示) 瞪着眼观察也看不出为什么... 通过选中高亮显示内容相同, 为何就是有一段路由不管用呢? 折腾半天发现... 大小 ...
- java类的方法的使用
类的方法:提供某种功能的实现: 实例:public void eat (){ } public String getName(){ } public void setName(String n){ ...
- pandas删除DataFrame中任意字段等于'null'字符串的行
删除df中任意字段等于'null'字符串的行: df=df.astype(str)#把df所有元素转为str类型 df=df[df['A'].isin(['null','NULL'])] #找出df的 ...
- Second Space could let suspect play two different roles easily
Have you guys heard about a pretty good feature called "Second Space"? Manufacturers like ...
- display有哪些值?说明他们的作用?
inline(默认)— 内联 none — 隐藏 block — 显示.块级元素(单独占一行) inline-block — 行内块元素(不占整行) table — 表格显示 list-item — ...
- HTML元素跟随鼠标一起移动,网页中回到顶部按钮的实现
对象跟随鼠标: 1.对象css设置绝对定位position: absolute; 2.获取鼠标坐标: 3.通过鼠标坐标计算出对象坐标位置,并设置为css定位的位置: document.onmousem ...