Program interface is the main entry point into an object which stores all information relating to a single program. This program model divides a program into four major parts: the memory, the symbol table, the equate table, and the listing.
Overview
The Program interface provides access to all major components of a Ghidra program, including:- Memory - Binary data and memory organization
- Listing - Code units, instructions, and data
- Symbol Table - Named locations and references
- Functions - Function definitions and signatures
- Data Types - Type information and structures
Although the components are divided into separate objects, they are not independent. Any changes to one component may affect other components.
Core Methods
Getting Program Components
Returns the listing object for accessing code units, instructions, and data.
Returns the memory object for reading and writing program bytes.
Returns the symbol table for managing symbols and references.
Returns the function manager for working with functions.
Returns the program’s datatype manager.
Returns the reference manager for managing cross-references.
Program Metadata
Returns the name of the program.
Returns the path to the program’s executable file (e.g.,
/home/user/foo.exe).Returns the original file format (e.g., “PE”, “ELF”).
Returns the MD5 hash of the original binary file.
Returns the SHA256 hash of the original binary file.
Returns the creation date of this program.
Sets the path to the program’s executable file.
Language and Compiler
Returns the language used by this program (e.g., x86:LE:64:default).
Returns the compiler specification currently used by this program.
Returns the language ID.
Gets the name of the compiler believed to have been used to create this program.
Sets the name of the compiler which created this program.
Address Information
Returns the program’s minimum address, or null if no memory blocks are defined.
Returns the program’s maximum address, or null if no memory blocks are defined.
Returns the current program image base address within default space.
Returns an array of memory addresses that could correspond to the given string.Supported formats:
- Memory block-name based (e.g., ‘MyBlk:abcd’, ‘MyBlk::abcd’)
- Default memory space (e.g., ‘abcd’, ‘0xabcd’)
- Memory space-name based (e.g., ‘ram:abc’)
Returns the AddressFactory for this program.
Registers
Returns the register with the given name.
Returns the largest register located at the specified address.
Returns all registers located at the specified address.
Namespace Management
Returns the global namespace for this program.
Program Context
Returns the program context for managing processor context registers.
Gets the default pointer size in bytes.
Example Usage
Basic Program Navigation
Reading Program Data
Package Location
Related Interfaces
- Listing API - Code unit access
- Memory API - Memory operations
- Symbol Table API - Symbol management
- Data Types API - Type system
Constants
Options name for storing program information:
"Program Information"Property name for creation date:
"Date Created"Boolean analyzed property name:
"Analyzed"Maximum number of operands for any assembly language:
16