Skip to content
Projets

À propos

SrcWranglr - A graphical C/C++ source navigator/AAVR Harness

Sécurité et confidentialité

Comment ces chiffres sont mesurés

What you can do

  • Following values through pointer aliases.
  • Richer semantic indexing and search beyond syntax shapes and call behaviors.
  • Collecting useful seed corpora for fuzz targets.
  • More tools for agents (traces, source-to-sink paths, git history, fuzz targets and harnesses), and MCP prompts for explaining a function, triaging a finding, and drafting a rule from a description.

Progression mesurée des étoiles

in 24h
Mise à jour retardée
in 7 days
+14
in 15 days
Mise à jour retardée
in 1 month
Mise à jour retardée

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

SrcWranglr

A self-contained AI-assisted vulnerability-research workbench for C/C++: explore the code, find and confirm memory-safety bugs, and drive them toward an exploit — in one app.

SrcWranglr is a free, MIT-licensed desktop application for vulnerability research in C and C++ projects. Open a folder, pick a symbol, and follow its callers, dependencies, and uses alongside the source. Keep notes as you investigate, trace values across functions, and identify code worth reviewing or fuzzing — then confirm a bug and build toward a proof-of-concept without leaving the app.

Written in Rust with egui and tree-sitter. Inspired by Sourcetrail, with an independent implementation that shares no code with it.

SrcWranglr showing interactive code graphs, linked source, findings, project triage, and fuzz targets

Quick start · An AAVR harness · Features · Proven in the field · Features planned · Limitations · User guide · Algorithms · AI policy

About

I built SrcWranglr to help me understand C/C++ codebases while learning Rust. The core analysis code was written by hand; AI tools have assisted with GUI work, tests, and documentation.

Before the Rust re-write, the project used the working name slurcetrail and was written in Python for a prototype, then C, then I got side tracked by other things.

A self-contained AAVR harness

SrcWranglr is built to run the whole AI-Assisted Vulnerability Research (AAVR) loop in one application — find a candidate, confirm it, and drive it toward a working proof-of-concept — rather than stitching together a pile of separate tools:

  • Find. Interactive graphs and cross references to get oriented, argument-aware checks of about 300 risky functions, a pointer-lifetime engine for use-after-free and double-free, optional Semgrep/cppcheck/flawfinder and imported CodeQL/SARIF, git-history fix leads, and a prompt-injection tripwire.
  • Confirm. A step-through emulator that runs a function over concrete inputs and flags a write past its buffer (CWE-787); an on-demand agent review of a function's memory operations; value traces that show whether input can reach a sink; and fuzz-target ranking by reach-ability and risk.
  • Exploit. Generate editable libFuzzer and AFL++ harnesses with a dictionary of the constants the code compares and a Makefile, then — with the built-in AAVR agent — build and run them under sanitizers, reproduce the crash, and work toward a proof-of-concept, each command gated by your approval.
  • Record & hand off. Notes, bookmarks, a journal, finding verdicts, a shareable audit bundle, a Markdown report, and a diagnostics log — so a whole engagement lives in one place.

Everything runs locally. External analyzers and MCP clients are optional add-ons, not requirements: the graph, the built-in analysis, the emulator, the harness generation, and the agent (with your own model and key) all work on their own.

Proven in the field

SrcWranglr has already helped find real, exploitable memory-safety bugs in well-known open-source C/C++ projects, including:

  • MiniUPnPd — 10 vulnerabilities, including a pre-authentication remote code execution.
  • UnrealIRCd — 2 vulnerabilities, including remote code execution under certain circumstances.

Quick start

Requires Rust 1.95 or newer. Development and testing currently happen on macOS. Linux and Windows are not yet tested.

git clone https://github.com/jdefrancesco/SrcWranglr.git
cd SrcWranglr
cargo run --release --locked

Try the built-in demo from the start page, or choose File → Open Project… and select a C/C++ project folder. You can also open a project directly:

cargo run --release --locked -- ~/code/myproject

Indexing reads source directly; you do not need to build the project or provide a compilation database. It runs in the background, supports cancellation, and respects .gitignore. See limitations for indexing and analysis boundaries.

Semgrep, cppcheck, and flawfinder are optional. Install them separately to use their integrations; the graph, navigation, and built-in analysis work without them. See external analyzers for what each adds, and File → Settings… for tool discovery and editor options.

Features

See how the code fits together

The Trail view keeps the selected symbol in the center, its callers on the left, and what it calls or uses on the right. Members sit inside their class boxes, and large groups show a hidden-item count to keep the view readable.

  • Follow calls, inheritance, type and member uses, and containment.
  • Switch to Call hierarchy to explore a tree of calls from entry points or a function you select. Callees appear in source order, with recursion and additional callers marked.
  • Click a resolved name in the source or a node in the graph to explore it. Step through declaration and use locations, then go back through your navigation history.
  • Press X over any name for IDA-style cross references: every use and call, with the function each is in. It works for library functions like memcpy too.
  • Click any name in the source to highlight it everywhere in the file.
  • Jump to a symbol with fuzzy search, pan and zoom the graph, and open the current location in your preferred editor.

Investigate code and find audit leads

Task What SrcWranglr provides
Review risky calls Argument-aware checks of about 300 C library, POSIX, Windows, Linux kernel, and weak-crypto functions, a custom dangerous-functions list, and findings from Semgrep, cppcheck, and flawfinder. Filter results and record verdicts.
Catch pointer-lifetime bugs An intraprocedural walk tracks each pointer's lifetime and flags a dereference or second free of a freed pointer — use-after-free (CWE-416) and double-free (CWE-415). Branch-aware: certain on every path is high severity, only some paths is medium. Opening the finding shows the pointer's freed-then-used timeline in the function; right-click any function → Pointer Lifetimes to see that matrix on its own. Click any point in a timeline (freed L12, reassigned L13) to jump to that line in the source.
Import CodeQL results Load SARIF reports from CodeQL or any other tool into Findings, with severity, CWE, and verdicts. SrcWranglr never builds your code or runs CodeQL itself.
Follow a value Trace backward to its origin, forward to risky calls, or between a source variable and a call you choose. Each path links to its source lines.
Find related code Draft Semgrep rules from a line, a range of lines, or several places that share a pattern, with exceptions for checks and fixed code. Manage your own and the project's rules in the Semgrep Rules window, which also suggests rules for the project's wrappers of risky calls. Find functions and blocks with similar syntax, or filter functions by library-call behavior.
Choose fuzz targets Rank candidates using input reach-ability, risky calls, complexity, and signatures. Draft editable harnesses for libFuzzer and for AFL++'s persistent mode, with TODOs where manual work is needed, a dictionary of the constants the code compares, and a Makefile that builds them from the files the function needs.
Survey a project Inspect languages, build metadata, function complexity, IPC and capabilities, and ELF/PE/Mach-O binaries with hardening information.
Review past fixes Find commits whose messages suggest bug or security fixes, inspect the lines they still own in the current checkout, and list the CVEs they name, with links to NVD.
Audit a commit range Compare the checkout with a tag, branch or commit: list the changed functions (most findings first), files and commits, mark changed lines in the source, and narrow Findings to the changed code.

Input reach-ability helps prioritize findings. Value traces follow assignments, calls, returns, copies, out-parameters, and struct fields where supported. Both use syntax and heuristics; review the source to establish what a path means.

See the user guide for analysis behavior, examples, tool configuration, and limits.

Bring in external analyzers

SrcWranglr runs these tools on the project and puts their results in Findings, next to its own checks, where you can filter them and record verdicts. Each one is optional. File → Settings… → Tools shows where each was found and how to install it.

Tool How SrcWranglr uses it
Semgrep Analyze → Run semgrep runs offline (no registry, no metrics) with three sets of rules: SrcWranglr's own (use after free, double free, unchecked malloc, realloc leaks, and others), yours in ~/.config/srcwranglr/semgrep/, and the project's in .srcwranglr/semgrep/ once you trust the project. Write, test, and edit rules in Analyze → Semgrep Rules…, or draft them from code with Find More Like This…. A rule is checked with semgrep before it is saved.
cppcheck Analyze → Run cppcheck.
flawfinder Analyze → Run flawfinder.
CodeQL, or any tool that writes SARIF Run CodeQL yourself (codeql database create, then codeql database analyze --format=sarif-latest), then Analyze → Import SARIF Results…. SrcWranglr never builds the project or runs CodeQL, because building runs the project's own build scripts.

The audited code can't silence these tools: SrcWranglr ignores its // nosemgrep, cppcheck-suppress, and Flawfinder: ignore comments, and lists each such comment as a finding of its own.

Install them with brew install semgrep cppcheck flawfinder, or pipx install semgrep flawfinder and your system's cppcheck package.

Drive it with an AAVR agent

The agent is the engine of the harness: it runs the find → confirm → exploit loop over SrcWranglr's own tools, inside the app or from an external client.

  • MCP server: opencode, Claude Code and other MCP clients ask SrcWranglr for symbols, call graphs, cross references, findings and strings instead of grepping and reading whole files (srcwranglr --mcp). With the app open, the agent shares its index, and the Agent pane shows each call as it comes; notes the agent adds appear in Notes.
  • AAVR assessments: start a run of AAVR vulnerability-research skills in opencode from the Agent pane, and follow it there: phases, candidates, attack surfaces, fuzz targets and crashes, each a click from its code. The agent gets tools for each phase: input paths, value traces, fuzz-target ranking, harness drafts with Makefiles, semgrep rule drafts, journal entries and SARIF import. The run's confirmed candidates also appear in the Findings window, tagged AAVR agent so you can tell them from the scanners'. The skills ship in aavr-opencode-skills/ — install them into opencode with ./install.sh there (--skills-only to skip the slash commands), then run /aavr.
  • Run the agent inside SrcWranglr: instead of an external client, set a model and API key in Settings → Agent and click Run in SrcWranglr on the Agent pane — SrcWranglr drives the same AAVR workflow itself. With your approval for each command, it builds the harnesses it drafts, runs them under sanitizers, and reproduces crashes; the live transcript, the command approvals, and a Stop that halts the run and anything it is running are all in the Agent pane. This is the one time SrcWranglr runs code from the tree — see Limitations.
  • Prompt-injection tripwire: comments and strings that read like instructions to an AI (or hide text in invisible characters) are findings. Confirm one and SrcWranglr withholds it from agents; unreviewed ones are marked wherever the agent sees them.

Keep your investigation organized

  • Notes, bookmarks, and TODOs: attach context to symbols and source lines, and browse TODO-style comments already in the code.
  • Journal: keep a dated log of the audit in Markdown (what you did, theories, what to try next), each entry linked back to where you wrote it.
  • Sessions: reopen a project where you left off, or save to a .srcwranglr-session file with ⌘S.
  • Audit bundles: export notes, bookmarks, TODOs, verdicts, and your exploration position to a .srcwranglr-audit file. A teammate can preview and merge it into their own checkout.
  • Strings and documentation: find string literals and their use sites, read project doc comments and Doxygen documentation, look up library functions in system man pages, or click the project's name to read its README, rendered from Markdown.
  • Customizable workspace: arrange panes, choose source themes, symbol-list and top-bar fonts, and configure your editor and tool locations.

Essential controls

Action Control
Open a project ⌘O / Ctrl+O
Find a symbol ⌘P / Ctrl+P
Open the command palette ⌘⇧P / Ctrl+Shift+P
Find calls to a library function ⌘P / Ctrl+P, then !system
Explore a symbol Click it in the graph, symbol list, or linked source
Cross references to a name Point at it in the source and press X
Open an #included header Point at it in the source and press G
Highlight a name in the file Click it in the source; Esc clears
Note on a line Point at a line and press ; (or right-click it → Add Note…) to add or edit a note on that line — it shows as a dot in the gutter and is kept with the project's notes; the source file isn't changed
Return to the previous symbol ◀ Back
Trace a value, find similar code, or show docs Right-click a source line (Shift-click line numbers to pick several)
Manage semgrep rules Analyze → Semgrep Rules…
Open Project Triage ⌘⇧T / Ctrl+Shift+T
Open settings ⌘, / Ctrl+,

See all controls for pane layout, sessions, and analysis actions.

Limitations

SrcWranglr uses tree-sitter for syntax-based indexing and heuristic name resolution. These boundaries matter when interpreting the graph and analysis:

  • Symbol identity: overloads with the same name merge into one symbol. Same-named static functions in different files also merge in the index, which can affect graph relationships and reachability.
  • Language coverage: macros are not expanded and using namespace is not followed. Global variables, enums, and general typedef/using aliases are not indexed yet; named typedef struct declarations are supported. Ambiguous references are left unlinked.
  • Analysis coverage: unresolved indirect calls, function pointers, pointer aliases, and checks that constrain a value are not fully modeled. Reachability can include calls that do not receive the input, and a finding without an input tag is not proven unreachable. A displayed trace describes a possible path, not a confirmed vulnerability.
  • Resource limits: indexing defaults to 100,000 source files and skips files larger than 2 MiB with a warning; raise the per-file limit in Settings → Indexing (up to 1 GiB) to take in large amalgamated or generated sources such as sqlite3.c. Analysis also has time and traversal limits and reports when a trace is cut short.
  • Harness drafts: generated fuzz harnesses need review and may need changes before they compile, particularly around macros, include order, and project-specific types.
  • Running code: SrcWranglr indexes the project and never builds or runs it — with one exception. When the in-app agent asks to run a command and you approve it, that command runs in the project folder, which executes code from the tree you are auditing. Treat an unfamiliar tree as hostile: read each command before approving, and the external MCP server never runs commands at all.

Detailed behavior is documented in the user guide.

Build a package

make package

This builds and packages SrcWranglr for the host platform, placing the results in dist/.

Platform Package Installation
macOS .app bundle and .dmg, ad-hoc signed by default make install copies the app to /Applications
Linux .tar.gz with the binary, desktop entry, and icons make install uses /usr/local by default; supports PREFIX and DESTDIR
Windows .zip; run make from Git Bash or MSYS2 Extract the archive

Packaging support for Linux and Windows is present; those platforms remain untested. See packaging details for signing and other build targets.

Command line

srcwranglr [PROJECT_DIR] [--symbol QUALIFIED_NAME] [--view trail|calls] [--triage]
srcwranglr --mcp [PROJECT_DIR]
srcwranglr --version

For example, open LevelDB at a function in the call hierarchy:

srcwranglr ~/code/leveldb --symbol leveldb::DBImpl::Write --view calls

Use --triage to open the project survey after indexing, and --mcp to serve a project to an AI agent (setup), such as opencode mcp add --global srcwranglr -- /Applications/SrcWranglr.app/Contents/MacOS/srcwranglr --mcp. See the command-line reference for all options.

Development

Run the format check, Clippy, and tests:

make check

Inspect the syntax tree of a C/C++ file:

cargo run --example dump_tree -- path/to/file.cpp

The core pipeline is:

discover files → extract syntax → resolve names → CodeGraph → layout → render

Indexing lives in src/index/, graph layout and rendering in src/graph/, value tracing and analysis in src/analysis/, and application behavior in src/app/. See the source map and development reference for individual modules, headless indexing measurements, and harness export commands. Algorithms explains the techniques behind each feature: name resolution, tracing, input reachability, fuzz-target scoring, code matching, rule drafting, and git history.

Bug reports are especially useful with a small C/C++ example, the expected relationship or trace, the observed result, and your platform. Open an issue.

Features planned

Planned additions include:

  • Following values through pointer aliases.
  • Richer semantic indexing and search beyond syntax shapes and call behaviors.
  • Collecting useful seed corpora for fuzz targets.
  • More tools for agents (traces, source-to-sink paths, git history, fuzz targets and harnesses), and MCP prompts for explaining a function, triaging a finding, and drafting a rule from a description.

AI Policy

This project was ported from software I had been working on years ago. I decided to perform a rewrite in Rust for learning if I am capable of writing real tools in Rust. Oh, also because "Rustaceans" are relentless zealots who pushed it so hard that knowing it has become a requirement for a lot of system development. The cult of Rust can give it a rest now though that us unlikely to happen heheh...

When this project began, the majority of the code was manually written, with AI assisting mainly:

  1. The GUI. Writing UIs isn't something I find thrilling.
  2. Documentation found in the repository.
  3. The Makefile and various helper scripts.
  4. Yak-shaving tasks that consume too much time for a one man army.

As the tool has grown, that balance has shifted. At this point the majority of the code may no longer be hand-written. The core analysis engine still reflects hand-crafted design decisions, but AI now does much of the actual authoring.

That being said, blind usage of LLMs aren't acceptable. AI has become very useful but I am a strong believer that humans need to be driving and crafting a deep understanding of their code. Prototyping, helping debug difficult problems, and security review are also acceptable uses of LLMs. So please, if you plan to contribute use AI as a tool and exercise discretion. AI Slop can easily derail otherwise awesome project,

Acknowledgements

License

MIT © 2026 Joseph DeFrancesco

Explorer des projets similaires

Chargement…