Package FuzzManager :: Package FTB :: Module AssertionHelper
[hide private]
[frames] | no frames]

Module AssertionHelper

source code

AssertionHelper

Provides various functions around assertion handling and processing


Author: Christian Holler (:decoder)

License:

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Contact: choller@mozilla.com

Functions [hide private]
 
getAssertion(output, onlyProgramAssertions=False)
This helper class provides a way to extract and process the different types of assertions from a given buffer.
source code
string
getSanitizedAssertionPattern(msg)
This method provides a way to strip out unwanted dynamic information from assertions and replace it with pattern matching elements, e.g.
source code
string
escapePattern(msg)
This method escapes regular expression characters in the string.
source code
Variables [hide private]
  __package__ = 'FuzzManager.FTB'
Function Details [hide private]

getAssertion(output, onlyProgramAssertions=False)

source code 

This helper class provides a way to extract and process the different types of assertions from a given buffer. The problem here is that pretty much every software has its own type of assertions with different output formats.

The "onlyProgramAssertions" boolean is to indicate that we are only interested in output from the program itself. Some aborts, like ASan or glibc, are not desirable in some cases, like signature generation and lead to incompatible signatures.

Parameters:
  • output (list) - List of strings to be searched
  • onlyProgramAssertions (bool) - Boolean, see above

getSanitizedAssertionPattern(msg)

source code 

This method provides a way to strip out unwanted dynamic information from assertions and replace it with pattern matching elements, e.g. for use in signature matching.

Parameters:
  • msg (string) - Assertion message to be sanitized
Returns: string
Sanitized assertion message (regular expression)

escapePattern(msg)

source code 

This method escapes regular expression characters in the string. And no, this is not re.escape, which would escape many more characters.

Parameters:
  • msg (string) - String that needs to be quoted
Returns: string
Escaped string for use in regular expressions