vmray: restrict analysis to PE files

This commit is contained in:
Mike Hunhoff
2024-06-13 16:52:25 -06:00
parent 346a0693ad
commit 7e079d4d35

View File

@@ -5,8 +5,9 @@
# 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.
from typing import Dict, Optional
from typing import Dict
from capa.exceptions import UnsupportedFormatError
from capa.features.extractors.vmray.models import File, Analysis, SummaryV2, StaticData
@@ -28,6 +29,9 @@ class VMRayAnalysis:
self._compute_exports()
self._compute_sections()
if not self.sample_file_static_data.pe:
raise UnsupportedFormatError("VMRay feature extractor only supports PE at this time")
def _find_sample_file(self):
for file_name, file_analysis in self.sv2.files.items():
if file_analysis.is_sample: