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

Class MemoryAddresses

source code


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]
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
a new object with type S, a subtype of T
__new__(cls, *argv, **argd)
Don't try to instance this class, just use the static methods. (Inherited from winappdbg.util.StaticClass)
Properties [hide private]
int pageSize
Page size in bytes.

Inherited from object: __class__

Method Details [hide private]

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. Use None for the first legal address in the address space.
  • end (int) - Memory address of the end of the buffer. Use None for the last legal address in the address space.
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.

Property Details [hide private]

pageSize

Page size in bytes. Defaults to 0x1000 but it's automatically updated on runtime when importing the module.
Get Method:
unreachable(cls) - Try to get the pageSize value on runtime.