This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
detectors.py.stub
executable file
·75 lines (62 loc) · 2.35 KB
/
detectors.py.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 2.0
#
# 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/.
#
# The Original Code is ADBFuzz.
#
# The Initial Developer of the Original Code is Christian Holler (decoder).
#
# Contributors:
# Christian Holler <[email protected]> (Original Developer)
#
# ***** END LICENSE BLOCK *****
# NOTE: This file is a stub. It will be replaced by our internal implementation
# once that part of the code has been open-sourced. You can however implement
# the functions below easily yourself.
from __future__ import with_statement
import os, sys, platform, signal
class Detector:
def __init__(self):
pass
class AssertionDetector(Detector):
def __init__(self, knownPath):
pass
def scanLineAssertions(self, line):
"""
Determines if the given line contains an interesting assertion.
Returns True if the line contains an interesting assertion and
False otherwise.
"""
return True
def scanFileAssertions(self, currentFile, verbose, ignoreKnownAssertions, lineFilter=None):
"""
Determines if the given file contains one or more assertions. If the lineFilter parameter
is passed, it is interpreted as a function taking one line as a parameter and applied
to every line as a filter prior to checking it. The lineFilter function is expected to
return the filtered line that is checked then.
Returns an array of all assertions in the file. If ignoreKnownAssertions is True,
then only unknown (interesting) assertions are returned. If there are no assertions,
an empty array is returned instead.
"""
return True
def hasFatalAssertion(self, currentFile, verbose, lineFilter=None):
"""
Determines if the given file contains a fatal assertion. Parameters are the same as for
the scanFileAssertions method.
Returns true if a fatal assertion was seen, false if not.
"""
return False
class CrashDetector(Detector):
def __init__(self, knownPath):
pass
def isKnownCrashSignature(self, line):
"""
Determines if the given line contains a known crash signature.
Returns True if the line contains a known crash signature and
False otherwise.
"""
return False