Skip to content

1 安装包分析

msojocs edited this page May 2, 2022 · 3 revisions

前言

本节将对开发工具的安装包进行解析,以分析移植的可行性。

下载地址

稳定版

拆包

一般exe会使用7z压缩,压缩管理器一般会自动识别压缩方式 解压后得到如下结构:

.
├── $PLUGINSDIR
├── bin
├── cli.bat
├── cli.js
├── code
├── credits.html
├── d3dcompiler_47.dll
├── dll
├── ffmpeg.dll
├── icudtl.dat
├── libEGL.dll
├── libGLESv2.dll
├── locales
├── node.dll
├── node.exe
├── notification_helper.exe
├── nw_100_percent.pak
├── nw_200_percent.pak
├── nw.dll
├── nw_elf.dll
├── resources.pak
├── swiftshader
├── v8_context_snapshot.bin
├── wechatdevtools.exe
├── wxfilewatcher.exe
├── wxfilewatcher_x64.exe
├── 卸载微信开发者工具.exe.nsis
└── 微信开发者工具.exe

分析结构

使用wine逐个打开exe文件

打开wechatdevtools.exe可以看到这是一个nw.js应用:

image

现在需要了解一下nwjs是否支持Linux

通过搜索引擎可以找到官网文档

在官网能够看到支持的平台,是支持Linux的,那么移植的可能性大大增加了

  1. Windows 64-bit
  2. Windows 32-bit
  3. Linux 64-bit
  4. Linux 32-bit
  5. Mac OS X 64-bit

现在需要了解一下nwjs的基本结构

在文档的Getting Started可以了解到基本的应用结构

.
├── 应用代码
└── package.json

查找解压后的文件夹可以找到类似结构,位于:code/package.nw,这就是应用的主要代码所在了。

其它文件

打开cli.bat

@echo off

set CALLING_DIR=%CD%

cd /d %~dp0

.\node.exe .\cli.js %*

cd "%CALLING_DIR%"

使用node执行cli.js并传入参数 这个用shell脚本与Linux的node实现,问题不大

结论

.
├── $PLUGINSDIR
├── bin                                  ------里面放着adb, 处理起来问题不大
├── cli.bat                              ------cli
├── cli.js
├── code                                 ------代码存放处
├── credits.html
├── d3dcompiler_47.dll
├── dll
├── ffmpeg.dll
├── icudtl.dat
├── libEGL.dll
├── libGLESv2.dll
├── locales
├── node.dll
├── node.exe                             -----nodejs
├── notification_helper.exe
├── nw_100_percent.pak
├── nw_200_percent.pak
├── nw.dll
├── nw_elf.dll
├── resources.pak
├── swiftshader
├── v8_context_snapshot.bin
├── wechatdevtools.exe                    ----nwjs
├── wxfilewatcher.exe
├── wxfilewatcher_x64.exe
├── 卸载微信开发者工具.exe.nsis
└── 微信开发者工具.exe                      -----启动器