ghidralens

v0.1.1
io.github.hellosverre/ghidralens Checked 4 days ago Published 3 months ago

Interactive Ghidra views in your AI client: decompile, rename, and navigate a binary.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_binary Open binary

Load an executable into the Ghidra session and run auto-analysis. Slow the first time for a given file (seconds to minutes); cached in the Ghidra project afterwards. Must be called before anything else.

ParameterTypeDescription
path *stringAbsolute path to the executable
analyzebooleanRun auto-analysis. Only set false if already analysed.

program_info Program info

What is currently open: format, architecture, function count.

decompile Decompile function

Decompile one function to C and show it in an interactive view. Identify the function by address (hex) or by name.

ParameterTypeDescription
addressstringEntry point, e.g. 0x140001000
namestringFunction name, e.g. main

list_functions List functions

Browse the program's functions in a sortable table. Filter by substring; sort by address, name, size or caller count.

ParameterTypeDescription
limitinteger
offsetinteger
querystringCase-insensitive name filter
sortstring

call_graph Call graph

Draw the callers and callees around one function as a navigable graph. Depth is capped at 3 because call graphs fan out exponentially.

ParameterTypeDescription
addressstring
depthinteger
namestring

find_strings Find strings

Search defined string data. Usually the fastest way into an unknown binary - find the message, then look at what references it.

ParameterTypeDescription
limitinteger
querystring

xrefs_to Cross-references

Everything that references an address.

ParameterTypeDescription
address *stringTarget address, e.g. 0x140001000
limitinteger

rename_symbol Rename symbol

Rename a function, or a local variable inside one. Pass old_name to rename a local; omit it to rename the function itself. This is what a click on an identifier in the decompiler view fires.

ParameterTypeDescription
address *stringAddress of the function that owns the symbol
new_name *string
old_namestringCurrent local-variable name. Omit to rename the function.

add_comment Add comment

Attach a plate comment at an address. Persists into the Ghidra project, so notes made here show up in the Ghidra GUI.

ParameterTypeDescription
address *string
text *string

save_program Save program

Write renames and comments back to the Ghidra project on disk. Nothing is lost without this, but nothing is durable with it either.