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: 39 + 93 = ? followed by the letter: D 



About Me
More Blogs
Main Site
Posts: (All)
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 )
2023 ( 6 )
2022 ( 7 )
2021 ( 4 )
2020 ( 8 )
2019 ( 12 )
2017 ( 5 )
2016 ( 4 )
2015 ( 5 )
2014 ( 5 )
2013 ( 9 )
2012 ( 13 )
2011 ( 19 )
2010 ( 11 )
2009 ( 1 )