Package winappdbg :: Module breakpoint :: Class BufferWatch
[hide private]
[frames] | no frames]

Class BufferWatch

source code


Used by Debug.watch_buffer.

This class acts as a condition callback for page breakpoints. It emulates page breakpoints that can overlap and/or take up less than a page's size.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add(self, address, size, action=None)
Adds a buffer to the watch object.
source code
 
remove(self, address, size)
Removes a buffer from the watch object.
source code
bool
exists(self, address, size)
Returns: True if the buffer is being watched, False otherwise.
source code
tuple( int, int )
span(self)
Returns: Base address and size in pages required to watch all the buffers.
source code
int
count(self)
Returns: Number of buffers being watched.
source code
bool
__call__(self, event)
Breakpoint condition callback.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

add(self, address, size, action=None)

source code 

Adds a buffer to the watch object.

Parameters:
  • address (int) - Memory address of buffer to watch.
  • size (int) - Size in bytes of buffer to watch.
  • action (function) - (Optional) Action callback function.

    See Debug.define_page_breakpoint for more details.

remove(self, address, size)

source code 

Removes a buffer from the watch object.

Parameters:
  • address (int) - Memory address of buffer to stop watching.
  • size (int) - Size in bytes of buffer to stop watching.

exists(self, address, size)

source code 
Parameters:
  • address (int) - Memory address of buffer being watched.
  • size (int) - Size in bytes of buffer being watched.
Returns: bool
True if the buffer is being watched, False otherwise.

span(self)

source code 
Returns: tuple( int, int )
Base address and size in pages required to watch all the buffers.

count(self)

source code 
Returns: int
Number of buffers being watched.

__call__(self, event)
(Call operator)

source code 

Breakpoint condition callback.

This method will also call the action callbacks for each buffer being watched.

Parameters:
Returns: bool
True if the address being accessed belongs to at least one of the buffers that was being watched and had no action callback.