资源简介
采用adb开发工具从root后的手机上导出微信小程序源码包到计算机,使用本文件可解压缩小程序源码包,修改fname即可。
代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Fri Sep 14 00:00:07 2018
@author: Growing
“““
#!/usr/bin/python
# lrdcq
# usage python wxapkg_unpack.py filename unpack at filename.unpack
import sys os
import struct
class WxapkgFile:
nameLen = 0
name = ““
offset = 0
size = 0
def run(fname):
with open(fname “rb“) as f:
root = os.path.dirname(os.path.realpath(f.name))
name = os.path.basename(f.name)
# read header
firstMark = struct.unpack(‘B‘ f.read(1))[0]
print(‘first header mark = ‘ + str(firstMark))
info1 = struct.unpack(‘>L‘ f.read(4))[0]
print(‘info1 = ‘ + str(info1))
indexInfoLength = struct.unpack(‘>L‘ f.read(4))[0]
print(‘indexInfoLength = ‘ + str(indexInfoLength))
bodyInfoLength = struct.unpack(‘>L‘ f.read(4))[0]
print(‘bodyInfoLength = ‘ + str(bodyInfoLength))
lastMark = struct.unpack(‘B‘ f.read(1))[0]
print(‘last header mark = ‘ + str(lastMark))
if firstMark != 190 or lastMark != 237:
print(‘its not a wxapkg file!!!!!‘)
exit()
fileCount = struct
评论
共有 条评论