Visual Basic produced three binary formats in thirty years, and each one decides what decompilation can give back. This is not a historian's footnote: it is the reason reading a .NET assembly is free and rebuilding a VB6 executable is not.
P-Code, the only format for six years
The first versions of Visual Basic did not compile in the usual sense. They translated code into P-Code — pseudo-code — a sequence of compact instructions run by a virtual machine shipped with the application: the MSVBVM library, whose version 6 still accompanies today's binaries.
The choice was pragmatic. It kept executables small, compilation fast, and let the IDE's debugger work on the same code that ran. It had a downside nobody worried about at the time: P-Code carries no metadata. Instructions describe operations, not identifiers. Local variable names, private procedure names, constants and enumerations disappear at translation time.
1997: VB5 adds native code, using the Visual C++ compiler
Visual Basic 5 introduced a second target: compilation to x86 machine code. And not with an in-house code generator — Microsoft's documentation says it plainly, VB uses "the same optimizing back-end compiler technology as Microsoft Visual C++".
This is the most consequential fact in the whole story. A VB6 executable compiled to native code is not VB6 in disguise: it is the output of an industrial optimising compiler that reordered instructions, propagated constants, eliminated redundancy and allocated registers. Rebuilding readable Visual Basic from that has nothing to do with decoding.
P-Code, from VB5 on
Still available as an option. Each instruction corresponds to a language operation, which makes reconstruction largely mechanical.
Becomes the minority choice, because native is the default setting and runs considerably faster.
Native code, new in VB5
Optimised x86. Types are no longer declared, and the structure of the code has been reworked by the compiler.
Becomes the format of the large majority of applications actually shipped.
What each of the two gives back, measured: see Decompile P-Code or native code, what your binary gives back.
2002: VB.NET is not VB7
Visual Basic 6 is the last of its line. What followed in 2002 carries the same name and is not the same thing: Visual Basic .NET is a different language, on a different platform, with a different object model. The move was not an upgrade but a rewrite, and that is precisely why tens of thousands of VB6 applications never migrated.
Under VB.NET the compiler produces neither P-Code nor x86. It produces MSIL — Microsoft Intermediate Language, which the ECMA-335 standard calls CIL — compiled to machine code at run time by the just-in-time compiler.
P-Code and MSIL: two bytecodes, one gulf
Both are instruction sets for a virtual machine. The resemblance ends there, and the difference explains everything else.
P-Code — VB1 to VB6
- Format not documented by Microsoft
- No metadata: no names, no declared types, no signatures
- Interpreted by
MSVBVM60.dll - Specific to Visual Basic
- Identifiers are lost at translation
MSIL — VB.NET onwards
- Standardised, ECMA-335
- Metadata tables: names of classes, methods, fields, parameters, full signatures
- Compiled just in time at run time
- Shared by every language on the platform
- Identifiers are kept in the file
This is where the price gap between tools comes from. A .NET decompiler reads names the format kept: the work is largely a reformatting job, and excellent tools do it free of charge. A VB6 decompiler has to infer what the format threw away — and on native code, infer from a binary reordered by an optimising compiler.
If the file you are trying to open is a .NET assembly, do not pay for anything: we list the free and open-source tools that do that job better than any paid solution.
Why VB6 has not gone away
One might think the subject closed. It is not, and Microsoft decided so: the Visual Basic 6 runtime library is supported for the support lifetime of every version of Windows, under a principle explicitly named "It Just Works". The development environment, by contrast, lost its support in April 2008.
In other words: VB6 applications keep running on Windows 11, and nothing suggests otherwise. What disappeared is not the programs — it is their projects, their backup disks, their authors' machines. An application that has been running for twenty-five years and whose source nobody can find is not a curiosity: it is the most frequent case we are sent.
That is what makes the question of format decisive. The binary is there, it works, and it contains more than one imagines — the names of forms, controls and public procedures are still in it. The free edition of VBReFormer opens the file and says within seconds which format it is and what it holds.