Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
miasm2.os_dep.common.heap Class Reference
+ Inheritance diagram for miasm2.os_dep.common.heap:
+ Collaboration diagram for miasm2.os_dep.common.heap:

Public Member Functions

def next_addr
 
def alloc
 

Public Attributes

 addr
 

Static Public Attributes

int addr = 0x20000000
 
int align = 0x1000
 
int size = 32
 
tuple mask = (1 << size)
 

Detailed Description

Definition at line 40 of file common.py.

Member Function Documentation

def miasm2.os_dep.common.heap.alloc (   self,
  jitter,
  size 
)
@jitter: a jitter instance
@size: the size to allocate

Definition at line 58 of file common.py.

58 
59  def alloc(self, jitter, size):
60  """
61  @jitter: a jitter instance
62  @size: the size to allocate
63  """
64 
65  addr = self.next_addr(size)
66  jitter.vm.add_memory_page(addr, PAGE_READ | PAGE_WRITE, "\x00" * size)
67  return addr
68 

+ Here is the call graph for this function:

def miasm2.os_dep.common.heap.next_addr (   self,
  size 
)
@size: the size to allocate
return the future checnk address

Definition at line 48 of file common.py.

48 
49  def next_addr(self, size):
50  """
51  @size: the size to allocate
52  return the future checnk address
53  """
54  ret = self.addr
55  self.addr = (self.addr + size + self.align - 1)
56  self.addr &= self.mask ^ (self.align - 1)
57  return ret

+ Here is the caller graph for this function:

Member Data Documentation

int miasm2.os_dep.common.heap.addr = 0x20000000
static

Definition at line 43 of file common.py.

miasm2.os_dep.common.heap.addr

Definition at line 54 of file common.py.

int miasm2.os_dep.common.heap.align = 0x1000
static

Definition at line 44 of file common.py.

tuple miasm2.os_dep.common.heap.mask = (1 << size)
static

Definition at line 46 of file common.py.

int miasm2.os_dep.common.heap.size = 32
static

Definition at line 45 of file common.py.


The documentation for this class was generated from the following file: