Package winappdbg :: Module util :: Class MemoryAddresses
[hide private]
[frames] | no frames]

Class MemoryAddresses

source code

object --+
         |
        MemoryAddresses

Class to manipulate memory addresses.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *argv, **argd)
Don't try to instance this class, it's just a namespace!
source code
int
align_address_to_page_start(cls, address)
Align the given address to the start of the page it occupies.
source code
int
align_address_to_page_end(cls, address)
Align the given address to the end of the page it occupies.
source code
tuple( int, int )
align_address_range(cls, begin, end)
Align the given address range to the start and end of the page(s) it occupies.
source code
int
get_buffer_size_in_pages(cls, address, size)
Get the number of pages in use by the given buffer.
source code
Static Methods [hide private]
bool
do_ranges_intersect(begin, end, old_begin, old_end)
Determine if the two given memory address ranges intersect.
source code
Class Variables [hide private]
int pageSize = 4096
Page size in bytes.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *argv, **argd)
Class Method

source code 

Don't try to instance this class, it's just a namespace!

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

align_address_to_page_start(cls, address)
Class Method

source code 

Align the given address to the start of the page it occupies.

Parameters:
  • address (int) - Memory address.
Returns: int
Aligned memory address.

align_address_to_page_end(cls, address)
Class Method

source code 

Align the given address to the end of the page it occupies. That is, to point to the start of the next page.

Parameters:
  • address (int) - Memory address.
Returns: int
Aligned memory address.

align_address_range(cls, begin, end)
Class Method

source code 

Align the given address range to the start and end of the page(s) it occupies.

Parameters:
  • begin (int) - Memory address of the beginning of the buffer.
  • end (int) - Memory address of the end of the buffer.
Returns: tuple( int, int )
Aligned memory addresses.

get_buffer_size_in_pages(cls, address, size)
Class Method

source code 

Get the number of pages in use by the given buffer.

Parameters:
  • address (int) - Aligned memory address.
  • size (int) - Buffer size.
Returns: int
Buffer size in number of pages.

do_ranges_intersect(begin, end, old_begin, old_end)
Static Method

source code 

Determine if the two given memory address ranges intersect.

Parameters:
  • begin (int) - Start address of the first range.
  • end (int) - End address of the first range.
  • old_begin (int) - Start address of the second range.
  • old_end (int) - End address of the second range.
Returns: bool
True if the two ranges intersect, False otherwise.

Class Variable Details [hide private]

pageSize

Page size in bytes. Defaults to 0x1000 but it's automatically updated on runtime when importing the module.
Type:
int
Value:
4096