[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 | |
|---|---|
| Ghidra | Free, from the NSA, and excellent. Full disassembler + decompiler, multi-architecture. The default recommendation — start here |
| IDA Pro | The long-time industry standard. Superb, expensive; a free version exists with limits |
| Binary Ninja | Modern, cheaper than IDA, great API and intermediate language |
| radare2 / Cutter | Free, powerful, steep curve; Cutter is its GUI |
| dnSpy / ILSpy | For .NET — recovers near-original C#. Reversing managed code is easy → C# |
| jadx | For Android — DEX to readable Java |
| PEStudio / CFF Explorer | PE 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:
- Identify and hash-check —
file,sha256, VirusTotal lookup - Strings and imports — form a hypothesis before reading code
- Load into Ghidra, let it auto-analyse
- Start from the interesting anchors —
main, or better, cross-references to an interesting import or string. “Who callsCreateRemoteThread?” jumps you straight to the injection code - Follow the thread, renaming as you go —
FUN_00401260→check_debugger,DAT_00403010→c2_domain. The renamed, annotated database is the deliverable - 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.
Related
- dynamic analysis — for what static can’t see
- evasion and anti-analysis — packing, the main wall
- assembly — reading the disassembly
- the exploitation toolkit — Ghidra appears there too
Source: [reference] — Aug 2026. Analyse samples only in a safe, authorised setting.
Software engineering
Infrastructure & security
Computer science
Hardware & engineering