Package ghidra.app.cmd.memory

# Class AddInitializedMemoryBlockCmd

java.lang.Object
ghidra.app.cmd.memory.AddInitializedMemoryBlockCmd

All Implemented Interfaces:
  `Command`

public class AddInitializedMemoryBlockCmd extends Object
Command for adding a new memory block initialized with a specific byte.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `comment`
  `protected final boolean`
  `execute`
  `protected final boolean`
  `isOverlay`
  `protected final boolean`
  `isVolatile`
  `protected final long`
  `length`
  `protected String`
  `message`
  `protected final String`
  `name`
  `protected final boolean`
  `read`
  `protected final String`
  `source`
  `protected final Address`
  `start`
  `protected final boolean`
  `write`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AddInitializedMemoryBlockCmd(String name, String comment, String source, Address start, long length, boolean read, boolean write, boolean execute, boolean isVolatile, byte initialValue, boolean isOverlay)`
  Create a new AddFileBytesMemoryBlockCmd

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(DomainObject obj)`
  Applies the command to the given domain object.
  `protected MemoryBlock`
  `createMemoryBlock(Memory memory)`
  `String`
  `getName()`
  Returns the name of this command.
  `String`
  `getStatusMsg()`
  Returns the status message indicating the status of the command.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### message

    protected String message

  - ### name

    protected final String name

  - ### comment

    protected final String comment

  - ### source

    protected final String source

  - ### start

    protected final Address start

  - ### length

    protected final long length

  - ### read

    protected final boolean read

  - ### write

    protected final boolean write

  - ### execute

    protected final boolean execute

  - ### isVolatile

    protected final boolean isVolatile

  - ### isOverlay

    protected final boolean isOverlay

- ## Constructor Details

  - ### AddInitializedMemoryBlockCmd

    public AddInitializedMemoryBlockCmd(String name, String comment, String source, Address start, long length, boolean read, boolean write, boolean execute, boolean isVolatile, byte initialValue, boolean isOverlay)
    Create a new AddFileBytesMemoryBlockCmd
    Parameters:
      `name` - the name for the new memory block.
      `comment` - the comment for the block
      `source` - indicates what is creating the block
      `start` - the start address for the the block
      `length` - the length of the new block
      `read` - sets the block's read permission flag
      `write` - sets the block's write permission flag
      `execute` - sets the block's execute permission flag
      `isVolatile` - sets the block's volatile flag
      `initialValue` - the bytes value to use throught the new block.
      `isOverlay` - if true, the block will be created in a new overlay address space.

- ## Method Details

  - ### createMemoryBlock

    protected MemoryBlock createMemoryBlock(Memory memory) throws LockException, MemoryConflictException, AddressOverflowException, CancelledException
    Throws:
      `LockException`
      `MemoryConflictException`
      `AddressOverflowException`
      `CancelledException`

  - ### getStatusMsg

    public String getStatusMsg()
    Description copied from interface: `Command`
    Returns the status message indicating the status of the command.
    Specified by:
      `getStatusMsg` in interface `Command`
    Returns:
      reason for failure, or null if the status of the command was successful

  - ### getName

    public String getName()
    Description copied from interface: `Command`
    Returns the name of this command.
    Specified by:
      `getName` in interface `Command`
    Returns:
      the name of this command

  - ### applyTo

    public boolean applyTo(DomainObject obj)
    Description copied from interface: `Command`
    Applies the command to the given domain object.
    Specified by:
      `applyTo` in interface `Command`
    Parameters:
      `obj` - domain object that this command is to be applied.
    Returns:
      true if the command applied successfully