Package winappdbg :: Module search :: Class BytePattern
[hide private]
[frames] | no frames]

Class BytePattern

source code


Fixed byte pattern.

Instance Methods [hide private]
 
__init__(self, pattern)
Class constructor.
source code
 
__len__(self)
Returns the exact length of the pattern.
source code
tuple( int, int )
find(self, buffer, pos=None)
Searches for the pattern in the given buffer, optionally starting at the given position within the buffer.
source code
tuple( int, int, str )
found(self, address, size, data)
This method gets called when a match is found. (Inherited from winappdbg.search.Pattern)
source code
 
read(self, process, address, size)
Reads the requested number of bytes from the process memory at the given address. (Inherited from winappdbg.search.Pattern)
source code

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

Instance Variables [hide private]
int length
Length of the byte pattern.
str pattern
Byte string to search for.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pattern)
(Constructor)

source code 

Class constructor.

The only mandatory argument should be the pattern string.

This method MUST be reimplemented by subclasses of Pattern.

Parameters:
  • pattern (str) - Byte string to search for.
Overrides: object.__init__

__len__(self)
(Length operator)

source code 

Returns the exact length of the pattern.

Overrides: Pattern.__len__

See Also: Pattern.__len__

find(self, buffer, pos=None)

source code 

Searches for the pattern in the given buffer, optionally starting at the given position within the buffer.

This method MUST be reimplemented by subclasses of Pattern.

Parameters:
  • buffer - Buffer to search on.
  • pos - (Optional) Position within the buffer to start searching from.
Returns: tuple( int, int )
Tuple containing the following:
  • Position within the buffer where a match is found, or -1 if no match was found.
  • Length of the matched data if a match is found, or undefined if no match was found.
Overrides: Pattern.find
(inherited documentation)