Skip to main content
Mallory
← Back to News
defense-evasion-methodoffensive-tooling-releasepayload-delivery-evasionadversary-emulation-tradecraft

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 Research Exposes VB6 P-Code Evasion, Disassembly, and Malware Reuse Techniques

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
Who uses this technique?Get the actors, campaigns, and ATT&CK mapping behind it.
Get the tradecraft
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

5 events · Apr 22, 2021 – May 19, 2021
  1. May 19, 20216y ago

    Avast publishes VB6 P-Code function reuse technique

    Avast Decoded published research describing how to extract and execute VB6 P-Code functions outside their original host by initializing the runtime, rebuilding required structures, and invoking ProcCallEngine. The article also highlighted use of the VBDec debugger and generator to automate extraction and patching tasks.

    Gen Blogs | Binary reuse of VB6 P-code functions
  2. May 5, 20216y ago

    Avast publishes VB6 P-Code disassembly research

    Avast Decoded published a reverse-engineering paper on VB6 P-Code disassembly and runtime internals, documenting opcode dispatch, argument decoding, and the complexity of the instruction set. The paper estimated about 822 unique handlers after removing invalid and duplicate entries from a theoretical maximum of 1,531 opcodes.

    Gen Blogs | VB6 P-Code Disassembly
  3. Reported Apr 28, 20216y ago

    Mutated obfuscated VB6 P-Code sample uploaded to VirusTotal

    The researchers uploaded a mutated VB6 P-Code sample to VirusTotal so vendors could test their tooling against the demonstrated obfuscation techniques.

    Gen Blogs | VB6 P-Code Obfuscation
  4. Apr 28, 20216y ago

    Avast publishes VB6 P-Code obfuscation research

    Avast Decoded published research concluding that VB6 P-Code can be obfuscated at the byte-stream layer. The paper demonstrated mutated samples using jump-over-junk, jumps into argument bytes, and invalid sequences that still execute correctly in the VB6 runtime.

    Gen Blogs | VB6 P-Code Obfuscation
  5. Apr 22, 20216y ago

    Avast publishes VB6 binary data hiding research

    Avast Decoded published a technical overview of how VB6 malware can embed binary data in executables, covering string encodings, opcode-based hiding, VB6 file-format structures, and PE-related storage tricks.

    Gen Blogs | Binary data hiding in VB6 executables
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Organizations

1 linked
Microsoft Corporation
Do you run this?Get the adversaries, campaigns, and ATT&CK mapping behind this technique, with detections ready to deploy.
See Who Uses This Technique
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.