Packed programs and UPX
What packing is
Section titled “What packing is”A packer compresses or scrambles a program and puts a small routine in front that restores it when the program runs. On disk, the real code is unreadable. Legitimate software is packed to save space; malware is packed to hide.
How Karak Studio tells you
Section titled “How Karak Studio tells you”The yellow banner says “This file looks packed or protected” and gives its reasons. It looks for:
- code that is almost pure noise,
- a section that is empty in the file but reserved as writable code, which is where unpacked code would be written,
- a section name used by a known packer (
UPX,.aspack,.themida,.vmp,.enigma,.mpress,.petite), - the program starting inside an unusual section,
- almost no imports except the functions for loading code by hand.
One strong sign is enough. The weaker signs only count when two appear together.
Debug builds are not packed. Visual Studio’s Debug builds have a section called .textbss that is also empty and reserved as writable code: it is room for “Edit and Continue”, which patches code while you debug. Karak Studio knows this and does not count it as a packer. Instead the first line of the overview says Debug build (Visual Studio). It also says so when the program borrows from the debug version of Microsoft’s C runtime (ucrtbased.dll, VCRUNTIME140D.dll). Many beginner crackmes are Debug builds, which is good news: the code is barely optimised and easy to read. Calls often go through a short “jump table” of jmp instructions first (the incremental linking table); follow the jmp to reach the real function.
UPX is unpacked automatically
Section titled “UPX is unpacked automatically”UPX is the most common packer. When you open a UPX-packed file, Karak Studio unpacks it in memory, without running it, and shows you the original program. The banner tells you:
- that the file was packed with UPX and which compression method it used,
- whether UPX’s own checksum confirmed the result. If it did, the unpacked code is exact.
What is restored: all code and data, the function list, imports, and the addresses the program refers to.
What is not restored: icons and other resources, and the export list of a DLL.
If the banner says the file is packed with UPX but could not be unpacked, the compressed data was damaged or deliberately altered. You see the packed file as it is.
Malware authors sometimes erase the UPX! marker to stop tools from recognising the file. Karak Studio needs that marker, so such files are shown packed, with the general “looks packed” warning.
Other packers
Section titled “Other packers”They are detected and not undone. The usual method is to run the sample under a debugger inside a virtual machine, let it unpack itself, save the unpacked program from memory, and open that saved file in Karak Studio.