From 0c9d3d09af583478554f2ddf1c7a9c56e07f99a0 Mon Sep 17 00:00:00 2001 From: mr-tz Date: Wed, 19 Jun 2024 15:12:52 +0000 Subject: [PATCH] fix ruff --- capa/features/extractors/vmray/call.py | 2 +- capa/features/extractors/vmray/extractor.py | 3 ++- capa/features/extractors/vmray/models.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/capa/features/extractors/vmray/call.py b/capa/features/extractors/vmray/call.py index 8a2475642..1a3bb9e60 100644 --- a/capa/features/extractors/vmray/call.py +++ b/capa/features/extractors/vmray/call.py @@ -5,7 +5,7 @@ from capa.features.insn import API, Number from capa.features.common import String, Feature from capa.features.address import Address -from capa.features.extractors.vmray.models import Analysis, FunctionCall +from capa.features.extractors.vmray.models import Analysis from capa.features.extractors.base_extractor import CallHandle, ThreadHandle, ProcessHandle logger = logging.getLogger(__name__) diff --git a/capa/features/extractors/vmray/extractor.py b/capa/features/extractors/vmray/extractor.py index 791ea89e9..73f0757d9 100644 --- a/capa/features/extractors/vmray/extractor.py +++ b/capa/features/extractors/vmray/extractor.py @@ -99,7 +99,7 @@ def from_zipfile(cls, zipfile_path: Path): flog_xml = zipfile.read("logs/flog.xml", pwd=b"infected") flog = Analysis.from_xml(flog_xml) - # debug(flog) + debug(flog.processes[1]) pprint(flog.processes[0]) return cls(VMRayAnalysis(sv2, flog)) @@ -108,5 +108,6 @@ def from_zipfile(cls, zipfile_path: Path): if __name__ == "__main__": # TODO(mr): for testing, removeme import sys + input_path = Path(sys.argv[1]) VMRayExtractor.from_zipfile(input_path) diff --git a/capa/features/extractors/vmray/models.py b/capa/features/extractors/vmray/models.py index 60398fa21..dc6681517 100644 --- a/capa/features/extractors/vmray/models.py +++ b/capa/features/extractors/vmray/models.py @@ -6,9 +6,9 @@ # 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. -from typing import Any, Dict, List, Union, Literal, Optional +from typing import Dict, List, Optional -from pydantic import Field, BaseModel +from pydantic import BaseModel from pydantic_xml import BaseXmlModel, attr, element