Package envi :: Module memory :: Class MemoryObject
[hide private]
[frames] | no frames]

Class MemoryObject

source code

IMemory --+
          |
         MemoryObject
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, archmod=None)
Take a set of memory maps (va, perms, fname, bytes) and put them in a sparse space finder.
source code
 
addMemoryMap(self, va, perms, fname, bytes)
Add a memory map to this object...
source code
 
getMemorySnap(self)
Take a memory snapshot which may be restored later.
source code
 
setMemorySnap(self, snap)
Restore a previously saved memory snapshot.
source code
 
getMemoryMap(self, va)
Get the va,size,perms,fname tuple for this memory map
source code
 
getMemoryMaps(self) source code
 
readMemory(self, va, size)
Read memory from the specified virtual address for size bytes and return it as a python string.
source code
 
writeMemory(self, va, bytes)
Write the given bytes to the specified virtual address.
source code
 
getByteDef(self, va)
An optimized routine which returns the existing segment bytes sequence without creating a new string object *AND* an offset of va into the buffer.
source code

Inherited from IMemory: allocateMemory, getPointerSize, getSegmentInfo, isExecutable, isReadable, isShared, isValidPointer, isWriteable, parseOpcode, probeMemory, protectMemory, readMemValue, readMemoryFormat, searchMemory, searchMemoryRange, writeMemoryFormat

Method Details [hide private]

__init__(self, archmod=None)
(Constructor)

source code 

Take a set of memory maps (va, perms, fname, bytes) and put them in a sparse space finder. You may specify your own page-size to optimize the search for an architecture.

Overrides: IMemory.__init__

addMemoryMap(self, va, perms, fname, bytes)

source code 

Add a memory map to this object...

Overrides: IMemory.addMemoryMap

getMemorySnap(self)

source code 

Take a memory snapshot which may be restored later.

Example: snap = mem.getMemorySnap()

setMemorySnap(self, snap)

source code 

Restore a previously saved memory snapshot.

Example: mem.setMemorySnap(snap)

getMemoryMap(self, va)

source code 

Get the va,size,perms,fname tuple for this memory map

Overrides: IMemory.getMemoryMap

getMemoryMaps(self)

source code 
Overrides: IMemory.getMemoryMaps

readMemory(self, va, size)

source code 

Read memory from the specified virtual address for size bytes and return it as a python string.

Example: mem.readMemory(0x41414141, 20) -> "A..."

Overrides: IMemory.readMemory
(inherited documentation)

writeMemory(self, va, bytes)

source code 

Write the given bytes to the specified virtual address.

Example: mem.writeMemory(0x41414141, "VISI")

Overrides: IMemory.writeMemory
(inherited documentation)

getByteDef(self, va)

source code 

An optimized routine which returns the existing segment bytes sequence without creating a new string object *AND* an offset of va into the buffer. Used internally for optimized memory handling. Returns (offset, bytes)