Katharina Schleidt

15 papers C 1Journal 4Unranked 10
YearRankTypeTitle / Venue / Authors
2025 J jnl
CoRR
Mickaël Beaufils, Katharina Schleidt, Hylke van der Schaaf, Daniel Ponti, Neil Chadwick, Derrick Dasenbrock
2019 C conf
IGARSS
Katharina Schleidt, Peter Baumann
2017 conf
ISESS
Katharina Schleidt
2016 J jnl
AGIT Journal Angew. Geoinformatik
Roland Grillmayer, Katharina Schleidt, Jan Schulze-Althoff
2016 J jnl
Environ. Model. Softw.
Carlos Granell, Denis Havlik, Sven Schade, Zoheir A. Sabeur, Conor Delaney, Jasmin Pielorz, Thomas Usländer, Paolo Mazzetti, Katharina Schleidt, Mike Kobernus, Fuada Havlik, Nils Rune Bodsberg, Arne J. Berre, José Lorenzo
2015 conf
EnviroInfo/ICT4S (2)
Katharina Schleidt, Barbara Magagna, Wolfgang Spangl, Gerhard Dünnebeil
2015 conf
ISESS
Katharina Schleidt
2013 conf
ISESS
Katharina Schleidt, Nina Laurenne, Andrea Giacomelli, Denis Havlik
2013 conf
ISESS
Katharina Schleidt
2011 conf
ISESS
Sven Schade, Barbara Fogarty, Michael Kobernus, Katharina Schleidt, Paul Gaughan, Paolo Mazzetti, Arne-Jørgen Berre
2009 J jnl
ERCIM News
Katharina Schleidt, Denis Havlik
2009 conf
EnviroInfo (1)
Thomas Bandholtz, Joachim Fock, Rudolf Legat, Michal Nagy, Katharina Schleidt
2008 conf
EnviroInfo
Hans-Jörg Krammer, Rudolf Legat, Katharina Schleidt, Michal Nagy, Johannes Mayer
2005 conf
EnviroInfo
Herbert Schentz, Katharina Schleidt, Martin König, Michael Mirtl
2005 conf
EnviroInfo
Katharina Schleidt, Herbert Schentz, Michael Mirtl
redb/extractors/pe_extractor.py
← Index redb/extractors/pe_extractor.py python
import logging
from abc import ABCMeta, abstractmethod
import inspect

import magic
import pefile
from dotnetfile import DotNetPE

from redb.extractors.extractor import Extractor

logger = logging.getLogger(__name__)


@abstractmethod
class PEExtractor(Extractor, metaclass=ABCMeta):

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        elastic_index=None,
        known_benign=False,
        known_malicious=False,
        pe=None,
    ):
        super().__init__(
            filepath,
            log,
            exporters,
            index_prefix,
            elastic_index,
            known_benign,
            known_malicious
        )
        self.pe = pe if pe else self._generate_pefile_object()
        self.dotnet = None

    def _generate_pefile_object(self):
        pe = None
        try:
            pe = pefile.PE(self.filepath)
            if not pe:
                raise pefile.PEFormatError("Empty file?")
        except pefile.PEFormatError as e:
            self.log.error(f"Format error {self.hash.sha256} Full error : {e}")
        return pe

    def _generate_dotnetfile_object(self):
        self.log.debug(inspect.currentframe().f_code.co_name)
        dotnet = None
        error = None
        try:
            dotnet = DotNetPE(self.filepath)
            if not dotnet:
                raise Exception("Empty file?")
        except Exception as e:
            self.log.error(
                f"Format error dotnet file {self.hash.sha256} Full error : {e}"
            )
            error = e
        return dotnet, error

    def _check_dotnet(self):
        try:
            file_type = magic.from_buffer(self.binary)
            if ".Net" in file_type:
                return True
            for entry in self.pe.OPTIONAL_HEADER.DATA_DIRECTORY:
                # IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR is typically 14
                if (
                    entry.name == "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR"
                    and entry.Size > 0
                ):
                    return True
            return False
        except AttributeError as e:
            self.log.error(
                f"AttributeError error dotnet file {self.hash.sha256} Full error : {e}"
            )
            return False

    def _is_signed(self):
        address = self.pe.OPTIONAL_HEADER.DATA_DIRECTORY[
            pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_SECURITY"]
        ].VirtualAddress
        if address == 0:
            return False
        return True

    def _has_overlay(self):
        return bool(self.pe.get_overlay())