1 preparing Tools
1 Node. js running environment
Download it at nodejs.org/en/
2 Decompiled scripts
Link: pan.baidu.com/s/1InxRoozD… Extraction code: I50K
3 Night God simulator
Download address: www.yeshen.com/cn/download…
Start decompilation
1. Obtain small program PKG package:
Log in to wechat in the simulator and randomly open A small program A
Open the file manager, find/data/data/com. Tencent. The mm/MicroMsg directory, and then find a long
User random code, continue to find /appbrand/ PKG/XXX, next will appear small program A wxapkg package (right-click and select Copy) Find the Android share pathThe paste button is always on top and copies the applet PKG package to the Android shared path so you can access the applet PKG package from your computer2 Install script dependency use CMD CD to the script directory you just downloaded, executenpm install
Install dependencies
3 Run the script command to copy the path of the PKG
node wuWxapkg.js C:\Users\pc-03\Nox_share\ImageShare\xx.wxapkg
C:\Users\pc-03\Nox_share\ImageShare\xx.wxapkg is my applet path, you need to copy your own applet pathCopy the code
3 Successful Compilation
1, Module build failed: Error: Cannot find Module ‘escodeGen’ NPM I –save-dev escodegen 2, Error: Cannot find module ‘cheerio’ NPM install ugliffe -es –save NPM install esprima –save NPM install CSS-tree –save npm install cssbeautify –save npm install vm2 –save npm install uglify-es –save npm install js-beautify –save npm Install escodeGen –save NPM install cheerio –save 3 undetected packages. Wxapkg file: the decomcompiled package is not the project folder, go to the RE file manager to check whether there is another file. This. Wxapkg is the basic package of wechat, there is no need to restore!! A lot of blogs don’t explain this, so I thought it wasn’t decompiled!
4 SyntaxError: Unexpected end of input solve WXSS missing problem
function runVM(name,code){ let wxAppCode={},handle={cssFile:name}; let gg = new GwxCfg(); let tsandbox = {$gwx:GwxCfg.prototype["$gwx"],__mainPageFrameReady__:GwxCfg.prototype["$gwx"],__wxAppCode__:wxAppCode,setCssToHead:cssR ebuild.bind(handle)}; let vm = new VM({sandbox:tsandbox}); vm.run(code); for(let name in wxAppCode)if(name.endsWith(".wxss")){ handle.cssFile=path.resolve(frameName,".." ,name); wxAppCode[name](); } /* let wxAppCode={},handle={cssFile:name}; let vm=new VM({sandbox:Object.assign(new GwxCfg(),{__wxAppCode__:wxAppCode,setCssToHead:cssRebuild.bind(handle)})}); vm.run(code); for(let name in wxAppCode)if(name.endsWith(".wxss")){ handle.cssFile=path.resolve(frameName,".." ,name); wxAppCode[name](); * /}}Copy the code
Decompile the applet again,OK, WXSS comes out
If you have a problem can add my qq392716797 decompile to help you get small program source code