This method gets called when a match is found. This allows subclasses of L{Pattern} to filter out unwanted results, or modify the results before giving them to the caller of L{Search.search_process}. If the return value is C{None} the result is skipped.
(self, address, size, data)
| 141 | raise NotImplementedError() |
| 142 | |
| 143 | def found(self, address, size, data): |
| 144 | """ |
| 145 | This method gets called when a match is found. |
| 146 | |
| 147 | This allows subclasses of L{Pattern} to filter out unwanted results, |
| 148 | or modify the results before giving them to the caller of |
| 149 | L{Search.search_process}. |
| 150 | |
| 151 | If the return value is C{None} the result is skipped. |
| 152 | |
| 153 | Subclasses of L{Pattern} don't need to reimplement this method unless |
| 154 | filtering is needed. |
| 155 | |
| 156 | @type address: int |
| 157 | @param address: The memory address where the pattern was found. |
| 158 | |
| 159 | @type size: int |
| 160 | @param size: The size of the data that matches the pattern. |
| 161 | |
| 162 | @type data: str |
| 163 | @param data: The data that matches the pattern. |
| 164 | |
| 165 | @rtype: tuple( int, int, str ) |
| 166 | @return: Tuple containing the following: |
| 167 | * The memory address where the pattern was found. |
| 168 | * The size of the data that matches the pattern. |
| 169 | * The data that matches the pattern. |
| 170 | """ |
| 171 | return (address, size, data) |
| 172 | |
| 173 | |
| 174 | # ------------------------------------------------------------------------------ |