MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / BytePattern

Class BytePattern

pydevd_attach_to_process/winappdbg/search.py:177–205  ·  view source on GitHub ↗

Fixed byte pattern. @type pattern: str @ivar pattern: Byte string to search for. @type length: int @ivar length: Length of the byte pattern.

Source from the content-addressed store, hash-verified

175
176
177class BytePattern(Pattern):
178 """
179 Fixed byte pattern.
180
181 @type pattern: str
182 @ivar pattern: Byte string to search for.
183
184 @type length: int
185 @ivar length: Length of the byte pattern.
186 """
187
188 def __init__(self, pattern):
189 """
190 @type pattern: str
191 @param pattern: Byte string to search for.
192 """
193 self.pattern = str(pattern)
194 self.length = len(pattern)
195
196 def __len__(self):
197 """
198 Returns the exact length of the pattern.
199
200 @see: L{Pattern.__len__}
201 """
202 return self.length
203
204 def find(self, buffer, pos=None):
205 return buffer.find(self.pattern, pos), self.length
206
207
208# ------------------------------------------------------------------------------

Callers 2

search_bytesMethod · 0.90
__new__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected