changelog / build 2.1.3 onwards

What's new in VB Source Code Recovery

Release notes for the decompiler, newest build first. Every license includes 12 months of updates: the program checks for a new build once a day, and customers download it from the members area.

2.2.5

latest

P-Code Speed Improvements

This release is mostly about very large P-Code programs. One with 12,000 procedures ran for over 84 minutes without finishing and looked frozen; it now decompiles in about 20 minutes and writes its project in about 6. On the way, the P-Code decompiler learned Variant module variables, Split and Array, and arrays held in Variants, which took about 1,500 lines VB6 won't compile out of that one program. There's also a round of fixes to how forms are read, 48 more Windows API functions, and native programs decompile about 20% faster.

Very large P-Code programs

  • Decompiling: a program with 12,000 procedures ran for over 84 minutes in the window and looked frozen on its last procedure. The time went into passes over the whole program after the last procedure, and into the decode loop itself. It now takes about 20 minutes.
  • Status bar: after the last procedure, the status bar names each whole-program pass (Whole-program pass: ...), so a long run no longer looks stuck.
  • Another program, with 11,000 procedures, sat on its last procedure for hours. It now finishes. A smaller P-Code program I test with went from 207 seconds to 61.
  • File > Generate vbp:
  • It decompiled every procedure a second time. It now writes the code the Code view already has, so the two always agree.
  • In the window, it also wrote a status line for every event in the program, once per form: 3.7 million lines for this program. Only a form's own events get one now.
  • That program's project went from more than 32 minutes, unfinished, to about 6.

Native code speed

  • Native programs decompile about 20% faster: one I test with went from 289 seconds to 228.

P-Code accuracy

Most of these turned up in the same 12,000-procedure program. I read each one off the raw P-Code and reproduced it in a small VB6 project, which now decompiles to code VB6 compiles.

- Variant module variables: a Variant kept in a module and set from another module wasn't decoded. Each lost assignment left its value behind for the next call, which produced 1,485 lines like:
```vb
Fseleccion.Show vbModal, , 9000, "MPAISES", 1, " PAISES "
```
VB6 won't compile those. They're the assignments they were now.
- Module variable types: a variable set only from another module is declared with the type it's set as (String instead of Long).
- Return values: Variant Functions and Property Gets no longer lose their return value.
- Format$ no longer leaves a stray 1 in front of it: (1 & Format$(d, ...)).
- Form properties: Call frmConsole.Member_58(var_94) is now var_94 = frmConsole.hWnd, and the same for .Caption, .Visible and the rest.
- Split, Filter, GetAllSettings and Array are assigned to their array: strTemp() = Split(strData, vbCrLf, -1, 0) instead of Call Split(...), and x = Array(a, b).
- Arrays held in a Variant are read and set by index (v(i) = x) and stay declared As Variant.
- Indexed control properties keep their index: cmbFormat.ItemData(cmbFormat.NewIndex) = formats(i). Before, the index came out as the value.
- For loops over UBound: For i = 0 To UBound(x) no longer comes out as For Unknown = Unknown To Unknown.
- Late-bound indexed assignments such as Sheet.Rows(r).Cells(, 1) = rs("Codprod") are recovered.
- Event procedures with a Control or DataObject parameter are declared the way VB expects. Form_DragDrop(Source As Object, ...) stopped the project with "Procedure declaration does not match description of event".
- Code view and project agree: some procedures read differently depending on when they were decoded. The Code view and the generated files now match on every procedure.

Forms and controls

Each of these was an "Unknown OpCode" line in ErrorLog.txt or a property that came out wrong. I worked out each one by compiling small VB6 projects that change one setting at a time.

  • Menus: a menu with NegotiatePosition set lost the rest of its settings with an "Unknown OpCode" error. It's read completely now.
  • OLE containers: a form with an OLE container control lost every control after it. One form lost 20.
  • Data controls: Connect, DatabaseName and RecordSource are read correctly. An empty DatabaseName swallowed the next property, and a RecordSource came out as garbage.
  • Property pages and UserControls:
  • no more "Unknown OpCode" errors for ScaleMode, AutoRedraw, FontTransparent, DrawStyle and EditAtDesignTime;
  • a public property page is written as a property page (.pag), not a UserDocument (.dob).
  • User scale: Forms and PictureBoxes with ScaleMode = 0 (User) get the right ScaleWidth and ScaleHeight. One came out 28.94998 instead of the source's 95.855, another 1 x 1 instead of 2775 x 255.
  • ActiveX controls and DLLs: writing the .vbp hit an Overflow error, and its Startup line was empty. Both fixed.

Windows API declarations

  • 48 more API functions are recognised, 2,497 in all:
  • audio stream conversion (acmStreamOpen, acmStreamConvert);
  • AVI file reading (AVIFileInit, AVIStreamRead, AVIStreamGetFrame);
  • SHGetFolderPathA, SetFilePointerEx, InternetGetConnectedState and OleGetClipboard;
  • more Unicode calls (LoadLibraryW, FormatMessageW, InternetOpenW);
  • GDI+ effects and image streams.
  • They come with the record types they need: WAVEFORMATEX, ACMSTREAMHEADER and AVISTREAMINFOA.
  • ANSI and Unicode together: a program that calls both SHGetFolderPathA and SHGetFolderPathW gets a Declare for each, instead of one serving both.
  • Garbage Declares: references to another type library's interfaces were read as API functions. They showed up as unreadable lines in the API List and in modCommon.bas, which couldn't compile (8 of them in one OCX). They're skipped now.

Other fixes

  • Crash: one program crashed the decompiler with an access violation while its type libraries were read, leaving an empty output folder. It now decompiles.
  • ErrorLog.txt: a run that logs no errors deletes the ErrorLog.txt an earlier run left in the program's dump folder, so it no longer lists errors that are fixed.
  • User Guide: Help > User Guide covers everything up to this release.

2.2.4

Improved twinBasic results, VB5/6 updates

This release finishes the Common Controls on recovered forms: Toolbars get their buttons back and ImageLists their images. twinBASIC programs now export their class modules and many more statements. And there's a big round of native VB5/VB6 work: a VB6 program I test with went from 50 compile errors to none, and its generated project builds as it comes out of the decompiler.

Toolbars, ImageLists and ListViews

A customer asked why the toolbar and image list on their main form came back empty. The decompiler only read back the properties a control's type library lists, so every collection inside a control was lost.

  • Each control now saves itself the way the VB IDE does when it writes a form. What it saves goes into the .frm:
  • Toolbar buttons, with their images, and the Toolbar's link to its ImageList;
  • ImageList images, with the pictures in the .frx;
  • ListView column headers;
  • StatusBar panels.
  • Properties stored under another name are written under that name, so VB loads them:
  • a RichTextBox's Locked setting;
  • a ListView's AllowColumnReorder;
  • a toolbar button's Image.
  • Pictures in the dump folder: each of these pictures is also saved as its own file in the program's dump folder (for example frmPrincipal.ImageList1.ListImage3.ico) and listed under Images in the Project tree.
  • Icons: the saved icons had one uninitialised byte per image, so the .frx changed from one decompile to the next. They're written the standard way now.
  • Result: the customer's program, rebuilt in VB6, shows its toolbar with all its icons.

twinBASIC

  • Class modules are exported. A class with no form behind it was left out of the project; now it's written as a .cls file with its procedures, parameter names and types. Calls to its methods are named.
  • Newly recovered:
  • On Error Resume Next, On Error GoTo 0 and On Error GoTo <label>;
  • End;
  • a method's arguments, written in the call (cboVersion.AddItem "Client.exe") instead of <args>;
  • a Function method whose result isn't used, as Call obj.F(...).
  • Values:
  • Booleans are written as True and False (cmdAgree.Enabled = False).
  • Text joined with vbCrLf is written as "text" & vbCrLf instead of <expr>.
  • Two empty strings in a row no longer come out as 1 (If List1.Text <> 1 Then is <> "" now).
  • A Function's or Property Get's result is assigned under its own name (CompressedSize = ...), not a temporary variable.
  • The temporary variable a property assignment staged its value in is no longer printed in front of it.
  • Code view: a twinBASIC form showed a second VERSION 5.00 line, and its header came after the last procedure. Both fixed, and the form's code opens much faster (from over 3 seconds to 32 milliseconds on one program).

Windows API declarations

  • 72 more API functions are recognised, 2,449 in all:
  • OpenGL 1.1;
  • the Unicode (W) versions of common calls such as CreateFileW, CreateWindowExW, PeekMessageW and MessageBoxW;
  • GDI+ stream functions;
  • console functions.
  • The Unicode calls get their own record types (WIN32_FIND_DATAW, WNDCLASSEXW, GCP_RESULTSW), because the ANSI versions are too short for them.
  • A Declare for one of these is written with its real parameter types instead of As Any.

Native code (VB5/VB6)

A VB6 program I test with (I have its source) went from 50 compile errors to none. Its generated project now builds in VB6 as it comes out of the decompiler. On the way:

  • Byte arrays: conditions on Byte arrays, local and form-level, are recovered instead of <cond>.
  • Return values: a class Function that returns through VB6's inline cleanup code lost its return value. One of them always returned True.
  • Late-bound calls keep their arguments: RichTextBox1.LoadFile CommonDialog1.FileName, 1 had none (13 places).
  • Form variables:
  • a fixed-length String kept in a form is assigned by name (key = Finalkey50);
  • Select Case on a form variable is recovered.
  • Environ("USERNAME") is recovered.
  • Records passed to API functions:
  • The record is declared as its type, and its first field is set: Process.dwSize = Len(Process) before Process32First.
  • Before, the field was folded into the call (Process32First(var_28, 296)), which doesn't compile. With the field unset, the call would have failed at run time anyway.
  • For Each:
  • over a collection into a form variable (For Each itemx In AppRun.ListItems);
  • over a collection held in a Variant (the source's For Each File In Folder.Files).
  • ByVal Variant arguments to the program's own procedures were dropped. That made the call "Argument not optional", and could hand an earlier operand to the call instead.
  • Get # into a Byte variable read Get #2, , 0. It names the variable now (Get #2, , var_14).
  • A Variant property set on an object (t.Tag = pid) is recovered instead of UnkVCall.
  • Other programs I test with:
  • a VB5 program had the same Get # problem;
  • another lost the first part of a string expression next to such a call (DATA = DATA & BigDecToHex(...) & " " came out with <arg>).

2.2.3

AI naming now works on VB 2 to 4 programs, and the Edit Object tab and View Form now work on VB1 to VB4

This release brings the newer features to the older Visual Basic versions. AI naming now works on VB2, VB3 and VB4 programs, and the Edit Object tab and View Form now work on VB1 to VB4. There's also a big round of decompiler work on VB2/VB3, 16-bit VB4, native VB5/VB6 and P-Code programs.

AI names for VB2, VB3 and VB4 programs

Tools > AI: Suggest Names... and the Code view's Rename Symbol... now work on Visual Basic 4 programs (16-bit and 32-bit) and on Visual Basic 2 and 3 programs, as they already did on VB5 and VB6.

  • The names the decompiler had to invent are offered for naming:
  • VB4: Proc_8AD0E, t_1C, m_2C and the like.
  • VB3: procedures (sub0139), parameters (p0010), local variables (l0014), the variables and constants of a form or module (m00B0), and Globals (gv0260).
  • VB3 lets a program use variables it never declares, and those are offered too.
  • Checked before use: every name is checked the same way as for VB6, so the project still compiles. A name can't clash with a control, a form, a keyword, a Declare, or another variable in reach.
  • Where the names appear: in the Code view, in the generated project and in the names file. In VB3 output, the ' called by and ' calls comments follow the new procedure names.
  • Not offered: record fields (M00A0) and line labels (L0123) in VB3 output. The program doesn't say which Type a record field belongs to, so the same name can mean different fields.
  • Fix for every version: when two forms each had a procedure with the same name (two Form_Loads), their local variables went out in one request. The second form's suggestions were lost.

Edit Object and View Form for VB1 to VB4

The Edit Object tab now works for Visual Basic 1, 2, 3 and 4 programs. Before, it was empty (VB1), hidden (VB2/VB3) or showed only the object's name (VB4).

  • What it shows: the properties of the selected form or control in a Property / Value list, exactly as the decompiled .frm file writes them. Long lists scroll. Ctrl+A selects every row and Ctrl+C copies them.
  • View Form... shows the form the way the designer would.
  • Read-only: properties of these programs can't be changed or added.
  • Controls in the Project tree: VB3 and VB4 forms now list their controls, as VB1, VB5 and VB6 forms already did. A control array's element shows its index (Number(5)). Clicking a control shows its properties and moves the Code view to it.
  • Save Exe Changes fixes:
  • File > Save Exe Changes was switched on just by looking at a VB5/VB6 form's properties, and it stayed on after another file was opened. It now starts off for every file, and it isn't offered for VB1 to VB4 programs.
  • The previous file's property rows no longer stay on the tab when a new file is opened.

Visual Basic 2 and 3

VBX controls get their names:
- A program's own VBX files are now read for their controls' property and event names. The decompiler looks beside the program, in data\vb3\vbx and in Windows\SYSTEM. The VBX the program shipped with is the version it was built with, so it wins over the description files the decompiler carries.
- 42 VBX control classes that had no description file now ship with the decompiler. Their properties and event procedures are named instead of written as Prop<n> and Event<n>.
- If you have a program's VBX, copy it into data\vb3\vbx.

More statements are decoded:
- The Code view showed statements as "not decoded" that the generated project decoded. Both now agree.
- Newly recovered: Print Tab() and Spc(), Input # with several variables, Open ... For Random / For Append with Len =, ReDim of several arrays in one statement, Mid$(s, start) = r, UBound / LBound with a dimension, Date, FileCopy, Randomize, Loop While on a Long, For loops with a Single or Double counter, loops written on one line (For i = 1 To n: a(i) = b(i): Next), and whole arrays passed to procedures.
- A VB3 strategy game I test with went from 202 undecoded statements to 1.

Declarations:
- Array parameters: a procedure taking an array parameter was declared wrongly. For example Sub sub0139 (ByVal p0010 As Double, p0012 As Integer), though every call passes three arguments, the first a whole array. Array parameters are declared as arrays now (p000A() As Integer), and every call to such a procedure is listed in its ' called by comment.
- Variant variables: module-level and Global Variants weren't declared at all, so Visual Basic would treat each use as a separate local variable. The program would no longer do what it did. They're declared now. For example the CALC sample's Dim Op1, Op2, LastInput, OpFlag and TempReadout are all there, matching its source.
- Unused parameters: an unused parameter could take another parameter's name, which doesn't compile. Fixed.

16-bit Visual Basic 4

  • Compiles again: a 51-form engineering program I test with now compiles in Visual Basic 6, and in VB4 itself:
  • record Types are recovered from the Windows 3.1 API declarations;
  • control arrays split across a form keep their places;
  • VB4 ComboBox properties are read correctly (they overran into the next control).
  • New option: Options > VB4 programs: write VB4 source (keep the names VB6 reserves) writes a project VB4 itself can load. A 16-bit program gets 8.3 file names, which VB4's 16-bit IDE needs. On the command line it's /vb4out.
  • A missing procedure: one whose first statement is Stop wasn't decoded, so one program came out with 527 of its 528 procedures. A new <project>_procmap.txt beside the output lists every procedure in the program and the name it was given.
  • Fix() is recovered.
  • Temporary values: values the compiler kept in a variable slot are folded back into the statements they came from. One program lost 434 invented t_x = ... lines this way.
  • Single and Double: variables of these types are no longer declared As Long. VB6 would have rounded them.

Native code (VB5/VB6)

  • No Optimization builds: programs compiled with No Optimization get their arrays, array elements and multiplications recovered.
  • Set statements:
  • Set from a Variant (Set fso = CreateObject("Scripting.FileSystemObject")) came out as Call VarSetVar(...). The rebuilt program then stopped on its first line.
  • Set x = Nothing is recovered.
  • A Set into a form's own variable (Set m_Resizer = New clsResizer) is no longer dropped.
  • Objects and properties:
  • object Property Get bodies;
  • a StdFont kept in a form or class (.Size, .Bold, .Name = "Arial");
  • TypeOf ... Is Form;
  • indexed properties set through late binding (XT_PRI.TabCaption(4) = ...);
  • DataReport members;
  • the Printer object a function returns.
  • Small functions and conditions: Single and Double results of small functions, If MsgBox(...) = vbYes (four sites had silently wrong conditions), Boolean loop conditions, and the timer loops of a small-code ActiveX DLL (they never advanced).
  • Accents: string literals no longer lose their accents when the program's language names a different code page (Gestão do Serviço came out as Gestao do Servico).
  • Result: a customer's large business application now rebuilds into a program that runs to its activation screen.
  • VB5: seven values that came out silently wrong in a VB5 program I test with are fixed, among them a loop bound, a Select Case value, the file name passed to Dir and a Format result.

ActiveX controls written in Visual Basic

  • Properties are written as text: controls whose server is itself a VB UserControl, and a program's own UserControls, are now saved on their forms as text properties, the way the VB6 IDE writes them. Before, they were saved as a binary OleObjectBlob, and VB6 refuses to load a form with that.
  • Pictures in their property bags go into the .frx file.
  • Result: forms using such controls now load in VB6 with their properties set. Before, every instance loaded at its defaults, and one control's own code then stopped with error 13.

P-Code

  • API functions: Windows API functions declared in a type library the program references keep their names and get Declare statements. Before, the call was written as an error message.
  • ByVal: written at the call sites that need it.
  • Also recovered: methods of a class whose first slots are empty (one ActiveX control's members were named from the wrong slot), WithEvents variables in classes and UserControls, IIf operands and indexed Property Let calls (.Border(1) = 20).
  • Record types per module: they no longer leak between modules where two procedures share a name.

2.2.2

AI names in other languages, and symbol export for IDA, Ghidra and x64dbg.

Two new features this time: AI names in other languages, and symbol export for IDA, Ghidra and x64dbg. Behind those, there's a big round of work on native programs that use ADO and ActiveX controls (most of it driven by one customer's large business application), a VB5 program that now rebuilds clean, and the biggest step yet for 16-bit VB4.

AI names in other languages

Tools > AI Naming Settings has a new Names in: list.

  • Choose English (the default), Spanish, Portuguese (Brazil), Portuguese (Portugal), French, German, Italian or Dutch, or pick Other... and type any language the model knows.
  • Names are spelled with plain letters A-Z, so the project still compiles on any Windows. VB6 does accept año as a variable name, but only on a PC with the same code page; open that project on Japanese or Russian Windows and it won't build. So accents are dropped (CalcularAnio, Configuracao) and German umlauts are written out (Groesse). If the model sends accents anyway, they're converted before the name is checked.
  • The reasons in the Why column come in the same language.
  • There are two Portuguese entries because the words programs name things with are exactly the ones that differ: arquivo / ficheiro, tela / ecrã, usuário / utilizador.
  • If your earlier suggestions are in a different language, AI: Suggest Names tells you and points at Ask again. Changing the language while that window is open takes effect on the next Start.
  • English runs send exactly the same request as before.
  • The names file and the AI suggestions file now keep accented and Japanese text on every Windows. A Spanish reason used to come back as ? on Japanese Windows.

Export Symbols

File > Export Symbols is new. It writes everything the decompiler knows into a file your disassembler or debugger can load:

  • an IDA script (.idc)
  • a Ghidra script (.py)
  • an x64dbg database (.dd32)

What goes in:

  • Every procedure, named as it is in the Code view (your renames included), with its header and its decompiled VB code as comments. P-Code procedures get their byte code, descriptor and stubs labelled.
  • The VB structures from the Memory Map (VB header, project info, object and control records, event tables, Declares) applied as struct types where they sit in the file.
  • String literals, and the Declare, event and method stubs, named.
  • A note on every call esi saying which runtime function the register holds.

The old .map export moved into the same submenu. On the command line it's /ida, /ghidra and /x64dbg. The formats were checked against each tool's documentation and source, but I haven't loaded them in IDA, Ghidra or x64dbg myself yet, so please send a note if a file doesn't load.

Better decompiling

Native code (VB5/VB6):

  • Programs that talk to a database through ADO came out with most of their Recordset code unknown. rs.Open now carries its source and connection, rs!Field = Null and rs!IDOC = value are recovered, and Recordsets and Connections declared As New keep their class (Public cn As New Connection).
  • In one customer's program, 322 procedures stopped with error 13 as soon as they ran in the rebuilt project. Global variables used by its error-tracing code were declared Long instead of String.
  • Variants passed by value to methods and to the program's own procedures are folded into the call instead of leaking out as var_C(4) = var_3C lines (about two thirds of them in the same program).
  • DTPicker, ListView and control-array properties: DTProxATS(0).Value = DTP_DV.Value + 180 (it set the last control touched), .Enabled = False (it came out as = 11), and a ListView row's .SubItems(2) = ..., .ForeColor and .Bold.
  • If MsgBox(...) = vbYes Then, If Option2(0) Then, If Not IsEmpty(v) And Not IsNull(v), and default-property assignments on As Object parameters are recovered.
  • A control's Font set through late binding (rtPrincipal.Font.Size = 12) was an [unmodelled runtime helper] line.
  • A UserControl's property bag (ReadProperty / WriteProperty) is written as code. 27 WriteProperty calls had lost all their arguments.
  • A class whose first method slots are empty had every member named three procedures early, so Public Sub Enabled held another procedure's code.
  • MS Agent programs get their Agent calls named (Merlin.MoveTo 640, 0). The Agent control isn't part of Windows any more, so its type library ships with the decompiler now. A typelib Function called as a statement keeps the call instead of being dropped.
  • Arrays of Types kept in a form get their Type and their embedded fixed arrays, with every field subscripted. Open with Access Read Lock Read, Seek() and Loc() as functions, and the record numbers of Get and Put are recovered. Two game tools I test with now rebuild into programs whose INI output is byte-identical to the originals'.
  • A loop that exits into an If/Else, an If with an empty Then part, and an If body laid out after its loop come out in the right place.
  • A large procedure was split in two at a bounds check, and the first half lost its ret and all eleven of its parameters (966 undeclared arg_ uses). That's fixed.

VB5:

  • Module variables get their real type (String, Variant, Object) and fixed arrays their bounds, read from the program's own variable table. They were all Long before.
  • Lineas(20000) = "[Melodia]" came out as Lineas(0), and Lineas(n) = Mid$(Letra, ini, largo) was lost entirely. String and Variant module array elements are addressed properly now.
  • Variant For loops leaked as Call VarForInit(...) / Call VarForNext(...).
  • A constant passed to one of the form's own procedures went through a shared Variant, and VB6 stopped with "ByRef argument type mismatch". The literal reaches the call now.
  • Me.TextHeight("A") instead of frmVistaMinimizada.TextHeight Me, "A", var_48, ScaleX / ScaleY with vbPixels and vbTwips, ByVal object parameters (Item.SubItems(3) came out as 0.SubItems(3)), procedures without a stack frame, and Windows Media Player (MSDXM) controls are recovered.
  • With all of that, a VB5 lyrics program I have no source for went from 196 VB6 compile errors to a project that builds clean.

16-bit VB4

16-bit VB4 programs (Windows 3.x) have decompiled for a while, but this release is a big step.

  • Installers made with VB4's own setup kit (SETUP1, SETUPWIZ) came out as forms with no code at all. They decompile in full now (153 and 213 procedures), and SETUP1's event procedures are named exactly as in its source.
  • Every instruction in the eleven VB4 programs I test with now decodes. Before, procedures stopped at the first unknown one.
  • Class modules are separated from forms. In one program a form had 357 procedures, and its own vtable lists 18.
  • The program's own classes and forms, and the objects it uses (DAO, StdFont, Collection, Err), are named and typed: Err.Number, Err.Raise and g_12.OpenDatabase(...) instead of Err.Member_20 and g_12.Member_58(...).
  • References to another form named the wrong form, so frmX.Show showed the previous one.
  • Functions return their values, and parameters are declared ByVal, Optional and ParamArray as written. SETUP1's signatures now match its source.
  • Option Compare Text, Print # (one program had lost 165 of them), Write #, Line Input #, Name ... As, Resume, GoSub / Return, Exit For, Exit Do, Stop, Error, TypeOf, StrComp, LBound / UBound, Mid$ as a statement, array elements, With blocks, and arrays declared with their bounds are recovered.
  • Declare statements come from the Windows 3.1 API list VB4 itself shipped (733 of them), so SetWindowPos reads exactly as in the source instead of with 32-bit types.
  • A form whose designer is stored as a resource (a splash screen with a big picture) was missing, and its code landed on other forms.
  • VB6 now builds the decompiled project of a 51-form engineering program (with two licensed third-party controls swapped for standard ones).

Windows API list

  • The network share and group functions (NetShareEnum, NetShareAdd, NetShareDel, NetLocalGroupEnum, NetGroupEnum, NetMessageBufferSend and others) with their SHARE_INFO and LOCALGROUP types, the WinINet cookie functions, socket, lstrlenW and lstrcpynW.

2.2.1

Memory Map updated, and more new improvements.

VB Source Code Recovery 2.2.1

Changes since 2.2.0.

This one is a bit of everything. The Memory Map export was rebuilt from scratch, P-Code got another big round of fixes, and VB1, twinBASIC and .NET programs all came a long way. Some of the native fixes came from customer reports again, so thanks to everyone who sent in files and Problems lists.

Memory Map

File > Export Memory Map has been rewritten.

  • It asks where to save now, and suggests yourprogram.memmap.html.
  • The page shows what every part of the file is: the PE headers, imports, exports, resources and relocations, the VB header and project info, every object, form and control record, event tables, Declares, COM registration, every procedure under its decompiled name (your renames included), and the string literals. On the VB5 and VB6 programs I tested, 80 to 96 percent of the file is accounted for.
  • Click a byte and the panel on the right shows which structure it belongs to, with the fields decoded. Pointer fields are links, so you can follow aProjectInfo to the project info, aObjectInfo to the object, and so on.
  • There's a bar across the top showing the whole file, a list of every structure you can filter and sort, Go to and Find (hex bytes or text), file offset / RVA / VA addresses, folding for long runs of zeros, and a dark theme.
  • If two structures claim the same bytes, they're hatched in red and listed on an Overlaps tab. That usually means something was read wrong, so it's a handy sanity check.
  • It's one file that works in any current browser, and it's about twice the size of the program instead of around 25 times.
  • /memmap on the command line writes the same page.

Better decompiling

Native code (VB5/VB6):

  • Integer variables that VB keeps in a register lost their value whenever an If or a loop changed them. A function adding up a cost came out as = 1, a counting loop counted nothing, and drawing code never moved its X and Y. Those keep their values now.
  • For i = Len(s) To 1 Step -1 (counting down with the counter in a register) came out as an endless Do While Len(var_24) >= 1 with no return value. It's a normal For loop again.
  • A Select Case inside the Then part of an If, where the Case Else had real code in it, lost the If's Else block.
  • Fixed-size local arrays with more than one dimension (Dim BTM(0 To 7, 0 To 200, 0 To 200) As Integer) keep all their dimensions, and fixed arrays inside the elements of an array of Types (ItemDef(n).Image(i)) are copied instead of dropped.
  • Whole Types written or read with Put #f, , ItemMap(x, y) / Get #, and Types that contain a String * N, are recovered. Before, the Get read into a Variant and the rebuilt program stopped with error 458.
  • If Timer < LastTime Then Exit Sub came out as If Timer <> 0, and tests like If x < 0 Then on an Integer were sometimes mistaken for an error check. Option buttons and MsgBox answers that are tested later in the procedure keep their tests too.
  • With all of the above, one of my own map editors now decompiles to a project that runs, opens maps, draws them pixel for pixel like the original, and saves files byte-identical to what the original saves.
  • A Function whose result is set in a shared exit block (f = 1 : Exit Function reached by a GoTo) returns it. One customer's PLC class never "opened" because PLCOpen = True was missing.
  • A Date stored early in a long procedure and read much later by DateDiff("s", startTime, Now) read an unassigned variable instead.
  • Properties and methods of an ActiveX control that isn't installed on your computer come out as prop_1C style names instead of [unmodelled runtime helper] lines. A customer's program went from 13 problems to 1 (the last one is the missing control itself).

VB5:

  • Event procedures of ActiveX controls (Toolbar, WebBrowser and so on) were named one event too early, so ButtonClick showed up as Validate and DownloadComplete as DownloadBegin. VB5 doesn't have a Validate event and VB6 does, which shifts everything by one.
  • Programs whose sections sit at a different place in the file than in memory (FileAlignment 0x200) never got their module variables named. One test program went from 65 <cond> markers to 1.
  • A Variant For ... Next loop came out as a dead Do While reg_eax <> 0 loop that never ran.

P-Code:

  • Objects returned by your own classes, forms and public variables are assigned with Set. Set Item = colEmployees.Item(Index) used to come out as a plain assignment.
  • For Each f In Forms walks the forms. Before, it looped over a stale variable and f.Name came out as Forms.Name.
  • Late-bound calls and properties, For Each x In lv.ListItems, If x Is Nothing, Set x = New Class1, Set x = Nothing, whole-array assignments, and Functions that return an array or an object are recovered. VBScript's RegExp object is named. PDFStreamDumper went from 90 unknown lines to 6.
  • Function return values that went missing are back, For loop counters get their real type (they were all Long), and String * N locals are declared.
  • Property Get, Let and Set procedures are kept apart. They were being merged into the procedure above them.
  • A VB5 P-Code ActiveX control that uses DirectX 7 went from a project VB6 wouldn't even load to one that builds clean, and VB5 module variables are declared now (they were missing entirely).

Both:

  • The Windows API list knows the Winsock functions (WSAStartup, gethostbyname, connect, send, recv, closesocket and the rest of wsock32 and ws2_32), the ICMP ping functions, inet_addr / inet_ntoa, and the HOSTENT, WSADATA and SOCKADDR_IN types.

Visual Basic 1

  • Forms and modules are exported under their original file names (LEVEL.frm, ICONEDIT.frm and so on), and the project starts on the right form. VB1 keeps a copy of the project's file list inside the exe, so this isn't a guess.
  • Procedures are named from VB1's own procedure table, so event procedures land on the right control. In a few programs the event procedure names were shifted round by one.
  • Statements separated by a colon are handled properly. If c Then x = i: Exit Function came out as an If followed by an Exit Function that always ran, which made some loops return on their first pass.
  • A GoTo at the end of an ElseIf, the ^ operator, Next dy, dx, module-level declarations, custom controls like FIELD100.DLL's, one-letter control names (a Timer called T), and hex and Long literals are recovered.

twinBASIC

  • Calls into the twinBASIC runtime are named: Print #, Write #, Open ... For ... As #, Close, Line Input #, Input #, Unload, Left$, Mid$, UBound, IsNumeric and a lot more. These came out as unnamed calls before. FileLen was being shown as Dir$, and that's fixed too.
  • DriveListBox and FileListBox were swapped, and a control's caption could be mistaken for its font and dropped.

.NET

  • The C# output now compiles. A test project went from 40 compiler errors to 0, builds with dotnet build, and runs the same as the VB version.
  • The VB output reads a lot more like the source: real For loops, Select Case with the enum names (Case ScrollEventType.ThumbTrack), AndAlso / OrElse, Exit For, WithEvents variables with Handles clauses, On Error GoTo, Modules, nested classes, field initialisers, Static locals, an AssemblyInfo file, and MsgBox / CStr / string comparisons written the normal way.
  • Rectangles and other structures were never actually created (every control sat at 0,0 with no size), CInt of a Boolean came out as 0, Overrides came out as Overridable so the form's Terminate code never ran, ByRef arguments were copied back before the call instead of after, and some VB string handling was off.

2.2.0

Native Code Improvments and Interface updates

A lot of this release came straight from bug reports, several of them from people working on Japanese programs. Thanks to everyone who sent screenshots and sample files, they made these much easier to track down. The rest is the usual work on getting native code closer to what the original programmer wrote.

Renaming

  • On Japanese Windows (and other double-byte systems like Chinese or Korean), names you gave with AI: Suggest Names or Rename Symbol were saved, but the next time you opened the program they were back to var_18, proc_4171E0 and so on. The names file was being read in a way that breaks on those systems. Your existing names file is fine and loads again in 2.2.0, so there's nothing to redo. The AI: Suggest Names list had the same problem and comes back now too.
  • If a names file ever can't be read, the program now keeps a copy next to it (yourprogram.exe.names.json.unreadable) before anything can write over it, and says so in the status bar. Before, it quietly started with no names, and the next rename replaced the file.
  • Two forms can now have procedures with the same name, like DisableFormControls in both. AI: Suggest Names used to mark the second one invalid ("also proposed elsewhere"). VB allows it, so it's allowed here now. Procedures in a standard module, and two procedures in the same form, still need different names. If you already have rows marked invalid because of this, right-click them and choose Reset to pending.

Interface

  • The selected item in the project tree stays highlighted when you click into the code, so you can still see which procedure you're looking at.
  • ActiveX controls in the tree show the same icon they have in the VB toolbox (RichTextBox, Winsock, CommonDialog, FarPoint Spread and so on) instead of one generic icon.

Better decompiling

Native code (VB5/VB6):

  • Select Case blocks that VB compiled as a jump table only got the first Case right. With something like Case 0: frmA.Show vbModal, Me through Case 5: frmLine.Show vbModal, Me, Cases 1 to 5 came out as a few var_C(4) = var_30 lines and a bare frmX.Show. They all come out as .Show vbModal, Me now.
  • An assignment to a ByRef parameter inside a Function (LongFixBarLen = Len(StrFixBarCode)) was dropped, and a test right after it like If x = "00" Or LongFixBarLen = 0 came out as LongFixBarLen = LongFixBarLen. Both are fixed.
  • Set rs = db.DbCreateDynaset(...) and other objects returned by late-bound calls come out as one Set line. Before, you got var_6C = db.DbCreateDynaset(...) and the recordset variable was never assigned, so every rs.RecordCount after it was using an empty variable.
  • CStr and Format$ of a Double inside a longer string, like "+" & CStr(x / 2) & " " & s or "best time: " & Format$(t, "0.000"), lost the part in front of them and showed <arg> instead. A Double passed in the middle of an argument list could also make the next argument disappear.
  • i = i - 1 on a loop counter that VB keeps in a register is recovered, and some Integer variables used in arithmetic and comparisons were read as the wrong variable.
  • InStr keeps its start and string arguments when both go through other string functions, the argument in front of a Trim$ or UCase$ call isn't lost anymore, and Rnd inside a string expression comes out right.
  • Arrays of Types read through a pointer, Type parameters passed ByRef, and static 2-D arrays of Types keep their fields.
  • Arrays of objects and controls keep their element: Load ctl(i) followed by With ctl(i), elements declared As New, and so on. String elements of a form's fixed-size array get assigned instead of disappearing.
  • ListView ListItems.Add and ListItem calls, ImageList ListImages.Add, TextWidth called on another form (frmClient.TextWidth), and methods of an object that was passed in as a parameter are named instead of showing up as UnkVCall lines or <arg>. Your own classes and UserControls with more than 16 methods get all of them named, not just the first 16.
  • A Select Case whose Cases jump straight into other procedures is recovered.
  • Values set inside If and Select Case branches, and values clamped by an If (If x < 0 Then x = 0), keep their variable. Abs() of a conditional value comes out right, and CBool() of a Variant is recognized.

2.1.9

P-code and Native VB5/6 Improvements

Most of this release went into getting the decompiled code closer to what the original programmer wrote.

Interface

  • Clicking a form in the tree now shows its Code tab right away. Before, it filled the Edit Object and Dism tabs first, so on a big form you'd wait a second or so, and if you clicked View Form during that wait you could end up on the wrong tab. Edit Object and Dism are now filled when you actually open them. Repeat clicks on a form went from about half a second to around 50 ms.
  • Form Viewer on Japanese Windows: the Properties list, the menu outline and the event list showed form captions as garbage characters, even though the form itself drew fine. That's fixed, and a Japanese program's captions also show correctly on English Windows now.

Faster

  • Programs compiled with Optimize for Small Code decompile about 2.5 times faster, and with far fewer leftover Call DerefAry1(...) and unknown object calls. A large test program went from 39 minutes to 14.
  • Programs with big arrays of Types (records) are more than twice as fast. A 2,300-procedure server went from 47 minutes to 21, and ChessBrainVB from about 4 minutes to under 1.5.

Better decompiling

Native code (VB5/VB6):

  • Collections stored in a form or class variable come out right: Private c As Collection, Set c = New Collection, c.Add cc, Me.Caption = c.Count. Before you got As Long, New (object) and UnkVCall lines.
  • Dim x As New Class1 inside a procedure is declared that way again, and a Function that returns one of your classes is declared As Class1 instead of As Object.
  • WithEvents event procedures get their real parameters, like cc_DoStuff(x As String) instead of cc_DoStuff(arg_C).
  • Setting a Public variable of your own UserControl from its form (ucTest1.a = 5) and setting Printer.FontBold / Printer.FontSize come out as normal assignments instead of [unmodelled runtime helper] lines.
  • A class with a Public variable no longer also declares a Private field_XX copy of it.
  • Select Case on a Byte with lots of Case branches, Loop While b <> 0 And b < 6, and If x = "A" And bAllowed Then are recovered. One test program went from 383 <cond> markers down to 2.
  • Some comparisons came out backwards, like If FinalScore <> VALUE_NONE. They're the right way round now.
  • Fixed-size arrays declared in a form or class (Private DontEncode(255) As Boolean) are recovered instead of turning into a fake Type or a <cond>.
  • Arrays of Types in big programs keep their subscripts, so you see ItemDefs(Items(i).ItemID) instead of a variable that's never assigned.
  • ListView ListItems / ListSubItems calls and MSChart property chains on controls passed as parameters are named instead of showing up as raw late-bound calls.
  • Split and Environ keep their arguments (Split(sRet, " "), Environ("windir")), and Unload Me no longer names whatever control was used last.
  • Calling Mid$ twice with the same start variable no longer reads an unassigned variable the second time.
  • Public form procedures that came out as proc_XXXXXX get their names back, and another form's property (frmEnterPassword.Tag) no longer gets attributed to Me.
  • VB5: If tests on Single properties (If Frogger.Top = 7800 And Frogger.Left = 4280 Then) used to come out as a dozen empty If blocks.
  • Less clutter: fewer leftover GoTo jumps and doubled Exit Sub / Exit Function lines, and a Variant assignment like a = a + 1 is one line instead of going through a temp variable.

P-Code:

  • A program with a WithEvents variable of one of its own classes crashed with Error 9 and gave you nothing but decompile.log. It decompiles normally now, and the class's events and their event procedures are named.
  • On x GoTo, On x GoSub, GoSub / Return, and Currency and Date constants are decoded. A Double constant like 0.5 was being read as 3.2E-319.
  • Several statements that used to disappear or come out garbled are back: x = x + 1 on a Variant parameter, assignments to UserControl variables, Set c = New Collection, Set cc = ... on a WithEvents variable, and Class_Initialize / Class_Terminate.
  • Dim c As New Class1 is declared that way when the code proves it, and a plain Set f = New C field isn't declared As New anymore.
  • A control on one form no longer gets mixed up with a control on another (Form1.Picture1.BackColor was showing up as Frame1).

Both:

  • UserControl events are named from VB's own list, so you get UserControl_KeyDown, UserControl_Paint and so on instead of UserControl_Event15.
  • The Windows API list knows more functions: TransparentBlt, AlphaBlend, TrackMouseEvent, CreateFontW, GetTextMetricsW, PropertySheet, and the uxtheme drawing functions (DrawThemeBackground, DrawThemeText, GetThemePartSize and others).

2.1.8

New Improved GUI Features

New

  • Search > Problems puts everything the decompiler wasn't sure about in one list: code it couldn't recover, leftover GoTo jumps, procedures and variables that still have generated names, and missing components. Each module shows a percentage for code and for names. Click a row to jump to it.
  • Tools > Test Compile with VB6 builds the recovered project with your copy of VB6 and shows where each compile error is. It sets the failing procedure aside and builds again, so you get the whole list instead of just the first error.
  • Tools > Missing Components lists the OCX and type library files the program needs that aren't on your PC. Point it at a copy of the file and decompile again. Nothing is copied or registered, so you don't need admin rights.
  • Show References (Shift+F12, or right-click in the code) lists every place a name is used. For a procedure it also shows what calls it and what it calls.
  • Navigate Back / Forward (Alt+Left, Alt+Right) returns you to where you were before a jump, like a web browser.
  • The Code view has the two drop-downs from the VB IDE: pick an object on the left, then one of its procedures on the right.
  • Form Viewer: click a control to see its properties and its event procedures, and jump to the code from there. The outline now includes the form's menus, and a placeholder for a third-party control tells you which OCX it needs (in red if you don't have it).
  • Right-click a number in the code and choose Convert to Constant to replace it with a VB constant. Revert to Number puts it back.
  • New command-line switches: /problems, /testcompile and /xref.
  • The new windows and menus are translated into all 8 interface languages.

Better decompiling

  • VB constants come back automatically when the code makes the meaning clear: MsgBox buttons and return values (vbYesNo, vbYes), key codes (vbKeyReturn), mouse pointers, colors, and the arguments of functions like Shell, StrConv and Dir. This works for VB4, VB5 and VB6, P-Code and native.

Native code (VB5/VB6):

  • For loops with a Single counter and a variable Step come out as For ... Next. Some used to come out as loops that never ended.
  • A Yes/No MsgBox whose answer gets checked keeps its If test. It used to turn into a condition that was always true or always false.
  • Copying a whole Type into a 2-D array element (ItemMap(x, y) = rec) is recovered, along with With blocks on those elements and local 2-D arrays.
  • Late-bound property assignments like Slider1.Max = 100 are no longer dropped.
  • Fixed Variant arguments passed through to another procedure, UBound on an array stored in a Variant, and a few If tests that read the wrong variable.
  • Fewer [unmodelled runtime helper] markers.

VB4 (32-bit):

  • Programs whose forms use random GUIDs get their event procedures back. Before, all their code ended up in Object0, Object1 and so on.
  • Public form procedures get their real names and parameter names from the program's type library, and public Functions return their values.
  • Print #, Write #, Input # and the Open modes are decompiled.
  • The .vbp includes Object= lines for the OCXs the program uses.
  • A new API List node under P-Code Procedures shows every Declare and the procedures that call it.

Interface

  • Clicking a form in the tree opens the Code tab instead of Edit Object.
  • The Dism tab uses a fixed-width font so the columns line up, labels each procedure with its real name, and notes what each call goes to: VB runtime functions, Windows API functions the program declares, and the program's own procedures (using your renames).

Fixes

  • Forms whose last control was a menu lost their closing End, and VB6 refused to open them. This affected VB4, VB5 and VB6 output.

2.1.7

Decompiler accuracy (VB5/VB6 native code) and Import Names

Build 2.1.7 (file version 2.01.0007), October 7, 2026: changes since 2.1.6.

Decompiler accuracy (VB5/VB6 native code)

- An If/Else that assigns the same String array element in both branches is no longer an empty If (customer report #28).
VB6 shares the store between the two branches, and both assignments were lost:

```vb
' 2.1.6 ' 2.1.7
If global_0042208C = "" Then If global_0042208C = "" Then
End If field_7C(0) = ""
Else
field_7C(0) = global_0042208C
End If

- Statements that both branches of an If end with stay inside the If.
VB6 keeps one copy of the shared ending, and it was written in the wrong place.
In a KeyPress handler that meant KeyAscii = 0 ran for every key, so digits could not be typed:

If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
ElseIf Not (InStr(1, "1234567890", Chr$(KeyAscii), 0) > 0) Then
KeyAscii = 0
End If
- Many more If … Else blocks are written as If/Else instead of a GoTo and a label, including blocks whose Else contains loops or nested Ifs.
Several places where an If's body was split across the wrong End If now nest correctly.
- MsgBox keeps its title when the Buttons argument is an expression.
MsgBox msg, vbOKOnly & vbCritical, "ERROR!!" had lost "ERROR!!".
- An array that a class ReDims As String is declared As String, not As Variant.
- The first field of a structure variable is written as that field.
For example pt.x and pi.hProcess instead of the whole structure.
Calls such as SetCursorPos, CloseHandle and CoTaskMemFree now get the right value, and rebuilt code no longer stops with Type mismatch.

New

- File > Import Names… (customer report #27) brings renames over from another copy or folder of the same program.
Every entry is checked against the open program, and names that no longer fit are listed with the reason and skipped.
Accepted names are saved beside the program at once.
The menu item is translated into all eight interface languages.

Fixes

  • Renaming something in a form's code no longer switches from the Code tab to Edit Object (#20).
  • The Windows API list now includes SHGetSpecialFolderLocation (pidl As Long) and the ITEMIDLIST structures.

2.1.6

Add Property to VB6 forms, decompiler improvements across the board.

VB Source Code Recovery 2.1.6

## Decompiler accuracy (VB5/VB6 native code)
- DateAdd with a variable number: a call such as DateAdd("d", i, Now) now keeps its date argument. It came out as DateAdd("d", i, var_BC), with a variable that was never assigned in place of Now.
- Values passed on to Mid are kept: an Integer read back a few instructions before it is passed to a function such as Mid no longer loses its assignment. Values read with CInt(rs.Fields(6)) were
discarded, and the Mid call that used them named the wrong variable.
- Late-bound calls keep their arguments: a call keeps its argument when the setup of the next part of the statement comes before the call. IIf(IsNull(rs.Fields(11)), 0, rs.Fields(11)) came out as
rs.Fields with no index.

## Visual Basic 3 and 2
- A single-line If with several statements after Then or Else keeps them all inside the If. One of them could be written as if it always ran.
- ByVal parameters and the program's own DLL Declare statements are recovered, and String functions return their value.
- Dynamic arrays and object variables are declared, for example Dim a() As String and Global Docs() As New frmNotePad.
- Reads of a String field of a record are no longer lost.
- Far fewer statements are left undecoded across the test programs.

## Interface
- Dism tab: shows the whole disassembly of an object. It stopped at 65,535 characters.
- AI: Suggest Names: on Japanese and other double-byte Windows, clicking a row highlights the name in the right procedure. It could select the same name in the procedure above.
- Find Next / Find Previous: continue from the text selected in the Code view, or from the cursor. This now also works right after a row in AI: Suggest Names, a Methods node or Go To Declaration has
shown the code; before, the search started again from the top of the form or class.
- Find All: shows a horizontal scroll bar when its window is narrowed, so long result lines can be read.

## Edit Object
- Add a property...: add a property that a form or control does not have yet, and Save Exe Changes writes it into the program.
- Longer text: text can now be longer than the original, so a longer Caption is no longer cut off.
- Patch report: when Save Exe Changes finishes, it offers to open PatchReport.txt.

## Renaming
- Rename Symbol can rename a procedure's Static variables (static_0, static_4, ...).

## .NET
- An assembly with one-character names no longer stops with "Error 5: Invalid procedure call or argument" before writing anything.

2.1.5

Project-Wide Search, Language Interface Updates and More Accurate Native Decompiling

## New Search menu
- Find (Ctrl+F), Find Next (F3), Find Previous (Shift+F3), Find All and String List.
- Find steps through every form, module and class of the open program in project-tree order, or through the Code view as it stands. It supports Match case, Whole word and wildcards, and can be
limited to code, declared names, strings, comments or designer text.
- Find All lists every match in a table. Click a row to see it in the Code view, or copy the list or save it as a UTF-8 text file.
- String List shows every string literal once, with how many times and in how many objects it is used, and where it is first used.
- Right-click a name in the Code view and choose Find in Project to list everywhere it appears.
- On the command line, /find and /strings do the same.

## Languages
- File > Language now translates every menu, tab, button and project-tree label of the main window, and the whole of the AI: Suggest Names, AI Naming Settings and Options windows.
- Eight languages: English, Japanese (new), German, French, Spanish, Italian, Portuguese and Dutch.
- The language takes effect at once and is remembered.

## Renaming and editing
- Rename Symbol and AI: Suggest Names follow Visual Basic's name rules. A form's procedure can now take a name that another class only uses for its own member, for example PLCOpen beside a call to
field_34.PLCOpen. Names that would really clash are still refused, with a message that says where.
- Names Visual Basic does not allow in a form, such as Caption or Hide, are refused, as are its reserved attribute names and Circle, PSet and Scale.
- In AI: Suggest Names, the row selected in the table stays highlighted in the Code view after the Code view has been used.
- Edit Object: a string shortened with Save Exe Changes is no longer padded with spaces that showed in the running program. It now loads as exactly the new text.

## Native (VB5/VB6 machine code) decompiler accuracy
- A form's Public variable no longer appears under two names (Public pPLC As ClassPLC beside Private field_34 As New ClassPLC).
- Set assignments of New or Nothing to form and class variables are no longer dropped.
- Property assignments on such objects name the right object and value, and a Boolean property set to a literal reads True or False.
- An As New variable is declared As New, with its calls resolved.
- A Public variable of a control type such as TextBox is declared As TextBox instead of As Long.
- Calls to Windows API functions keep their arguments in more cases: StrPtr, ObjPtr and AddressOf arguments, fixed-size arrays and arrays of records passed to a Declare, and one Declare per name
with its Alias.
- Late-bound calls on Variant variables, indexed property assignments such as SubItems(1) = value, and objects kept in temporary variables are recovered.

## ActiveX DLLs, P-code and reports
- ActiveX DLLs: classes with some Instancing settings (GlobalMultiUse among them) were decompiled but never written, 97 of one DLL's 192 classes. Every class is now written with its Instancing read from
the program, and Crystal Reports designers are included.
- VB5 P-code ActiveX controls get their Declare statements, procedure names and events right.
- P-code calls to a private function no longer pick up arguments that belong to the statement around them.
- FileReport.txt now starts with a File Type summary: language, compiled to, project type, objects and runtime.
- More Windows API declarations are recognized, including the ImageList functions, OleTranslateColor, InitCommonControls, PathFileExists, CreateStreamOnHGlobal, OleLoadPicture and SendInput.

2.1.4

Improvements, fixes

### ActiveX controls named on PCs without them registered
Report: On a stock Windows 10/11 machine (no VB6), OCX properties came out as
' [unmodelled runtime helper] LateIdSt("") instead of FormCheck.txtChat.Text = "".

Cause: Control member names come from each control's type information, which was only looked up in the
registry. A developer machine with VB6 has every standard control registered; a customer machine usually has none.

Fix: The type information of the 24 standard Microsoft VB6 controls now ships in data\ocxtlb
(about 1 MB): RichTextBox, Winsock, Common Controls 5/6, Common Dialog, Tabbed Dialog, MSFlexGrid,
Hierarchical FlexGrid, Internet Transfer, Masked Edit, MSComm, PictureClip, SysInfo, Multimedia MCI,
DataGrid, DataList, ADO Data Control, DBList, MSChart, Data Repeater and Remote Data Control. For any other
control, the program now looks for the .ocx file beside the program being decompiled and in
Install Folder\typelibs. Nothing gets registered on the user's machine.

### Japanese form captions no longer garbled
Report: On Japanese Windows, code strings were correct but every form caption, font name and the
project title came out garbled.

Fix: Text inside forms is now decoded with the PC's code page, so captions, Font.Name and the
.vbp Title come out in the right characters. The form viewer now uses the right font for controls
that have no font of their own, so Japanese labels display correctly. Edit Object's string editing
counts bytes correctly for double-byte text.

### Code view and main window
- Clicking a method or control in the tree puts it at the top of the Code view (it used to
stop at the bottom edge with the body hidden).

### AI: Suggest Names
- The window no longer blocks the main window. Selecting a row (click or arrow keys) opens that
procedure in the Code view and highlights the name, and the Code view can be scrolled alongside.
The main window is only locked while a request is running.
- The table now shows its horizontal scroll bar when the window is narrowed. Before, it appeared
only after dragging a column wider.

VB4 32-bit programs no longer hang

### Decompiler accuracy (VB5/VB6 native code)
- Late-bound property assignments carry their real value: txtChat.SelColor = Val("&H" & ...)
instead of = var_70.
- A function returning a value set in an If/Else no longer always returns 0.
- Late-bound string concatenations no longer become [unmodelled] VarCat comments.
- An omitted optional argument is no longer printed.
- Global variables passed by reference are named.
- In procedures with an error handler, loop start values and constants are no longer dropped.
- Correctness: the temp-variable cleanup no longer deletes live assignments. It was dropping
a value assigned in only one arm of an If, Select Case or GoTo branch. Examples: MinerVGA lost
13 Case values, and Dungeon lost an AddItem 21. It also folded a value into its first use while
a ByRef call still needed the variable, so GetPrivateProfileString got a new buffer and the
read value was lost.
- Trim(Left(Combo1.Text, 3)) (was Trim$(Left$(0, 3))), rs.Fields(1) and GetIni(...)
arguments are recovered.
- RaiseEvent Name(args) is recovered (was a syntax error).
- Select Case ladders and string-append branches the compiler merged into one code path are
recovered.
- If i = 6 Then SetText 7, r, rs.Fields(i) / 100 is recovered (the / 100 branch was lost).
- For loops whose counter lives only in a register are rendered with a real counter variable.

2.1.3

UI Improvements, Bug Fixes

Release Notes

New features

  • Effort setting: none option. The Effort list now starts with none, which leaves the effort parameter out entirely. This resolves the connection error reported with claude-haiku-4-5-20251001, and the error message now tells users to set Effort to none.
  • Resizable left pane. A draggable bar sits between the tree and the code pane, and the width is remembered between runs. A wider tree shows full names.
  • Mouse wheel in AI: Suggest Names. The table now scrolls with the wheel, following the Windows lines-per-notch setting.
  • Resizable AI: Suggest Names window. The table grows with the window, the buttons stay on the bottom edge, and the Why column takes the extra width.

Bug fixes

  • Code window differed from Generate VBP. The code window showed an earlier stage of the code that skipped the cleanup steps Generate VBP runs. In addition, some cleanup steps compared form names case-sensitively, while the tree passes them in uppercase.
  • Applied AI names missing from the code window (Japanese Windows only). The rename step read code through the system code page, so positions drifted after the first Japanese string in a form and no names were replaced. It now reads characters directly and no longer depends on the code page. Syntax colouring had the same problem and is also fixed.
  • Cut-off text in AI Naming Settings. The window has been re-laid out with room for wrapped text and checked in MS UI Gothic. Nothing is cut off now.

Other fixes

- Reopening AI: Suggest Names in a new session no longer shows an empty table when suggestions were saved.
- The code window no longer draws Japanese string literals as Western symbols.
-General improvements to the VB6 engine in certain cases.