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 ...
随机推荐
- 利用pandas进行数据子集的获取
- LeetCode DFS搜索与回溯专题
DFS + 回溯专题 17. 电话号码的字母组合 迭代也可以实现搜索 循环改写dfs搜索的写法: 例如 C++写法 class Solution { public: vector<string& ...
- Spring基础之IOC
一.ioc能解决什么问题 1.Spring是什么 spring是以ioc和aop为核心,能整合第三方框架和类库的企业级应用开源框架. 2.程序的耦合问题 例子:Driver类必须存在,编译才通过,Jd ...
- Win10企业版远程桌面结合frp实现公网远程
Win10企业版远程桌面结合frp实现公网远程 前言 由于经常下班后还要处理问题,但是又没有运维那么频繁,就不想天天背着电脑来回跑,刚开始用的teamviewer,后来被商业劝退了(就是不让用了,让买 ...
- 一个基类Person的多个派生类 代码参考
#include <iostream> #include <cstring> using namespace std; class Person { protected: ch ...
- Rocket - debug - SBA
https://mp.weixin.qq.com/s/eFOHrEhvq2PlEJ14j2vlhg 简单介绍SBA的实现. 1. SystemBusAccessState 系统总线访问状态: 分别是: ...
- jchdl - GSL值的传播
https://mp.weixin.qq.com/s/jgMljoca-Cwe9x0NaTLzZg GSL的拓扑模型是线和节点连接的模型,值的传播,即是值在线和节点之间传播和转化的过程. 值的 ...
- brpc长连接问题
问题: 使用了brpc的长连接,但是为何耗时和短链接一样呢? brpc文档里介绍,使用http协议,则默认使用pooled,只要连接数不超过max_connection_pool_size,则都可以使 ...
- Java实现 LeetCode 93 复原IP地址
93. 复原IP地址 给定一个只包含数字的字符串,复原它并返回所有可能的 IP 地址格式. 示例: 输入: "25525511135" 输出: ["255.255.11. ...
- Java实现 LeetCode 6 Z字形变换
6. Z 字形变换 将一个给定字符串根据给定的行数,以从上往下.从左到右进行 Z 字形排列. 比如输入字符串为 "LEETCODEISHIRING" 行数为 3 时,排列如下: L ...