# -*- 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 解密.的更多相关文章

  1. Code笔记之:对使用zend加密后的php文件进行解密

    对使用zend加密后的php文件进行解密 使用zend加密后的php文件用notpad++打开会出现类似的乱码 下面使用解密工具进行解密 http://pan.baidu.com/s/1i3n4ysX ...

  2. linux环境下给文件加密/解密的方法

      原文地址:linix环境下给文件加密/解密的方法 作者:oracunix 一. 利用 vim/vi 加密:优点:加密后,如果不知道密码,就看不到明文,包括root用户也看不了:缺点:很明显让别人知 ...

  3. ref:使用Dezender对zend加密后的php文件进行解密

    ref:http://www.cnblogs.com/88223100/ 使用Dezender对zend加密后的php文件进行解密   在开发中需要修改一些php文件,部分是通过zend加密的,记事本 ...

  4. linux 使用vim文件加密/解密的方法

    一. 利用 vim/vi 加密:优点:加密后,如果不知道密码,就看不到明文,包括root用户也看不了:缺点:很明显让别人知道加密了,容易让别人把加密的文件破坏掉,包括内容破坏和删除: vi编辑器相信大 ...

  5. L脚本语言实现文件加解密

    L脚本语言中能够对内存对象进行AES加解密.我们能够非常easy地实现文件加解密 #scp #定义一个秘钥字符串 定义:字符串,str1,abcdefg 打开:文件,file1,c:\1.txt 打开 ...

  6. Spring boot RSA 文件加密解密

    github项目地址 rsa_demo ##测试 加密D:/hello/test.pdf 文件,生成加密后的文件 testNeedDecode.pdf 对testNeedDecode.pdf 文件进行 ...

  7. 使用Dezender对zend加密后的php文件进行解密

    在开发中需要修改一些php文件,部分是通过zend加密的,记事本打开之后是这样的: 此时需要使用Dezender进行解密,下载链接如下: Dezender.7z 下载后解压到C盘(路径不要带有中文), ...

  8. android 中文件加密 解密 算法实战

    现在项目里面有一个需求,本项目里面下载的视频和文档都不允许通过其他的播放器播放,在培训机构里面这样的需求很多.防止有人交一份钱,把所有的课件就拷给了别人.这样的事情培训机构肯定是不愿意的.现在我项目里 ...

  9. 文件加密 解密 pdftk openssl gpg vim

    openssl加密和解密 . openssl des -salt -in file -out file.des openssl des -d -salt -in file.des -out file ...

随机推荐

  1. 手机端页面访问PC页面自动跳手机端代码

    <script> var mobileAgent = new Array("iphone", "ipod", "ipad", & ...

  2. Kubernetes 基础资料

    概述 这篇文章用来记录Kubernetes 的基础资料,整体以最新官方文档为准. 因为k8s整体比较偏运维,作为研发可先大致了解其概念及初级使用方式,后面重点学习点会放在service mesh is ...

  3. C#中的out关键字

    在一个方法里面使用out关键字的时候这个方法中作为out关键字之后的参数会被返回出去:调用这个方法的时候需要先有一个变量来承接这个传递出来.已经被该方法改动过的参数,并且要记得传实参的时候前面带上ou ...

  4. 创建并加入节点&练习

    1.节点的属性 节点的属性:所有节点都有的属性 元素节点,   属性节点,   文本节点 nodeType            只  读  属  性 nodeName       返回对应节点的名字 ...

  5. GitHub+jsDelivr+PicGo 打造稳定快速、高效免费图床

    标题: GitHub+jsDelivr+PicGo 打造稳定快速.高效免费图床 作者: 梦幻之心星 347369787@QQ.com 标签: [GitHub, 图床] 目录: 图床 日期: 2019- ...

  6. string 去重复

    //AABB>>AB         //AAA>>A         //ABBAA>ABA public static string SpiltString(stri ...

  7. jchdl - RTL Event

    https://mp.weixin.qq.com/s/P9uoJwIYdM-mbiR9WCtJCg   hardware modeling基于事件驱动模型,RTL中定义了多种事件. jchdl 参考了 ...

  8. LeetCode 73,为什么第一反应想到的解法很有可能是个坑?

    本文始发于个人公众号:TechFlow,原创不易,求个关注 今天是LeetCode第42篇文章,我们来看看LeetCode第73题矩阵置零,set matrix zeroes. 这题的难度是Mediu ...

  9. Java实现 LeetCode 828 统计子串中的唯一字符(暴力+转数组)

    828. 统计子串中的唯一字符 我们定义了一个函数 countUniqueChars(s) 来统计字符串 s 中的唯一字符,并返回唯一字符的个数. 例如:s = "LEETCODE" ...

  10. java中Runtime类详细介绍

    Runtime类描述了虚拟机一些信息.该类采用了单例设计模式,可以通过静态方法 getRuntime()获取Runtime类实例.下面演示了获取虚拟机的内存信息: package Main; publ ...