packer-unpacking
하는 일
이 스킬은 프로그램 코드를 압축하거나 숨기는 흔한 패커를 탐지하는 방법과 그것을 푸는 방법을 설명합니다. 패킹된 프로그램을 읽어야 하는 리버스 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓분석가가 압축되었거나 숨겨진 것처럼 보이는 높은 엔트로피의 프로그램을 발견했을 때.
- ✓연구자가 파일에서 UPX나 VMProtect 같은 패커 섹션 이름을 볼 때.
- ✓분석가가 더 분석하기 전에 파일을 풀어야 할 때.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/packer-unpacking/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 프로그램은 패킹된 것 같아서 코드를 읽을 수 없습니다. 어떻게 풀 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 AI에게 엔트로피와 섹션 이름을 확인하고, 탐지 도구로 패커를 식별한 뒤, 맞는 언패커나 수동 방법을 쓰라고 지시합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Packer Unpacking Playbook
Packers compress and/or obfuscate binaries to defeat static analysis. The first job: identify which packer, then dispatch the right unpacker (or manual unpacking strategy if no automated tool exists).
1. Detect packing
# Entropy quick-check (>7.0 across the binary = likely packed)
ent /tmp/sample
# or
python3 -c "
import sys, math
d = open('/tmp/sample','rb').read()
f = [0]*256
for b in d: f[b] += 1
h = -sum((c/len(d))*math.log2(c/len(d)) for c in f if c)
print(f'entropy={h:.3f}')
"
# Section-level entropy via radare2
r2 -qc "iSj" /tmp/sample | jq '.[] | "\(.name): \(.entropy)"'
# Tool-based detection
detect-it-easy /tmp/sample # most reliable, GUI + CLI
diec /tmp/sample # CLI for DIE
yara -r /opt/yara-rules/packers/ /tmp/sample
Decepticon helper:
bin_packer("/tmp/sample")
2. Common packer signatures
| Packer | Signature |
|---|---|
| UPX | UPX! magic at section header, sections named UPX0, UPX1 |
| ASPack | .aspack section, jump after entry to packed code |
| Themida | .themida section, anti-debug, anti-VM heavy |
| VMProtect | .vmp0, .vmp1 sections; obfuscated EP w/ virtualized handlers |
| MPRESS | .MPRESS1, .MPRESS2 sections |
| PECompact | pec1 section, encrypted sections |
| Enigma | .enigma1, .enigma2 sections |
| Petite | small overlay, .petite section |
| FSG | tiny imports, packed sections |
| MEW | MEW magic in section name |
| Armadillo | runtime decryption, anti-debug (older) |
3. Automated unpacking
UPX (easy)
upx -d /tmp/sample -o /tmp/unpacked
file /tmp/unpacked
If upx -d fails with "not packed by UPX", the version field has been
tampered with (anti-unpack trick). Fix:
# Patch the version byte back
python3 -c "
d = bytearray(open('/tmp/sample','rb').read())
# Find UPX! magic, fix version
import re
for m in re.finditer(b'UPX!', d):
d[m.end()] = 0x0d # set version field
open('/tmp/patched','wb').write(d)
"
upx -d /tmp/patched -o /tmp/unpacked
ASPack
unaspack /tmp/sample # or use ASPackDie / ASPack Stripper
Manual: ASPack's OEP jump is JMP <reg> at the end of unpack stub.
Set breakpoint there in x64dbg, dump from Scylla (PE only).
MPRESS
quickunpack /tmp/sample
# Or load in x64dbg, set BP on tail jump (E9 to OEP), dump w/ Scylla
PECompact / FSG
Use unpacme (uploads to UnpacMe service if engagement permits cloud
processing), or run in monitored sandbox + memory-dump strategy.
4. Manual unpacking strategy (Themida / VMProtect / Enigma)
These are commercial-grade and don't have reliable auto-unpackers. Approach:
Themida
- Static: identify anti-debug checks, patch them or rewrite
- Dynamic: x64dbg +
ScyllaHideplugin → bypass anti-debug - Set hardware breakpoint on
VirtualProtect(Themida unpacks via this) - When hit, walk back to find decrypted code regions
- Dump w/
Scyllaafter OEP is reached - Themida often has multiple layers — repeat per layer
VMProtect
VMProtect translates code into bytecode for a custom VM. No simple "unpack" — you must either:
- Devirtualize (extract VM handlers + write a translator). Tools:
VTIL(Vladimir's tools),vmpfix, manual w/ IDA + bytecode trace - Trace + symbolic execute via
Tritonorangr - Skip RE and treat as black-box (fuzz the interfaces)
Enigma Protector
Similar to Themida. ScyllaHide handles many checks. The license / virt machine layer is hardest. Some Enigma variants:
- v3-v5: scriptable unpack via
Enigma Static Unpacker - v6+: manual w/ x64dbg + Scylla, multiple decryption passes
5. Manual unpack technique (universal)
For any packer:
- Disable ASLR / DEP if needed (ScyllaHide /
setdllchar) - Set BP on entry point
- Step through unpack stub; watch for:
- Large
VirtualAlloc(decryption region) memsetfollowed by decrypted code being written- Tail jump to OEP (often
JMP <reg>orRETafter PUSHAD/POPAD)
- Large
- At suspected OEP, dump process w/
Scylla(PE) orr2 -d - Fix imports (Scylla auto-rebuild IAT), save dumped PE
- Re-run static analysis on the dumped file
6. Anti-anti-unpacking tricks
| Anti-unpack | Counter |
|---|---|
IsDebuggerPresent |
ScyllaHide, or patch w/ NOP |
NtQueryInformationProcess(ProcessDebugPort) |
ScyllaHide |
Timing checks (rdtsc measure) |
x64dbg "timing" plugin or patch |
| INT3 detection (BP byte scan) | hardware BPs only |
| Self-checksum | identify check l |
자주 묻는 질문
패커란 무엇인가요?
프로그램의 코드를 압축하거나 숨겨서 읽기 어렵게 만드는 도구입니다.
어떤 패커를 다루나요?
UPX, ASPack, Themida, VMProtect, MPRESS, PECompact, Enigma를 다룹니다.
언패킹은 항상 되나요?
아닙니다. 일부 프로텍터는 수동 언패킹이 필요하며, 이 스킬은 이를 대체 방법으로 설명합니다.
상세 정보
작성자의 원본 설명
Identify and unpack common binary packers — UPX, ASPack, Themida, VMProtect, MPRESS, PECompact, Enigma.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14172
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.