Symbol System Overview
Symbols provide human-readable names for addresses, functions, and data throughout the program.The
SymbolTreePlugin and SymbolTablePlugin provide comprehensive symbol management through tree and table views.Symbol Types
- Labels
- Functions
- Parameters
- Local Variables
- Global Variables
- Namespaces
Named locations in code:
- Entry points
- Jump targets
- Data locations
- User-defined markers
Symbol Tree
Opening Symbol Tree
Open Window
Access symbol tree:
Window>Symbol Tree- Default: docked on left
- Hierarchical symbol view
Navigating Symbol Tree
Expand Nodes
Explore hierarchy:
- Click triangles to expand
- Double-click to navigate to symbol
- Shows child symbols
- Group threshold: 200 symbols (configurable)
Symbol Table
Symbol Table Window
Open Table View
Access symbol table:
Window>Symbol Table- Tabular display of all symbols
- Sortable and filterable
Use Columns
Table displays:
- Name: Symbol name
- Location: Address
- Type: Symbol type
- Namespace: Containing namespace
- Source: Origin (user, analysis, import)
- References: Reference count
Creating Symbols
Creating Labels
Label names must be unique within their namespace. Ghidra will warn if a duplicate name is used.
Symbol Naming Rules
Valid symbol names:- Start with letter or underscore
- Contain letters, digits, underscores
- No spaces (use underscores)
- Case-sensitive
- Should be descriptive
Auto-Generated Symbols
Ghidra creates default symbols:FUN_<address>for functionsDAT_<address>for dataLAB_<address>for labelsSUB_<address>for subroutines
Renaming Symbols
Interactive Rename
Rename Action
Execute rename:
- Press
Lon existing label - Right-click >
Rename - In Symbol Tree: right-click >
Rename Symbol
Batch Renaming
Rename multiple symbols:- Use
BatchRename.javascript - Pattern-based renaming
- Regular expression support
- Bulk operations
Symbol Sources
Symbols have source types:- User Defined
- Imported
- Analysis
- Default
Manually created:
- Highest priority
- User-specified names
- Won’t be auto-renamed
Symbol source determines priority - user symbols won’t be overwritten by analysis.
Namespaces
Understanding Namespaces
Namespaces organize symbols hierarchically:- Global: Top-level namespace
- Libraries: External library symbols
- Classes: C++ classes, structures
- Functions: Function-scoped symbols
- Custom: User-defined namespaces
Creating Namespaces
Create Namespace
Add new namespace:
- Right-click in Symbol Tree
Create Namespace- Enter namespace name
Namespace Notation
Fully qualified names:- Format:
namespace::symbol - Example:
MyClass::myFunction - Multiple levels:
Lib::Module::Function - Global namespace:
::symbol
Symbol Operations
Deleting Symbols
Deleting a function symbol also deletes the function definition, but not the code itself.
Pinning Symbols
Prevent symbol changes:Symbol Analysis
Symbol Analyzers
- ARM Symbol Analyzer
- Golang Symbol Analyzer
- External Symbol Resolver
ArmSymbolAnalyzer:- ARM-specific symbol detection
- Thumb mode symbols
- ARM/Thumb transitions
Auto-Rename Operations
Scripts for symbol cleanup:Auto Rename Labels
Use naming scripts:
AutoRenameLabelsScript.java: Sophisticated renamingAutoRenameSimpleLabels.java: Simple patterns- Creates meaningful names from context
Symbol Search
Finding Symbols
Search in Table
Use symbol table filter:
- Open Symbol Table window
- Type in filter bar
- Supports wildcards
- Results update live
Symbol References
Viewing Symbol Usage
Show References
See where symbol is used:
- Right-click symbol >
References>Show References to - Lists all uses
- Code and data references
Symbol Import/Export
Importing Symbols
Import Symbol File
Load external symbols:
File>Import File- Select symbol file format
- Map file, symbol file, etc.
Exporting Symbols
Symbol Tree Service
Programmatic symbol access:Special Symbol Operations
Symbol Quotes
Handling special characters:- Some imports have quoted names
- Use
RemoveSymbolQuotesScript.javato clean - Improves readability
Primary Symbols
Multiple symbols at same address:- One symbol is “primary”
- Primary shown in listing
- Others accessible via references
- Set via symbol properties
The primary symbol is the default display name for an address. Non-primary symbols are alternate names.
