Re python

From dslsdzc/rev-skills · View interactive version

Re python is an AI agent skill from the GitHub repository dslsdzc/rev-skills. Python 打包/混淆样本分析:PyInstaller/PyArmor/Nuitka/Cython 解包、pyc 版本识别与反编译。 触发词:Python打包、PyInstaller、PyArmor、pyc、python exe、Python 样本、打包样本。

How to use this skill

Skill file

Python 打包样本分析(PyInstaller / PyArmor / pyc)

何时使用 / 何时不用

工具准备

参考 [[re-analyze/platform-tips]]——解包/反编译为静态步骤,免沙箱;动态取明文([[re-sandbox]])按最高原则进沙箱。

python3(基础运行时,必备)

pyinstxtractor(PyInstaller 归档提取)

PyArmor-Unpacker(PyArmor 加固解包)

pycdc / pycdas(pyc 反编译)

file(打包器识别辅助,通用)

操作步骤

按顺序执行,每步产物存档(路径 + sha256,见 [[re-triage]])。

  1. 识别打包器:

```sh

file sample.exe

strings sample.exe | grep -iE 'PyInstaller|_MEIPASS|pyi-|PyArmor|pyarmor' | head

```

  1. PyInstaller 解包:

```sh

python pyinstxtractor.py sample.exe

# 输出 sample.exe_extracted/ 目录,含 PYZ-00.pyz(依赖归档)与主脚本 .pyc

```

  1. PyArmor 解包(步骤 1 检测到 PyArmor 时):
  1. pyc 版本识别:

```sh

python3 -c "import struct,sys; print(struct.unpack('<H', open('main.pyc','rb').read(2))[0])"

```

  1. 反编译与清理:

```sh

pycdc main.pyc > main_decompiled.py # 或匹配版本 python 的 dis 模块

```

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.