Skip to content

Lesson 8 of 13 · 18m

When the Target Isn't Native Code

.NET decompiles to near-source, PyInstaller to .pyc, and stripped Go keeps its function names — identify the runtime with file and Detect It Easy before picking a tool.

You crack open a "binary" and the normal rules stop applying: file says it's a .NET assembly, or the imports are a single mscoree.dll, or it's a 12 MB blob with build paths embedded, or a PyInstaller bundle that unpacks to bytecode. The wrong mental model is reaching for Ghidra because Ghidra is "the tool." Ghidra shines on native code — for managed and interpreted targets it's the wrong end of the telescope, and the correct tool hands you something far closer to source than any native decompiler ever will.

Identify the runtime before the tool

file gets you halfway; Detect It Easy (diec) gets you the rest — it fingerprints the compiler, packer, and framework from signatures, and it's what everyone actually runs first. After that, match the tool to the runtime:

  • .NET / Mono — ILSpy or dnSpyEx decompile the IL to near-source: real names, real types, real structure. Bytecode keeps almost everything. Obfuscated .NET uses ConfuserEx-style name mangling, but the IL is still faithful — you fight cosmetics, not mechanism. The edge case is NativeAOT, which compiles .NET straight to native code: ILSpy refuses the file and diec reports plain C++, so check for AOT before assuming a packer.
  • AutoIt and other script-compiled droppers — the EXE is an interpreter carrying a tokenized script; Exe2Aut or myAutToExe pull the script back out. Commodity droppers ship this shape constantly.
  • Java — the .class/.jar bytecode decompiles cleanly with JD-GUI, jadx, or Recaf. Names survive in the constant pool unless an obfuscator stripped them.
  • Python — PyInstaller bundles extract with pyinstxtractor; the .pyc bytecode inside decompiles with pycdc (Decompyle++) or pylingual. The "compiled binary" was a zip archive with an interpreter glued on.
  • Electron — app.asar is an archive of JavaScript. npx asar extract and you're reading the actual source the app shipped.
  • Go — native, but the binary carries its own metadata: go version -m ./binary prints the build info, and the pclntab keeps real function names even "stripped." Ghidra's Go analyzer and golang_loader_assist-style scripts recover them — a stripped Go binary is never anonymous.
  • Rust — native with mangled symbols, but panic messages embed src/main.rs paths and line numbers. The strings tell you which crate, which file, which line — the binary annotates itself.

Proof at incident scale

This is exactly how the fractureiser incident played out in June 2023. The Minecraft-mod malware was written in Java — which meant the defenders didn't reverse it so much as read it: bytecode decompiles to near-source, the infection stages and C2 flow were legible within days, and the writeup named classes and methods because the names were still there. If fractureiser had been written in C, that analysis would have taken weeks. The runtime chose the difficulty, not the defenders' skill.

The discipline that transfers

Everything else in this course still applies — anchor on strings, follow references, verify dynamically — but the tool changes shape:

  • For managed code, the "decompiler" is nearly perfect; your effort shifts to obfuscation: renamed symbols, string decryption loops, control-flow flattening (ConfuserEx's switch soup is the managed-world equivalent of a packed binary).
  • For interpreted bundles, the extraction step is the work — after pyinstxtractor and pycdc, you're triaging Python, not assembly.
  • For Go/Rust, the fight is volume, not opacity: huge statically-linked runtimes, real names buried under thousands of generated functions. Let the toolchain metadata (go version -m, panic strings, pclntab recovery) do the naming before you read a single instruction.

Field notes

  • Run file and diec before you pick a tool — thirty seconds decides whether the job is disassembly or de-obfuscation.
  • Managed malware is managed: .NET stealers and Java loaders decompile like any other .NET/Java. The analysis skill transfers; the tooling doesn't.
  • A "binary" that turns out to be a script bundle isn't a failed target — it's a faster one. Take the near-source win and move on.

Keep reading

Related articles from the SudoSecurity blog.