python-reverser-patterns
Reverse binaries and Python artifacts with Python: parse ELF/PE, disassemble with pwntools/capstone, instrument with Frida, recover .pyc and PyInstaller payloads. Use when analyzing malware, packed Python, stripped binaries, or runtime hooks — not for CPython language style (python-patterns).
v2026.11.13-21cd5683 instalaciones+3 en 7 días39 EstrellasMITsincronizado hace 11 horas
Instalar
¿Aún no tienes la CLI de NotHoly? Instálala primero.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install aeondave/python-reverser-patternsEscribe en ~/.notholy/skills después de comprobar la firma y el SHA-256.
FirmaFirmado, ed25519
Paquete0dee733e…9c0b4dda
0dee733e054c…1cbe9c0b4dda8 archivos · 11.7 KBEscaneoBajo1 hallazgo
- Enlaces a dominios externos
Fuentegithub.com/AeonDave/malskill/tree/main/coding/python-reverser-patterns@21cd568
Esta entrada todavía no está escrita en tu idioma, así que aparece en English.
En esta página
Hands-on reversing with Python: ELF/PE parsing, strings/imports/entropy, disassembly, Frida, and Python bytecode (.pyc / PyInstaller). Language idioms belong in python-patterns.
When to activate
- Mapping why an ELF/PE fails, what malware does, or how a stripped binary is laid out.
- Extracting strings, imports, entropy regions, entrypoints, section flags.
- Instrumenting runtime with Frida (host Python, hooks in GumJS).
- Recovering logic from
.pyc,__pycache__, or a PyInstaller/py2exe-style bundle. - Diffing two binary versions (hardening, packing, payload change).
Core principles
- Triage before disassembly: strings, imports, entropy, then hotspots.
- Match interpreter to bytecode:
marshal/disonly on the same CPython version as the.pyc; otherwisexdis/pydisasm. - Do not execute recovered code on the analysis host;
disis read-only,execis not. - Frida injects GumJS, not Python. Host API:
attach/spawn/create_script. - Entropy flags packing: high-entropy blobs are compressed/encrypted until proven otherwise.
Outcome expectations
- File type, arch, and layout (sections, entry, imports) are known.
- Suspicious APIs and high-entropy regions are listed with offsets.
.pycpayloads are disassembled with a version-matched tool; decompile is opportunistic.- Frida hooks attach (or spawn) without using removed Frida 16 static
Module.*APIs.
Recommended workflow
- Triage: ELF / PE / Mach-O /
.pyc/ PyInstaller overlay. Packed Python →references/pyc-bytecode.mdfirst. - Headers: parse ELF/PE (or LIEF when you will rewrite). Load
references/binary-formats.md. - Sections / imports / strings / entropy:
references/static-analysis.md,references/pwntools-reference.md. - Disassemble hotspots:
references/capstone.md(Capstone) orELF.disasm(returns a string). - Runtime: Frida when static is insufficient —
references/frida-basics.md. Spawn if the interesting path is before a stable attach. - Custom scripts: IAT dump, entropy map, section diff —
references/custom-tooling.md.
Pyarmor, custom opcode maps, and Nuitka-as-native: keep the Python-API path here; load reversing-technique languages.md for those packer-specific recoveries.
Quick review checklist
- Magic/arch parsed; file offsets vs VAs are not mixed.
- Imports enumerated; ordinal-only PE imports are not assumed to have names.
- Strings and entropy scanned before wide disassembly.
.pycmagic matches the interpreter (orpydisasmwas used).- Frida scripts use
Process.getModuleByName/Module.getGlobalExportByName(Frida 17+).
Anti-patterns
- Blind Capstone over the whole file (alignment, data-in-code, packing).
marshal.loadsof a.pycincluding the 16-byte header, or on the wrong Python version.- Treating
uncompyle6as valid past 3.8, orpycdcas guaranteed on 3.13–3.14. Module.findExportByName/ staticModule.getExportByName(removed in Frida 17).Interceptor.replacewithonEnter/onLeave(that isattach; replace takes aNativeCallback).
Resources
Load on demand:
references/binary-formats.md— load when parsing or patching ELF/PE/Mach-O headers and sectionsreferences/pwntools-reference.md— load when usingELF,search,read,disasm,context.binaryreferences/static-analysis.md— load for strings, imports, entropy, suspicious APIsreferences/capstone.md— load when decoding instructions or scanning gadgetsreferences/frida-basics.md— load when attaching/spawning and hooking (Frida 17+ JS API)references/pyc-bytecode.md— load for.pyc,marshal/dis, xdis, PyInstaller unpackreferences/custom-tooling.md— load when writing a reusable IAT/entropy/diff script
Archivos de esta versión
references/727.1 KB
- binary-formats.md4.1 KB
- capstone.md3.5 KB
- custom-tooling.md5.5 KB
- frida-basics.md3.0 KB
- pwntools-reference.md3.2 KB
- pyc-bytecode.md3.6 KB
- static-analysis.md4.3 KB
- SKILL.md4.4 KB
Permisos
| Permiso | Declarado | Hallado en el escaneo |
|---|---|---|
| Lee archivos | Sí | Sí |
| Escribe archivos | Sí | Sí |
| Ejecuta comandos de shell | Sí | Sí |
| Usa la red | Sí | Sí |
| Usa conectores | No | No |
| Controla un navegador | No | No |
Hallazgos del escaneo
Revisado el 13 nov 2026
- InfoEnlace · Enlaces a dominios externos
Un escaneo limpio baja el riesgo, pero no prueba que el paquete sea seguro. Lee lo que instalas.
| Versión | Publicada | Commit | SHA-256 | Firma | Cambio de permisos |
|---|---|---|---|---|---|
| v2026.11.13-21cd568 | 13 nov 2026 | 21cd568 | 0dee733e | Firmada | – |
Más de AeonDave
Todo de este publicadorMás en Ingeniería inversa y fuzzing
Ver la categoríaPregunta todo lo que tu alcance permite.
Crea la cuenta, añade créditos y haz la primera pregunta en el chat o en la terminal.
- 1/3
Crea la cuenta
Individual o empresa. Puedes pasar a empresa después sin perder saldo ni claves.
IndividualEmpresa - 2/3
Añade créditos
Con tarjeta. Pagas por token, sin suscripción.
$5.00recarga mínima - 3/3
Pregunta
En el chat, o instala el CLI y ejecuta notholy login en tu terminal.
$ notholy login