# VB Decompiler: C# Optimizer, FRX Image Viewer Plugin, NVDA Accessibility

> VB Decompiler v26.1 introduces an advanced C# procedure optimizer with loop and if/else reconstruction, a new FRX Image Viewer plugin for VB6 embedded resources, full NVDA screen reader support, and bug fixes.

Canonical HTML: <https://www.vb-decompiler.org/vb_decompiler_261.htm>

## Advanced C# Optimizer, FRX Image Viewer, and Accessibility Overhaul in VB Decompiler v26.1


We are pleased to announce the release of [VB Decompiler](https://www.vb-decompiler.org/products.htm) version 26.1. This is a major feature update that delivers a deeply reworked C# code optimizer, a brand-new built-in plugin, full NVDA screen reader compatibility, and a wide range of stability and usability improvements.

### Next-Generation C# Procedure Optimizer


The most significant technical achievement in version 26.1 is the all-new **procedure analyzer and optimizer for C# code**. It operates on decompiled output from any .NET language - C#, VB .NET, F#, and others. And transforms raw, compiler-generated IL patterns into clean, human-readable C# source.

#### Loop Reconstruction


Raw decompiled .NET code is full of `goto` statements and labels that represent structured loops in the original source. The optimizer now fully reconstructs these patterns:

- **while loops** - detected and reconstructed from `goto`/label patterns.

- **do-while loops** - correctly identified even when the condition variable is declared inside the loop body.

- **foreach loops** - rebuilt from the full `GetEnumerator` / `MoveNext` / `Dispose` scaffolding, including `try/finally` wrappers generated by the compiler.

- **Nested loops** - while-in-while, while-in-foreach, while-in-if combinations are all emitted correctly inline.

- **Loop condition inlining** - intermediate temporary variables assigned just before a loop test are folded directly into the `while` header, eliminating clutter.

![Side-by-side comparison: raw goto-based loop vs reconstructed while and foreach loops](https://www.vb-decompiler.org/image/vb_decompiler_261/vb_decompiler_261_cs_code_optimizer.png)

#### If/Else Reconstruction


Conditional branches expressed as chains of `goto` instructions are now rebuilt into proper **if/else** structures:

- Standard **if/else chains** reconstructed from conditional goto patterns.

- **Negated conditions normalized** - operator method calls such as `op_Equality` and `op_Inequality` are replaced with their readable equivalents (`==`, `!=`).

- **Filter goto chains** - multiple chained if+goto sequences targeting the same label are preserved correctly when the resulting body would be empty, always maintaining semantic correctness over visual tidiness.

![If ... Else Reconstruction](https://www.vb-decompiler.org/image/vb_decompiler_261/vb_decompiler_261_while_loops.png)

#### Expression Optimization


The optimizer now handles a wide range of expression-level patterns that previously remained in verbose compiler form:

- Arithmetic and comparison **operator methods inlined** (`op_Addition` → `+`, `op_GreaterThan` → `>`, etc.).

- **Modulo operator reconstructed** from div/mul/sub instruction sequences.

- **Boolean short-circuit patterns** recognized and simplified.

- Method calls without arguments have **parentheses normalized** (`.Trim` → `.Trim()`).

- **Interpolated string handlers** (`DefaultInterpolatedStringHandler`) collapsed into readable string concatenation expressions.

![Decompiled C# code before and after expression optimization showing operator inlining and string handler collapsing](https://www.vb-decompiler.org/image/vb_decompiler_261/vb_decompiler_261_expression_optimization.png)

#### Variable and Structural Cleanup


Beyond individual expressions, the optimizer now cleans up the overall structure of decompiled procedures:

- **Orphan return variables eliminated** - simple temporaries used only to hold a return value are removed; field access, array access, and method call results are always preserved.

- **Redundant condition variable copies** removed from loop bodies.

- `try/finally/catch` **blocks preserved** and correctly indented.

- **foreach scaffolding removed** - `GetEnumerator`, `Current`, `MoveNext`, and `Dispose` calls are stripped once the loop is reconstructed.

- **Label-only lines and dead reference comments** stripped from output.

- **Unreachable goto statements** eliminated where the target is the next sequential instruction.

### New Plugin: FRX Image Viewer


VB6 applications store embedded resources (images, icons, and cursors) in binary **.FRX** files alongside each form. Until now, inspecting these assets required external tools or manual hex parsing. Version 26.1 ships with the new **FRX Image Viewer** plugin that makes this effortless.


The plugin is accessible directly from the **Plugins** menu and provides:

- **Thumbnail preview** of all embedded images, icons, and cursors found in the target application.

- **Automatic format detection** for BMP, PNG, JPEG, GIF, ICO, and CUR resources - no manual configuration needed.

- **Multi-resolution icon parsing**, so every size variant stored inside a `.ICO` file is individually accessible.

- **One-click export** to save any asset to disk in its native format.

- Full **dark mode** support, consistent with the rest of the VB Decompiler interface.


The plugin's source code is available for free on GitHub:
[https://github.com/DotFixSoft/frxviewer](https://github.com/DotFixSoft/frxviewer)

![FRX Image Viewer plugin showing thumbnail grid of embedded VB6 images and icons](https://www.vb-decompiler.org/image/vb_decompiler_261/vb_decompiler_261_frx_image_viewer.png)

### Accessibility and Keyboard Navigation


Version 26.1 brings a comprehensive accessibility overhaul, making VB Decompiler fully usable with **NVDA** and other screen readers, and significantly more efficient via keyboard alone.

- **Project Tree - Enter key support:** Pressing **Enter** on a selected node in the Project Tree now opens the corresponding form, module, or procedure in the active viewer, just as a double-click would.

- **New Alt+1 hotkey:** Instantly toggles focus between the **Project Tree** and the currently active view - whether that is the Decompiler/Disassembler code editor, Hex Editor, Form properties panel, or any other pane. This eliminates the need to Tab through every control to switch context.

- **Hex Editor Tab navigation fixed:** Pressing **Tab** inside the Hex Editor now correctly cycles between the Hex view and Text view, then cleanly exits the control to the next UI element - previously, focus was trapped inside the editor.

- **Screen reader label linking:** UI text labels throughout the application are now strictly linked to their corresponding input fields and comboboxes, ensuring screen readers announce the correct context for every control.

![VB Decompiler interface showing Project Tree focus and Alt+1 hotkey navigation between panels](https://www.vb-decompiler.org/image/vb_decompiler_261/vb_decompiler_261_accessibility_keyboard.png)

### Improved .NET IL Opcode Coverage


Version 26.1 extends C# decompilation support to three additional MS IL opcodes: **constrained.**, **rem**, and **rem.un**. These opcodes appear in constrained virtual method calls and integer/unsigned remainder operations. They were previously left as raw IL in the output; they are now correctly translated into their C# equivalents.

### Stability Fix: Obfuscated .NET Procedures


The internal function responsible for handling **local variables in .NET procedures** has been completely rewritten. The previous implementation could crash when processing heavily obfuscated files that contain deliberately incorrect local variable declarations - a common anti-decompilation technique. The new implementation handles these edge cases gracefully, eliminating crashes on such files.

### Variable Highlighting Improvements


Variable highlighting in the code view has been unified. Previously, clicking a variable highlighted its explicit occurrences but might miss related uses when the variable appeared as part of a structure or object member access. Now, **var_XX and str_XX variables** are treated identically: clicking any variable highlights all locations where it is used, including as a structure base or object qualifier. For example, clicking `str_1` will also highlight `str_1.Value`.

### Bug Fixes

- **AI Helper control layout:** The position of controls on the AI Helper tab is now correctly adjusted even when the application window size has not changed since the previous launch.

- **AI Helper default mode:** If the registry contains incorrect or corrupt settings for the AI Helper, the application now safely defaults to **LLM mode** instead of entering an undefined state.

March 8, 2026

© Sergey Chubchenko, [VB Decompiler](https://www.vb-decompiler.org/products.htm) main developer

Visual Basic, Visual Studio, and Windows are registered trademarks of Microsoft Corporation.

### Related reading

- [Decompiling .NET applications to C# code, Dark Theme and Mac M1 support in VB Decompiler 12.1](https://www.vb-decompiler.org/vb_decompiler_121.htm)

- [New features and improvements in VB6 and C# .NET decompilation and completely revised documentation in VB Decompiler 12.4](https://www.vb-decompiler.org/vb_decompiler_124.htm)

- [Deeper Native Code Intelligence in VB Decompiler v26.2](https://www.vb-decompiler.org/vb_decompiler_262.htm)
