Skip to main content
The Listing interface provides all the methods needed to create, delete, retrieve, and modify code level constructs including CodeUnits, Instructions, Data, and Functions.

Overview

The Listing is the central component for working with disassembled code and data. It provides:
  • Code Units - Instructions, defined data, and undefined data
  • Instructions - Disassembled processor instructions
  • Data - Typed data elements
  • Functions - Function creation and management
  • Comments - Code annotations

Code Unit Access

Get Code Units

CodeUnit
Returns the code unit that starts at the given address.
CodeUnit
Returns the code unit that contains the given address.
CodeUnit
Returns the next code unit starting after the given address.
CodeUnit
Returns the previous code unit starting before the given address.

Iterate Code Units

CodeUnitIterator
Returns an iterator over all code units in the program.
CodeUnitIterator
Returns an iterator starting at the specified address.
CodeUnitIterator
Returns an iterator over code units within the given address set.

Instruction Access

Get Instructions

Instruction
Returns the instruction that starts at the given address, or null if none exists.
Instruction
Returns the instruction that contains the given address.
Instruction
Returns the next instruction after the given address.
Instruction
Returns the previous instruction before the given address.

Iterate Instructions

InstructionIterator
Returns an iterator over all instructions in the program.
InstructionIterator
Returns an iterator starting at the specified address.
InstructionIterator
Returns an iterator over instructions within the given address set.

Data Access

Get Data

Data
Returns the data (defined or undefined) that starts at the given address.
Data
Returns the data object that contains the given address.
Data
Returns the next data object after the given address.
Data
Returns the previous data object before the given address.

Get Defined Data

Data
Returns the defined data that starts at the given address, or null if no defined data exists.
Data
Returns the defined data containing the given address.
Data
Returns the next defined data after the given address.
Data
Returns the previous defined data before the given address.

Iterate Data

DataIterator
Returns an iterator over all data (defined and undefined) in the program.
DataIterator
Returns an iterator over only defined data in the program.

Creating Code Units

Create Instructions

Instruction
Creates a new instruction at the given address.
Throws CodeUnitInsertionException if the new instruction would overlap an existing CodeUnit.

Create Data

Data
Creates a new defined data object at the given address.
Data
Creates a new defined data object with a specified length.

Clearing Code Units

void
Clears any code units in the given range, returning everything to undefined bytes.
void
Clears code units with cancellation support.
boolean
Checks if the given range consists entirely of undefined data.

Comments

Get Comments

String
Returns the comment of the specified type at the given address.Comment types: EOL, PRE, POST, PLATE, REPEATABLE
CodeUnitComments
Returns all comments at the given address.

Set Comments

void
Sets a comment at the specified address.

Iterate Comments

AddressIterator
Returns an iterator over addresses that have the specified comment type.

Function Management

Create Functions

Function
Creates a function with an entry point and body.
Function
Creates a function in the specified namespace.

Get Functions

Function
Returns the function at the given entry point.
Function
Returns the function containing the given address.
List<Function>
Returns all global functions with the given name.

Iterate Functions

FunctionIterator
Returns an iterator over all functions.
FunctionIterator
Returns an iterator over functions with entry points in the address set.

Remove Functions

void
Removes the function at the given entry point.

Statistics

long
Returns the total number of code units in the listing.
long
Returns the total number of instructions in the listing.
long
Returns the total number of defined data objects in the listing.

Example Usage

Analyzing Instructions

Working with Data

Package Location