Skip to content

Commit

Permalink
add literal
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-wadhwani committed Oct 4, 2024
1 parent 38673d2 commit 6b69b21
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions capa/features/freeze/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,140 +209,140 @@ def feature_from_capa(f: capa.features.common.Feature) -> "Feature":


class OSFeature(FeatureModel):
type: str = "os"
type: Literal["os"]
os: str
description: Optional[str] = None


class ArchFeature(FeatureModel):
type: str = "arch"
type: Literal["arch"]
arch: str
description: Optional[str] = None


class FormatFeature(FeatureModel):
type: str = "format"
type: Literal["format"]
format: str
description: Optional[str] = None


class MatchFeature(FeatureModel):
type: str = "match"
type: Literal["match"]
match: str
description: Optional[str] = None


class CharacteristicFeature(FeatureModel):
type: str = "characteristic"
type: Literal["characteristic"]
characteristic: str
description: Optional[str] = None


class ExportFeature(FeatureModel):
type: str = "export"
type: Literal["export"]
export: str
description: Optional[str] = None


class ImportFeature(FeatureModel):
type: str = "import"
type: Literal["import"]
import_: str = Field(alias="import")
description: Optional[str] = None


class SectionFeature(FeatureModel):
type: str = "section"
type: Literal["section"]
section: str
description: Optional[str] = None


class FunctionNameFeature(FeatureModel):
type: str = "function name"
type: Literal["function name"]
function_name: str = Field(alias="function name")
description: Optional[str] = None


class SubstringFeature(FeatureModel):
type: str = "substring"
type: Literal["substring"]
substring: str
description: Optional[str] = None


class RegexFeature(FeatureModel):
type: str = "regex"
type: Literal["regex"]
regex: str
description: Optional[str] = None


class StringFeature(FeatureModel):
type: str = "string"
type: Literal["string"]
string: str
description: Optional[str] = None


class ClassFeature(FeatureModel):
type: str = "class"
type: Literal["class"]
class_: str = Field(alias="class")
description: Optional[str] = None


class NamespaceFeature(FeatureModel):
type: str = "namespace"
type: Literal["namespace"]
namespace: str
description: Optional[str] = None


class BasicBlockFeature(FeatureModel):
type: str = "basic block"
type: Literal["basic block"]
description: Optional[str] = None


class APIFeature(FeatureModel):
type: str = "api"
type: Literal["api"]
api: str
description: Optional[str] = None


class PropertyFeature(FeatureModel):
type: str = "property"
type: Literal["property"]
access: Optional[str] = None
property: str
description: Optional[str] = None


class NumberFeature(FeatureModel):
type: str = "number"
type: Literal["number"]
number: Union[int, float]
description: Optional[str] = None


class BytesFeature(FeatureModel):
type: str = "bytes"
type: Literal["bytes"]
bytes: str
description: Optional[str] = None


class OffsetFeature(FeatureModel):
type: str = "offset"
type: Literal["offset"]
offset: int
description: Optional[str] = None


class MnemonicFeature(FeatureModel):
type: str = "mnemonic"
type: Literal["mnemonic"]
mnemonic: str
description: Optional[str] = None


class OperandNumberFeature(FeatureModel):
type: str = "operand number"
type: Literal["operand number"]
index: int
operand_number: int = Field(alias="operand number")
description: Optional[str] = None


class OperandOffsetFeature(FeatureModel):
type: str = "operand offset"
type: Literal["operand offset"]
index: int
operand_offset: int = Field(alias="operand offset")
description: Optional[str] = None
Expand Down

0 comments on commit 6b69b21

Please sign in to comment.