Logotipo de Unpacking Protected Binaries

Unpacking Protected Binaries

Comunidad
trilwu
unpacking-protected-binaries

Desempaqueta y vuelca ejecutables protegidos —UPX y empaquetadores comerciales, crypters personalizados, protectores comerciales como Themida y VMProtect, y empaquetadores de .NET— localizando el punto de entrada original, volcando el contenido desde la memoria y reconstruyendo la tabla de importaciones con Scylla, pe-sieve o x64dbg. Úsala cuando un binario tenga una entropía elevada, pocas importaciones, secciones sin nombre o cuando las herramientas de análisis apenas muestren código.

Add to TypingMind

Descripción general

Editortrilwu
Repositoriosecskills
Nombre de la habilidadunpacking-protected-binaries
Estrellas
144
Forks
15
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por trilwu en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Unpacking Protected Binaries en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/trilwu/secskills/tree/main/secskills-core/skills/unpacking-protected-binaries
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/trilwu/secskills.git /tmp/secskills
mkdir -p .claude/skills
cp -r /tmp/secskills/secskills-core/skills/unpacking-protected-binaries .claude/skills/unpacking-protected-binaries
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Unpacking Protected Binaries en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Unpacking Protected Binaries automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Unpacking Protected Binaries no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Unpacking Protected Binaries

Static unpacking is a trap for anything beyond UPX. The reliable method is to let the program unpack itself, then take the result out of memory. Almost every protector, however sophisticated, must eventually produce executable code in a readable page — that moment is what you are waiting for.

Run protected samples only in a contained environment; see analyzing-malware.

When to Use

  • binwalk -E shows uniformly high entropy across most of the file
  • The import table has a handful of entries (LoadLibrary, GetProcAddress)
  • Section names are absent, random, or UPX0/.themida/.vmp0
  • Disassembly shows a small stub and one large data blob
  • A tool reports the file is packed, or analysis finds essentially no code

When NOT to Use

  • The wider malware workflow — use analyzing-malware for containment, triage, and IOC output; come back here for the unpacking step
  • .NET assemblies — use analyzing-dotnet-assemblies, which covers .NET packers and managed memory dumping specifically
  • Obfuscation without packing (readable imports, normal entropy, confusing control flow) — use analyzing-binaries
  • Firmware images — binwalk -Me extraction is a different job; see analyzing-binaries

Identify the Protector First

The response differs enormously between a commodity packer and a commercial protector, so spend a minute here.

bash
diec target.exe                     # Detect It Easy — the best single identifier
rg -a -o 'UPX|MPRESS|Themida|VMProtect|ASPack|Enigma|Obsidium|PECompact' target.exe
binwalk -E target.exe               # entropy profile
bash
# Structural tells
readpe target.exe                   # or: rabin2 -S target.exe
#   raw size ≈ 0 with large virtual size   → section unpacked at runtime
#   section marked writable AND executable → self-modifying
#   entry point outside the first section  → stub in a later section
#   TLS callbacks present                  → code runs BEFORE the entry point

TLS callbacks matter. They execute before the entry point, so a debugger set to break at the EP has already run the protector's anti-debug checks. Set the debugger to break on TLS callbacks, not on the entry point.

Identified asApproach
UPX (unmodified)upx -d — takes seconds
UPX (modified header)Repair the magic, or unpack dynamically
Commodity crypter, custom stubDynamic dump at OEP
Themida, VMProtect, EnigmaDump plus heavy import repair; expect virtualized functions to stay virtualized
.NET packeranalyzing-dotnet-assemblies
bash
upx -d target.exe -o unpacked.exe          # try first, costs nothing

The Dynamic Unpacking Loop

1. Break before the stub runs (TLS callbacks, or the EP if none)
2. Run until the unpacked code exists in memory
3. Find the OEP — the original entry point of the real program
4. Dump the process image
5. Rebuild the import table
6. Fix the PE headers and verify the dump loads

Finding the OEP is the part that takes judgment. Reliable signals:

  • Memory write-then-execute. Set a hardware breakpoint on execute over the section the stub is writing into. The first execution there is usually at or near the OEP. In x64dbg this is a page guard on the target section.
  • The tail jump. Packer stubs end with a jump far outside the stub's own section. Step to the end of the stub and watch for the long jump.
  • Compiler entry signature. Real entry points look like a compiler's CRT startup — security_init_cookie, a call to __scrt_common_main, or a standard prologue. When execution lands somewhere that looks like normal compiled code rather than obfuscated stub code, you have arrived.
  • GetCommandLine / GetModuleHandle calls early in the real program.
x64dbg workflow:
  Options → Events → break on TLS callbacks and on system breakpoint
  Run, then in the Memory Map set "Break on execute" for the target section
  When it breaks, confirm the code looks compiler-generated → that is the OEP

Dumping and Import Repair

bash
# Dump from the debugger at OEP: Scylla (built into x64dbg)
#   1. Attach / already broken at OEP
#   2. Scylla → set OEP → IAT Autosearch → Get Imports
#   3. Fix invalid/unresolved entries, then Dump + Fix Dump

# Or dump externally
pe-sieve /pid <pid> /dmode 3        # dumps and repairs; good for automation
# hollows_hunter for scanning a whole system for unpacked/injected modules

Import repair is where most dumps fail. Packers replace the import table with a runtime-resolved stub, so a raw dump has API calls pointing into the packer's own thunk area. Scylla's IAT search finds the resolved table; when it returns unresolved entries, that usually means:

  • The dump was taken before the imports were fully resolved — run further
  • The protector uses API redirection, where each call goes through an obfuscated stub that computes the real address — these need manual resolution or an emulation-based unstubber
  • The API is resolved lazily on first call — trigger the functionality, then dump

Verify the dump before analyzing it:

bash
readpe dumped.exe | head -30          # sane headers, correct EP
rabin2 -i dumped.exe | head -20       # imports resolve to real API names
# The strongest test: does it run, or does a decompiler produce sane output?

Commercial Protectors

Themida, VMProtect, Enigma, and similar do more than pack. Expect:

  • Virtualized functions. Selected functions are converted to bytecode for a custom VM. Dumping recovers the program around them, but the virtualized functions remain a VM interpreter loop. Devirtualization is a research-scale effort per protector version.
  • Aggressive anti-debug and anti-VM. Handle detection first — ScyllaHide, TitanHide, or a hypervisor-level debugger — or the process will exit or corrupt itself before you reach OEP.
  • Multiple unpacking stages with re-encryption of earlier stages.

The practical decision: if only a few functions are virtualized, dump and analyze everything else, then handle those functions dynamically — hook their inputs and outputs rather than reading their logic. That answers "what does it do" without defeating the VM.

When Dumping Is Not Available

Some samples never fully unpack in one place: they decrypt individual functions on demand and re-encrypt after use, or they run entirely from a JIT-style buffer.

  • Trace-based recovery. Record execution with an instrumentation framework and reconstruct the executed code path from the trace.
  • Hook the decryption routine and log every plaintext block as it is produced — you get the code piecemeal but complete.
  • Frida/Pin/DynamoRIO for the instrumentation.

Rationalizations to Reject

  • "upx -d failed, so it isn't UPX." Modified UPX headers are the most common commodity evasion. Check the section names and stub pattern.
  • "I'll write a static unpacker." Worth it for one family you will see a thousand times. Otherwise dumping is an order of magnitude cheaper.
  • "The dump won't run, so it's wrong." Verify what you actually need. Many dumps are unrunnable but perfectly analyzable.
  • "Imports are broken, dump is useless." Re-dump later in execution, or resolve manually. Timing is usually the issue.
  • "It's VMProtect, so it's impossible." Only the virtualized functions are. Dump everything else and treat those as black boxes with observable I/O.
  • "I'll set a breakpoint on the entry point." TLS callbacks already ran.
  • "Nothing happened when I ran it." Anti-VM or anti-debug fired. Handle detection before unpacking.

References

  • analyzing-malware — containment, capability model, IOCs; the workflow this fits into
  • analyzing-binaries — post-unpacking analysis and anti-analysis handling
  • analyzing-dotnet-assemblies — .NET packers and managed dumping
  • Detect It Easy, x64dbg + Scylla + ScyllaHide, pe-sieve, hollows_hunter, UPX

Preguntas frecuentes

¿Qué hace la habilidad de IA Unpacking Protected Binaries?

Desempaqueta y vuelca ejecutables protegidos —UPX y empaquetadores comerciales, crypters personalizados, protectores comerciales como Themida y VMProtect, y empaquetadores de .NET— localizando el punto de entrada original, volcando el contenido desde la memoria y reconstruyendo la tabla de importaciones con Scylla, pe-sieve o x64dbg. Úsala cuando un binario tenga una entropía elevada, pocas importaciones, secciones sin nombre o cuando las herramientas de análisis apenas muestren código.

¿Por qué usar Unpacking Protected Binaries en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Unpacking Protected Binaries está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Unpacking Protected Binaries en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/trilwu/secskills/tree/main/secskills-core/skills/unpacking-protected-binaries. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Unpacking Protected Binaries?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Unpacking Protected Binaries?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Unpacking Protected Binaries con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Unpacking Protected Binaries?

Sí. trilwu la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇