java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.memory.AbstractVirtualMemory |
A skeleton implementation for virtual memory classes. Most dummy/trivial methods are implemented here.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractVirtualMemory() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | addAllocListener(IMemoryAllocListener listener) | ||||||||||
void | addFreeListener(IMemoryFreeListener listener) | ||||||||||
void |
addPreWriteListener(IMemoryWriteListener listener)
Note: The callback is invoked before the write operation takes place.
| ||||||||||
void | addPropertyListener(IMemoryPropertyListener listener) | ||||||||||
void | addProtectionListener(IMemoryProtectionListener listener) | ||||||||||
void | addWriteListener(IMemoryWriteListener listener) | ||||||||||
void |
allocatePage(long address, int protection)
Allocate a single page.
| ||||||||||
void |
freePage(long address)
Free a single page.
| ||||||||||
int |
getAproximateFootprint()
Determine the approximate memory footprint of this object, in kilobytes.
| ||||||||||
synchronized int |
readBEInt(long address)
Read a big-endian 32-bit integer.
| ||||||||||
synchronized long |
readBELong(long address)
Read a big-endian 64-bit integer.
| ||||||||||
synchronized short |
readBEShort(long address)
Read a big-endian 16-bit integer.
| ||||||||||
synchronized byte |
readByte(long address)
Convenience method.
| ||||||||||
synchronized int |
readInt(long address, Endianness end)
Read a 32-bit integer.
| ||||||||||
synchronized int |
readInt(long address)
Read a 32-bit integer using the
standard endianness . | ||||||||||
synchronized int |
readLEInt(long address)
Read a little-endian 32-bit integer.
| ||||||||||
synchronized long |
readLELong(long address)
Read a little-endian 64-bit integer.
| ||||||||||
synchronized short |
readLEShort(long address)
Read a little-endian 16-bit integer.
| ||||||||||
synchronized long |
readLong(long address, Endianness end)
Read a 64-bit integer.
| ||||||||||
synchronized long |
readLong(long address)
Read a 64-bit integer using the
standard endianness . | ||||||||||
long |
readPointer(long address)
@return
| ||||||||||
synchronized short |
readShort(long address, Endianness end)
Read a 16-bit integer.
| ||||||||||
synchronized short |
readShort(long address)
Read a 16-bit integer using the
standard endianness . | ||||||||||
void | removeAllocListener(IMemoryAllocListener listener) | ||||||||||
void | removeFreeListener(IMemoryFreeListener listener) | ||||||||||
void | removePreWriteListener(IMemoryWriteListener listener) | ||||||||||
void | removePropertyListener(IMemoryPropertyListener listener) | ||||||||||
void | removeProtectionListener(IMemoryProtectionListener listener) | ||||||||||
void | removeWriteListener(IMemoryWriteListener listener) | ||||||||||
long |
roundToPage(long address)
Round an address to the page this address currently resides in, that is the highest page so
that boundary ≤ address.
| ||||||||||
long |
roundToSize(long address)
Round an address to the lowest page boundary so that address ≤ boundary.
| ||||||||||
void |
setLazyMemoryProvider(ILazyMemoryProvider lazyMemoryProvider, boolean skipFailedAllocations)
Set a lazy memory provider.
| ||||||||||
synchronized void |
writeBEInt(long address, int v)
Write a big-endian 32-bit integer.
| ||||||||||
synchronized void |
writeBELong(long address, long v)
Write a big-endian 64-bit integer.
| ||||||||||
synchronized void |
writeBEShort(long address, short v)
Write a big-endian 16-bit integer.
| ||||||||||
synchronized void |
writeByte(long address, byte v)
Write a byte.
| ||||||||||
synchronized void |
writeInt(long address, int v, Endianness end)
Write a 32-bit integer.
| ||||||||||
synchronized void |
writeInt(long address, int v)
Write a 32-bit integer using the
standard endianness . | ||||||||||
synchronized void |
writeLEInt(long address, int v)
Write a little-endian 32-bit integer.
| ||||||||||
synchronized void |
writeLELong(long address, long v)
Write a little-endian 64-bit integer.
| ||||||||||
synchronized void |
writeLEShort(long address, short v)
Write a little-endian 16-bit integer.
| ||||||||||
synchronized void |
writeLong(long address, long v)
Write a 64-bit integer using the
standard endianness . | ||||||||||
synchronized void |
writeLong(long address, long v, Endianness end)
Write a 64-bit integer.
| ||||||||||
void | writePointer(long address, long ptr) | ||||||||||
synchronized void |
writeShort(long address, short v)
Write a 16-bit integer using the
standard endianness . | ||||||||||
synchronized void |
writeShort(long address, short v, Endianness end)
Write a 16-bit integer.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
List<IMemoryAllocListener> | getAllocListeners() | ||||||||||
List<IMemoryFreeListener> | getFreeListeners() | ||||||||||
List<IMemoryWriteListener> | getPreWriteListeners() | ||||||||||
List<IMemoryPropertyListener> | getPropertyListeners() | ||||||||||
List<IMemoryProtectionListener> | getProtectionListeners() | ||||||||||
List<IMemoryWriteListener> | getWriteListeners() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Note: The callback is invoked before the write operation takes place.
Allocate a single page. See allocate(long, int, int)
.
MemoryException |
---|
Determine the approximate memory footprint of this object, in kilobytes.
Read a big-endian 32-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a big-endian 64-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a big-endian 16-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Convenience method. Read a byte.@return
MemoryException |
---|
Read a 32-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a 32-bit integer using the standard endianness
. This
method does not do partial reads.@return
MemoryException |
---|
Read a little-endian 32-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a little-endian 64-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a little-endian 16-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a 64-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a 64-bit integer using the standard endianness
. This
method does not do partial reads.@return
MemoryException |
---|
Read a 16-bit integer. This method does not do partial reads.@return
MemoryException |
---|
Read a 16-bit integer using the standard endianness
. This
method does not do partial reads.@return
MemoryException |
---|
Round an address to the page this address currently resides in, that is the highest page so that boundary ≤ address. This method does not raise, even if the address is invalid for this memory space.
address | an address |
---|
Round an address to the lowest page boundary so that address ≤ boundary. This method does not raise, even if the address is invalid for this memory space.
address | an address or a size |
---|
Set a lazy memory provider. This operation is optional. If the memory object supports it, the
getRanges()
method will be called to reserve the ranges of memory
that the provider can provide. A lazy provider provides memory data on demand, i.e. when the
data bytes are accessed (read or write).
lazyMemoryProvider | a non-null lazy memory provider |
---|---|
skipFailedAllocations | if true, the provider will not hard-fail if it provides data for a range for which data already exists in the virtual memory; else, the method will throw |
MemoryException | |
---|---|
UnsupportedOperationException |
Write a big-endian 32-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a big-endian 64-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a big-endian 16-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a 32-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a 32-bit integer using the standard endianness
. This
method does not do partial writes.
MemoryException |
---|
Write a little-endian 32-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a little-endian 64-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a little-endian 16-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a 64-bit integer using the standard endianness
. This
method does not do partial writes.
MemoryException |
---|
Write a 64-bit integer. This method does not do partial writes.
MemoryException |
---|
Write a 16-bit integer using the standard endianness
. This
method does not do partial writes.
MemoryException |
---|
Write a 16-bit integer. This method does not do partial writes.
MemoryException |
---|