Avast Research Exposes VB6 P-Code Evasion, Disassembly, and Malware Reuse Techniques
Attack Tradecraft · 5 sources · Updated 4mo ago · First seen May 19, 2021

Avast researchers detailed how Visual Basic 6 (VB6) P-Code remains a viable malware platform, publishing reverse-engineering work that maps the internals of the msvbvm60.dll runtime, expands understanding of the instruction set, and improves disassembly of the language’s proprietary bytecode. The research found that VB6 P-Code is far more complex than a simple 256-opcode model, with roughly 822 unique opcode handlers after removing invalid and duplicate entries from a larger prefixed and unprefixed space. The work also documented variable-length instruction decoding, constant-pool structures, COM call resolution, and debugger-assisted analysis, while pointing to tools such as VBDec and Semi-VBDecompiler as practical references for analysts handling VB6-based malware.
Separate papers showed how attackers could exploit those gaps in tooling by hiding payload data inside VB6 executables and by manipulating P-Code streams in ways that still execute correctly at runtime but can break static analysis. Demonstrated techniques included jumps over junk bytes, jumps into argument data, invalid instruction sequences, and binary storage in resources, appended data, strings, form properties, error line tables, and other VB6-specific structures. Avast also described a method for extracting and reusing VB6 malware functions outside their original host by initializing the runtime through CreateIExprSrvObj, preserving RTMI/ProcDscInfo metadata, and invoking routines through ProcCallEngine, enabling analysts to execute malware-derived P-Code such as decryptors without fully reimplementing the runtime.
Why it matters
Impact assessment
Avast’s research does not describe a new software vulnerability or active campaign, but it materially raises defender risk around VB6 malware analysis and detection. Organizations that still encounter legacy Windows malware, commodity loaders, bankers, RATs, or bespoke malware written in Visual Basic 6 are affected because existing tooling can miss hidden payloads, mis-disassemble P-Code, or fail on intentionally malformed byte streams.
The operational impact is moderate for defenders and malware-analysis teams: missed detections, delayed triage, and reduced confidence in static-analysis results can allow malicious payloads or decryptors to evade inspection. The exposure is broad to any environment processing legacy Windows malware samples, though the story does not confirm widespread in-the-wild use of the specific P-Code-level obfuscation techniques; Avast explicitly states such manipulations had not yet been documented in the wild at the time of publication.
Supporting facts
- Affected population: SOCs, malware-analysis teams, reverse engineers, threat hunters, and organizations exposed to VB6-based Windows malware.
- Affected technology: Visual Basic 6 P-Code executed by msvbvm60.dll.
- Scope: broad analytical exposure rather than a direct product compromise.
- Severity drivers:
- Static-analysis blind spots in public VB6 tooling.
- Ability to hide binary payloads in VB6-specific structures and PE-adjacent locations.
- Ability to mutate P-Code streams so they still run in the VB6 runtime while breaking disassemblers.
- Ability to extract and reuse malware P-Code functions such as decryptors outside the original sample, improving adversary tradecraft portability and analyst workload.
- Known exploitation in the wild:
- VB6 malware remains common according to Avast.
- No documented in-the-wild P-Code byte-stream obfuscation was reported in the referenced research.
- Binary data embedded in VB6 form properties was reported as observed in the wild.
Entities and tools
- Entity: Avast Research / Avast Decoded
- Runtime: msvbvm60.dll
- Tools referenced: VBDec, Semi-VBDecompiler, WKTVBDE, p32Disasm, VB-Decompiler


