Package ghidra.program.database.mem
Class MemoryMapDBAdapterV3
- java.lang.Object
-
- ghidra.program.database.mem.MemoryMapDBAdapterV3
-
public class MemoryMapDBAdapterV3 extends java.lang.Object
MemoryMap adapter for version 3. This version introduces the concept of sub memory blocks and FileBytes
-
-
Field Summary
Fields Modifier and Type Field Description static int
COMMENTS_COL
static int
LENGTH_COL
static int
NAME_COL
static int
PERMISSIONS_COL
static int
SEGMENT_COL
static int
SOURCE_COL
static int
START_ADDR_COL
static java.lang.String
SUB_BLOCK_TABLE_NAME
static int
SUB_INT_DATA1_COL
Subblock record int data1 usage:BufferSubMemoryBlock
- data buffer IDFileBytesSubMemoryBlock
- file bytes layered data buffer IDByteMappedSubMemoryBlock
- encoded byte mapping schemeBitMappedSubMemoryBlock
- (not used) 0UninitializedSubMemoryBlock
- (not used) 0static int
SUB_LENGTH_COL
static int
SUB_LONG_DATA2_COL
Subblock record long data2 usage:BufferSubMemoryBlock
- (not used) 0FileBytesSubMemoryBlock
- starting byte offset within file bytes bufferByteMappedSubMemoryBlock
- encoded mapped source addressBitMappedSubMemoryBlock
- encoded mapped source addressUninitializedSubMemoryBlock
- (not used) 0static int
SUB_PARENT_ID_COL
static int
SUB_START_OFFSET_COL
static byte
SUB_TYPE_BIT_MAPPED
static byte
SUB_TYPE_BUFFER
static byte
SUB_TYPE_BYTE_MAPPED
static int
SUB_TYPE_COL
static byte
SUB_TYPE_FILE_BYTES
static byte
SUB_TYPE_UNITIALIZED
static java.lang.String
TABLE_NAME
static int
V3_COMMENTS_COL
static int
V3_LENGTH_COL
static int
V3_NAME_COL
static int
V3_PERMISSIONS_COL
static int
V3_SEGMENT_COL
static int
V3_SOURCE_COL
static int
V3_START_ADDR_COL
static int
V3_SUB_INT_DATA1_COL
static int
V3_SUB_LENGTH_COL
static int
V3_SUB_LONG_DATA2_COL
static int
V3_SUB_PARENT_ID_COL
static int
V3_SUB_START_OFFSET_COL
static byte
V3_SUB_TYPE_BIT_MAPPED
static byte
V3_SUB_TYPE_BUFFER
static byte
V3_SUB_TYPE_BYTE_MAPPED
static int
V3_SUB_TYPE_COL
static byte
V3_SUB_TYPE_FILE_BYTES
static byte
V3_SUB_TYPE_UNITIALIZED
static int
V3_VERSION
-
Constructor Summary
Constructors Constructor Description MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MemoryBlockDB
createBlock(java.lang.String name, Address startAddress, long length, int permissions, java.util.List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks)
Creates a new memory block.protected MemoryBlockDB
createFileBytesBlock(java.lang.String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions)
Creates a new memory block using a FileBytesprotected void
updateSubBlockRecord(DBRecord record)
Updates the sub memory block record.
-
-
-
Field Detail
-
V3_VERSION
public static final int V3_VERSION
- See Also:
- Constant Field Values
-
TABLE_NAME
public static final java.lang.String TABLE_NAME
- See Also:
- Constant Field Values
-
SUB_BLOCK_TABLE_NAME
public static final java.lang.String SUB_BLOCK_TABLE_NAME
- See Also:
- Constant Field Values
-
V3_NAME_COL
public static final int V3_NAME_COL
- See Also:
- Constant Field Values
-
V3_COMMENTS_COL
public static final int V3_COMMENTS_COL
- See Also:
- Constant Field Values
-
V3_SOURCE_COL
public static final int V3_SOURCE_COL
- See Also:
- Constant Field Values
-
V3_PERMISSIONS_COL
public static final int V3_PERMISSIONS_COL
- See Also:
- Constant Field Values
-
V3_START_ADDR_COL
public static final int V3_START_ADDR_COL
- See Also:
- Constant Field Values
-
V3_LENGTH_COL
public static final int V3_LENGTH_COL
- See Also:
- Constant Field Values
-
V3_SEGMENT_COL
public static final int V3_SEGMENT_COL
- See Also:
- Constant Field Values
-
V3_SUB_PARENT_ID_COL
public static final int V3_SUB_PARENT_ID_COL
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_COL
public static final int V3_SUB_TYPE_COL
- See Also:
- Constant Field Values
-
V3_SUB_LENGTH_COL
public static final int V3_SUB_LENGTH_COL
- See Also:
- Constant Field Values
-
V3_SUB_START_OFFSET_COL
public static final int V3_SUB_START_OFFSET_COL
- See Also:
- Constant Field Values
-
V3_SUB_INT_DATA1_COL
public static final int V3_SUB_INT_DATA1_COL
- See Also:
- Constant Field Values
-
V3_SUB_LONG_DATA2_COL
public static final int V3_SUB_LONG_DATA2_COL
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BIT_MAPPED
public static final byte V3_SUB_TYPE_BIT_MAPPED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BYTE_MAPPED
public static final byte V3_SUB_TYPE_BYTE_MAPPED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_BUFFER
public static final byte V3_SUB_TYPE_BUFFER
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_UNITIALIZED
public static final byte V3_SUB_TYPE_UNITIALIZED
- See Also:
- Constant Field Values
-
V3_SUB_TYPE_FILE_BYTES
public static final byte V3_SUB_TYPE_FILE_BYTES
- See Also:
- Constant Field Values
-
NAME_COL
public static final int NAME_COL
- See Also:
- Constant Field Values
-
COMMENTS_COL
public static final int COMMENTS_COL
- See Also:
- Constant Field Values
-
SOURCE_COL
public static final int SOURCE_COL
- See Also:
- Constant Field Values
-
PERMISSIONS_COL
public static final int PERMISSIONS_COL
- See Also:
- Constant Field Values
-
START_ADDR_COL
public static final int START_ADDR_COL
- See Also:
- Constant Field Values
-
LENGTH_COL
public static final int LENGTH_COL
- See Also:
- Constant Field Values
-
SEGMENT_COL
public static final int SEGMENT_COL
- See Also:
- Constant Field Values
-
SUB_PARENT_ID_COL
public static final int SUB_PARENT_ID_COL
- See Also:
- Constant Field Values
-
SUB_TYPE_COL
public static final int SUB_TYPE_COL
- See Also:
- Constant Field Values
-
SUB_LENGTH_COL
public static final int SUB_LENGTH_COL
- See Also:
- Constant Field Values
-
SUB_START_OFFSET_COL
public static final int SUB_START_OFFSET_COL
- See Also:
- Constant Field Values
-
SUB_INT_DATA1_COL
public static final int SUB_INT_DATA1_COL
Subblock record int data1 usage:BufferSubMemoryBlock
- data buffer IDFileBytesSubMemoryBlock
- file bytes layered data buffer IDByteMappedSubMemoryBlock
- encoded byte mapping schemeBitMappedSubMemoryBlock
- (not used) 0UninitializedSubMemoryBlock
- (not used) 0
- See Also:
- Constant Field Values
-
SUB_LONG_DATA2_COL
public static final int SUB_LONG_DATA2_COL
Subblock record long data2 usage:BufferSubMemoryBlock
- (not used) 0FileBytesSubMemoryBlock
- starting byte offset within file bytes bufferByteMappedSubMemoryBlock
- encoded mapped source addressBitMappedSubMemoryBlock
- encoded mapped source addressUninitializedSubMemoryBlock
- (not used) 0
- See Also:
- Constant Field Values
-
SUB_TYPE_BIT_MAPPED
public static final byte SUB_TYPE_BIT_MAPPED
- See Also:
- Constant Field Values
-
SUB_TYPE_BYTE_MAPPED
public static final byte SUB_TYPE_BYTE_MAPPED
- See Also:
- Constant Field Values
-
SUB_TYPE_BUFFER
public static final byte SUB_TYPE_BUFFER
- See Also:
- Constant Field Values
-
SUB_TYPE_UNITIALIZED
public static final byte SUB_TYPE_UNITIALIZED
- See Also:
- Constant Field Values
-
SUB_TYPE_FILE_BYTES
public static final byte SUB_TYPE_FILE_BYTES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MemoryMapDBAdapterV3
public MemoryMapDBAdapterV3(DBHandle handle, MemoryMapDB memMap, long maxSubBlockSize, boolean create) throws VersionException, java.io.IOException
- Throws:
VersionException
java.io.IOException
-
-
Method Detail
-
createBlock
protected MemoryBlockDB createBlock(java.lang.String name, Address startAddress, long length, int permissions, java.util.List<ghidra.program.database.mem.SubMemoryBlock> splitBlocks) throws java.io.IOException
Creates a new memory block.- Parameters:
name
- the name of the blockstartAddress
- the start address of the blocklength
- the length of the blockpermissions
- the permissions for the blocksplitBlocks
- the list of subBlock objects that make up this block- Returns:
- the new MemoryBlock
- Throws:
java.io.IOException
- if a database error occurs
-
createFileBytesBlock
protected MemoryBlockDB createFileBytesBlock(java.lang.String name, Address startAddress, long length, FileBytes fileBytes, long offset, int permissions) throws java.io.IOException, AddressOverflowException
Creates a new memory block using a FileBytes- Parameters:
name
- the name of the blockstartAddress
- the start address of the blocklength
- the length of the blockfileBytes
- theFileBytes
object that provides the bytes for this blockoffset
- the offset into theFileBytes
objectpermissions
- the permissions for the block- Returns:
- the new MemoryBlock
- Throws:
java.io.IOException
- if a database error occursAddressOverflowException
- if block length is too large for the underlying space
-
updateSubBlockRecord
protected void updateSubBlockRecord(DBRecord record) throws java.io.IOException
Updates the sub memory block record.- Parameters:
record
- the record to update.- Throws:
java.io.IOException
- if a database IO error occurs.
-
-