Xiao-Hua Yu

27 papers B 11C 4Misc 3Journal 2Unranked 6
YearRankTypeTitle / Venue / Authors
2022 conf
CSCI
Hyunjong Choi, Xiao-Hua Yu
2022 conf
ICITE
Pang-Shi Shih, Sophia Liu, Xiao-Hua Yu
2019 B conf
FUZZ-IEEE
Jason Rivera, Kelsey Rodriguez, Xiao-Hua Yu
2019 conf
ISNN (2)
Paul Malla, Will Coburn, Kevin Keegan, Xiao-Hua Yu
2018 B conf
IJCNN
Rory Donovan, Xiao-Hua Yu
2017 B conf
IJCNN
Arthur Shi, Xiao-Hua Yu
2016 B conf
IJCNN
Pramod Gadde, Xiao-Hua Yu
2015 Misc conf
ICNC
Shane Dixon, Xiao-Hua Yu
2013 J jnl
Neurocomputing
Suranai Poungponsri, Xiao-Hua Yu
2013 Misc conf
ICMLC
Michael Brand, Xiao-Hua Yu
2013 B conf
IJCNN
Dingran Lu, Xiao-Hua Yu
2013 B conf
ICALT
Xiaomin Jin, Xiao-Hua Yu, Xiangning Kang, Guoyi Zhang, Guifang Dong
2012 B conf
IJCNN
David Renfrew, Xiao-Hua Yu
2010 conf
ICEE
Yao-feng Xue, Xiao-Hua Yu, Zhi-Ting Zhu, Yonghe Wu
2010 conf
ISNN (2)
Sunny Wan, Xiao-Hua Yu
2009 B conf
IJCNN
Timothy Whitacre, Xiao-Hua Yu
2009 J jnl
Neurocomputing
Xiao-Hua Yu, Weiming Li, Taufik
2009 conf
ICNC (3)
David Renfrew, Xiao-Hua Yu
2008 B conf
IJCNN
Devin Sabo, Xiao-Hua Yu
2008 ch.
Advances of Computational Intelligence in Industrial Systems
Xiao-Hua Yu
2008 C conf
CCA
Devin Sabo, Xiao-Hua Yu
2007 B conf
IJCNN
Weiming Li, Xiao-Hua Yu
2006 B conf
IJCNN
Johnny Fu, Xiao-Hua Yu
2005 C conf
CCA
Xiao-Hua Yu
2004 Misc conf
IC-AI
Xiao-Hua Yu
2003 C conf
CCA
Xiao-Hua Yu
2002 C conf
ACC
Xiao-Hua Yu, Allen R. Stubberud
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())