vb6 opcode ref


Author: David Zimmer
Date: 10.13.26 - 9:35am



In the last paper we showed how vbdec could be automated by a local AI agent.

One of the demos was using it to build a pcode opcode reference from the disassembler tables of the tool itself. That database was then enhanced by having AI automate IDA to analyze the actual vb runtime opcode handlers. We then added this info to the database and also used it to check my disasm.

This weekend I took the next step and had the AI do an automated compile/disassemble loop to document how to generate as many opcodes as we could and analyze the outputs further. Knowing exactly when each opcode is emitted is actually pretty interesting.

The database and interactive viewer have now been released along with a static vb6 pcode reference (3mb)

I also finally got around to creating an unofficial vb6 file format specification.

Have fun !

One other bit of trivia claude discovered. So there is a BoS (beginning of statement) and LargeBoS opcodes. BoS is used for on error resume next, so the runtime knows what the next statement should be if it encounters an error. It takes the next byte as the relative jump offset.

So what happens if your function has the next statement more than 255 bytes away? Thats where LargeBoS comes into play, and now the next byte is an index into an offset table that trails the function body.

So when do you get an instruction longer than 255 bytes?! Well come instructions are variable length and contain a list of arguments that all get processed at once like freeing strings.




Comments: (2)

On 10.13.26 - 4:03pm Dave wrote:
also a new paper on UDT Record Descriptors

On 11.10.26 - 10:53am R. wrote:
Thanks for that vb6 file format doc. Ive been working on closing some gaps in the documentation as well-

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 76 + 2 = ? followed by the letter: B 



About Me
More Blogs
Main Site
Posts: (year)
2026 (5)
     vb6 opcode ref
     Run as TI Server
     Intraoral camera time stamps
     VBDec AI Automation
     Misc Updates
2025 (12)
     Close IDA decompiler windows
     IDA Xrefs From/To
     IDA Jscript 3 Beta
     IDA JScript Updates
     IdaCompare StringDiff
     Sensationalization
     iPhone to PC Dictation
     pediff and chatgpt
     Py Magic Numbers
     upside down pyramid
     IDA Compare Updates
     Bindiff Niceity
2024 (1)
     MAP Update
2023 (6)
     Yara Workbench Automation
     VS linker versions
     IDA decompiler comments
     PublicBytes struct
     DispCallFunc
     VB6 Class Instances
2022 (7)
     VB6 Implements
     VBDec Bug
     vbdec remote scripting
     VB6 Stubs BS
     VB6 TypeInfo
     VB6 VTable Layout
     Yara isPCode rule
2021 (4)
     VB6 Hijacking
     rtcTypeName
     VB6 Gosub
     VB App object
2020 (8)
     AutoIT versions
     IDA JScript 2
     Using VB6 Obj files from C
     Vb6 PCode Internals
     Vb6 Runtime ForLoop Disasm
     VB6 Pcode - For Loops
     Yara Corrupt Imports
     Yara Undefined values
2019 (12)
     Yara WorkBench
     SafeArrayGetVartype
     vbdec dbg updates
     vb6 PCode NOP
     vb6 API and call backs
     how pcode works Pt1
     PrintFile
     ImpAdCallNonVirt
     Reversing PCode Args
     VB6 PCode Disassembly
     VB6 PCode Debugger
     UConnect Disable Cell Modem
2017 (5)
     IDA python over IPC
     dns wildcard blocking
     64bit IDA Plugins
     anterior lines
     misc news/updates
2016 (4)
     KANAL Mod
     Decoders again
     CDO.Message Breakpoints
     SysAnalyzer Updates
2015 (5)
     SysAnalyzer and Site Updates
     crazy decoder
     ida js w/dbg
     flash patching 2
     JS Graphing
2014 (5)
     Delphi IDA Plugin
     scdbg IDA integration
     API Hash Database
     Winmerge plugin
     IDACompare Updates
2013 (9)
     Guest Post @ hexblog
     TCP Stream Reassembly
     SysAnalyzer Updates
     Apilogger Video
     Shellcode2Exe trainer
     scdbg updates
     IDA Javascript w/IDE
     Rop Analysis II
     scdbg vrs ROP
2012 (13)
     flash patching
     x64 Hooks
     micro hook
     jmp api+5 *2
     SysAnalyzer Updates
     InjDll runtime config
     C# Asm/Dsm Library
     Shellcode Hook Detection
     Updates II
     findDll
     Java Hacking
     Windows 8
     Win7 x64
2011 (19)
     Graphing ideas
     .Net Hacking
     Old iDefense Releases
     BootLoaders
     hll shellcode
     ActionScript Tips
     -patch fu
     scdbg ordinal lookup
     scdbg -api mode
     Peb Module Lists
     scdbg vrs Process Injection
     GetProcAddress Scanner
     scdbg fopen mode
     scdbg findsc mode
     scdbg MemMonitor
     demo shellcodes
     scdbg download
     api hashs redux
     Api hash gen
2010 (11)
     Retro XSS Chat Codes
     Exe as DLL
     Olly Plugins
     Debugging Explorer
     Attach to hidden process
     JS Refactoring
     Asm and Shellcode in CSharp
     Fancy Return Address
     PDF Stream Dumper
     Malcode Call API by Hash
     WinDbg Cheat Sheet
2009 (1)
     GPG Automation