Skip to content

Add structure/enum management and fix variable renaming#110

Open
blinkysc wants to merge 1 commit intoLaurieWired:mainfrom
blinkysc:dev
Open

Add structure/enum management and fix variable renaming#110
blinkysc wants to merge 1 commit intoLaurieWired:mainfrom
blinkysc:dev

Conversation

@blinkysc
Copy link

Summary

  • Adds 9 new MCP tools for managing Ghidra data types (structs and enums)
  • Fixes variable renaming to work reliably on first attempt

New Tools

Structure management:

  • create_struct - Create new structure data types
  • add_struct_field - Add fields to structures
  • list_structs - List all defined structures
  • get_struct - Get structure details with all fields
  • delete_struct - Delete a structure

Enum management:

  • create_enum - Create new enum data types
  • add_enum_value - Add values to enums

Other:

  • apply_struct_at_address - Apply a structure type at a memory address
  • list_types - List all data types, optionally filtered by category

Variable Renaming Fix

The rename_variable tool was unreliable because decompiler-generated variable names (like uVar1, local_10) weren't in the database until explicitly committed. Fixed by calling HighFunctionDBUtil.commitLocalNamesToDatabase() before attempting renames.

New MCP tools for data type management:
- create_struct, add_struct_field, list_structs, get_struct, delete_struct
- create_enum, add_enum_value
- apply_struct_at_address, list_types

Fixed variable renaming to work reliably by committing decompiler
local names to database before attempting renames.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant