API Reference: Packed Malware and UPX Analysis
UPX - Ultimate Packer for eXecutables
Syntax
Output Format
pefile - Python PE Analysis
Usage
Packing Indicators
| Indicator |
Threshold |
| Section entropy |
> 7.0 (high, likely packed/encrypted) |
| Import count |
< 10 (few imports suggest packing) |
| Virtual/Raw ratio |
> 5x (large in-memory expansion) |
| Section names |
UPX0, UPX1, .packed, .nsp |
Detect It Easy (DIE) - Packer Identification
Syntax
Output
PEiD - Packer Identification (Legacy)
Packer Signatures Database
| Packer |
Section Names |
Magic Bytes |
| UPX |
UPX0, UPX1, UPX2 |
UPX! at end of file |
| ASPack |
.aspack, .adata |
N/A |
| PECompact |
.pec1, .pec2 |
N/A |
| Themida |
Various |
Encrypted sections |
| VMProtect |
.vmp0, .vmp1 |
Virtualized code |
PEStudio - Static PE Analysis
Key Indicators
| Check |
Description |
| Entropy |
Section-level entropy analysis |
| Imports |
API import analysis |
| Strings |
Embedded string extraction |
| Signatures |
Packer/compiler identification |
| Virustotal |
Hash-based lookup |
x64dbg / x32dbg - Dynamic Unpacking
Generic Unpacking Steps
Key API Breakpoints
| API |
Purpose |
VirtualAlloc |
Memory allocation for unpacked code |
VirtualProtect |
Change memory protection (RWX) |
LoadLibraryA |
Load DLLs for import resolution |
GetProcAddress |
Resolve API addresses |
NtWriteVirtualMemory |
Write unpacked code to memory |
Entropy Interpretation
| Range |
Interpretation |
| 0-1 |
Nearly empty/uniform data |
| 1-5 |
Normal code/data |
| 5-7 |
Compressed or obfuscated |
| 7-8 |
Encrypted or packed (maximum ~8.0) |