mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
features: use ABC to denote abstract classes
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
import re
|
||||
import abc
|
||||
import codecs
|
||||
import logging
|
||||
import collections
|
||||
@@ -96,7 +97,7 @@ class Result:
|
||||
return self.success
|
||||
|
||||
|
||||
class Feature:
|
||||
class Feature(abc.ABC):
|
||||
def __init__(self, value: Union[str, int, bytes], bitness=None, description=None):
|
||||
"""
|
||||
Args:
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
import abc
|
||||
|
||||
import capa.render.utils
|
||||
from capa.features.common import Feature
|
||||
|
||||
@@ -43,7 +45,7 @@ class Mnemonic(Feature):
|
||||
MAX_OPERAND_INDEX = 3
|
||||
|
||||
|
||||
class _Operand(Feature):
|
||||
class _Operand(Feature, abc.ABC):
|
||||
# superclass: don't use directly
|
||||
# subclasses should set self.name and provide the value string formatter
|
||||
def __init__(self, index: int, value: int, description=None):
|
||||
|
||||
Reference in New Issue
Block a user