Repository iconcurepo.dev
LibreCode preview

re4 / LibreCode

aiai-agentscodingcsharp

LibreCode - A Ollama cursor like coding / Reversing Interface

20.9k Stars
visibility0 Watchers
fork_right2 Forks
C#
historyUpdated recently

description README.md

LibreCode

A free, open-source AI-powered code editor built from the ground up with .NET 10 and Avalonia UI. Runs natively on Windows, Linux, and macOS -- no Electron, no web views, just fast native rendering.

LibreCode pairs a full-featured code editor with a local AI assistant powered by Ollama, a built-in terminal, a model marketplace, and a serious reverse engineering toolkit for both .NET assemblies and WebAssembly binaries -- including live browser debugging over Chrome DevTools Protocol.


Why LibreCode?

Most AI-powered editors are either closed-source, browser-based, or tied to cloud APIs. LibreCode is different:

  • 100% local AI -- your code never leaves your machine. Runs against any Ollama model you have installed.
  • Truly cross-platform -- native Avalonia UI, not a web wrapper. Starts fast, stays fast.
  • Built for hackers -- ships with .NET, WASM, and ELF (.so) reversing toolkits (decompiler, IL/WAT/x86-64 disassembly, hex editor, PE/ELF inspectors, step-through debuggers, live CDP debugging, Harmony patch generation, OLLVM deobfuscation, cross-module stealth/anti-debug analysis) alongside a modern code editor.
  • No telemetry, no accounts, no subscriptions.

Features

Code Editor

  • Syntax highlighting for 25+ languages via TextMate grammars (Dark+ theme)
  • Keyword autocomplete popup as you type (Python, C#, JS/TS, Go, Rust, Java, C/C++, HTML, CSS, SQL, Shell, and more)
  • Smart auto-indentation -- copies previous line indent and adds a level after {, :, (, [
  • Multi-tab editing with dirty-file indicators
  • Line numbers, monospace font rendering, and a welcome screen when no files are open
  • Ctrl+S to save

File Explorer

  • Open any project folder and browse the full directory tree
  • Create new files and folders, rename, delete
  • Right-click context menu with "Run in Terminal" option
  • File watcher automatically refreshes the tree when files change on disk

AI Assistant

Four interaction modes, all powered by your local Ollama instance:

  • Ask -- get answers to coding questions with context from your codebase
  • Agent -- autonomous coding agent that can read files, write files, search your project, and run shell commands in a loop until the task is done
  • Plan -- have the AI plan out an implementation approach before writing code
  • Debug -- paste errors and get debugging help

The AI automatically pulls in relevant code context using codebase embeddings (RAG). It indexes your project files, chunks them, generates embeddings via Ollama, and uses cosine similarity search to inject the most relevant snippets into every conversation.

Custom rules let you set persistent instructions that the AI always follows (e.g., "always use TypeScript", "prefer functional style").

Built-in Terminal

  • Integrated terminal panel (toggle with Ctrl+`)
  • Auto-detects PowerShell (pwsh or powershell.exe) on Windows with PSReadLine tab completion
  • Opens in your project directory by default
  • Resizable with a drag splitter

Model Marketplace

  • Browse the full Ollama model library without leaving the editor
  • Search models by name
  • See model descriptions, parameter counts, variant tags, and estimated VRAM requirements
  • GPU detection shows your available VRAM so you know what will fit

Reverse Engineering Toolkit

The Reverse tab is split into three formats -- .NET, WASM, and ELF -- each with their own file picker and sub-tabs. You flip between them with a single click.

.NET Reversing

Powered by the same decompilation engine as ILSpy/dnSpy:

  • C# Decompiler -- load any .dll or .exe and browse the full decompiled source. Navigate by namespace and class, click to decompile individual types.
  • IL Disassembler -- raw IL bytecode for the entire module or per-type.
  • PE Inspector -- PE headers, sections, CLR metadata, assembly references, the works.
  • String Search -- scan the user strings heap for hardcoded strings, URLs, keys, credentials. Real-time filtering.
  • Hex Viewer -- page through raw bytes with offset, hex, and ASCII columns. Jump to any offset.
  • IL Debugger -- step through .NET IL instructions one at a time. Pick a method, set breakpoints, and watch the evaluation stack and local variables change as you step. It simulates the CLR execution engine so you can understand exactly what a method does at the bytecode level without actually running it.
  • Harmony Patch Generator -- pick any method from the type/method tree and instantly get a ready-to-compile HarmonyLib patch class. Emits [HarmonyPatch] with the correct typeof/argument-type matching, and prefix/postfix/transpiler/finalizer stubs wired up with the right injected parameters (__instance, __result, by-ref args) for that exact signature — toggle which patch methods you want and copy it straight into your patch assembly.
  • AI Analysis -- send decompiled code to the AI for vulnerability analysis, obfuscation detection, anti-debugging pattern recognition, and control flow review.

WASM Reversing

A zero-dependency WebAssembly binary analysis toolkit built from scratch:

  • WAT Disassembly -- full disassembly of every function in WebAssembly Text format. Browse functions in a tree, click to see the instruction listing.
  • Module Info -- high-level overview of the binary: version, function/import/export/global/table/memory/data segment counts, section layout.
  • Imports & Exports -- split-pane view of everything the module imports and exports, with kind and type info.
  • String Search -- extract strings from WASM data segments with offset and segment index.
  • Hex Viewer -- same hex/ASCII pager as the .NET side, but for .wasm files.
  • WASM Debugger -- step-through interpreter for WASM bytecode. Select a function, set breakpoints on instruction indices, and single-step through execution. Watch the operand stack grow and shrink, inspect local variables, and see output in real time. Covers ~200 opcodes.
  • CDP Live Debugger -- connect to a real browser instance over Chrome DevTools Protocol and debug WASM running in the wild. Discover targets, attach to a tab, pause/resume/step over/step into/step out, set breakpoints on WASM scripts by line and column, evaluate expressions in the paused frame context, inspect scope variables and the call stack, read WASM linear memory, and watch console output -- all from inside LibreCode. Just launch Chrome or Edge with --remote-debugging-port=9222 and hit Discover.
  • AI Analysis -- send disassembled WASM functions to the AI for the same deep analysis you get on the .NET side.

ELF / .so Reversing

Native shared object analysis for Linux and Android libraries:

  • Disassembly -- browse function symbols (filterable), click to disassemble. x86 and x86-64 code is fully disassembled via Iced; other architectures (ARM, AArch64, RISC-V, ...) show an annotated hex dump of the function bytes. Stripped binaries fall back to whole-section disassembly.
  • Module Info -- ELF header (class, endianness, OS/ABI, machine, type, entry point), dynamic linking info (SONAME, interpreter, RunPath, needed libraries), symbol statistics, full section and program header tables.
  • Symbols -- split-pane view of the dynamic symbol interface: imports (undefined symbols) on top, exports (defined global/weak symbols) with address, size, type, and section below.
  • String Search -- extract printable strings from all sections with offset and section name. Works even on binaries with stripped section tables.
  • Hex Viewer -- same hex/ASCII pager as the other formats, but for .so/.elf files.
  • OLLVM Deobfuscation -- scan an x86/x86-64 function for Obfuscator-LLVM artifacts. Builds a basic-block control-flow graph and detects the three classic passes: control-flow flattening (locates the dispatcher bl