Venkatesh Prasad Ranganath

21 papers A* 2A 4B 5C 1Journal 6Unranked 3
YearRankTypeTitle / Venue / Authors
2015 A conf
ACSAC
Sankardas Roy, Jordan DeLoach, Yuping Li, Nic Herndon, Doina Caragea, Xinming Ou, Venkatesh Prasad Ranganath, Hongmin Li, Nicolais Guevara
2012 J jnl
Sci. Comput. Program.
David Lo, G. Ramalingam, Venkatesh Prasad Ranganath, Kapil Vaswani
2011 J jnl
Log. Methods Comput. Sci.
Jyotirmoy V. Deshmukh, G. Ramalingam, Venkatesh Prasad Ranganath, Kapil Vaswani
2010 A conf
ESOP
Jyotirmoy V. Deshmukh, G. Ramalingam, Venkatesh Prasad Ranganath, Kapil Vaswani
2009 A* conf
ASPLOS
Sriram K. Rajamani, G. Ramalingam, Venkatesh Prasad Ranganath, Kapil Vaswani
2009 conf
WCRE
David Lo, Ganesan Ramalingam, Venkatesh Prasad Ranganath, Kapil Vaswani
2007 J jnl
ACM Trans. Program. Lang. Syst.
Venkatesh Prasad Ranganath, Torben Amtoft, Anindya Banerjee, John Hatcliff, Matthew B. Dwyer
2007 J jnl
Int. J. Softw. Tools Technol. Transf.
Venkatesh Prasad Ranganath, John Hatcliff
2006 conf
SWWS
Venkatesh Prasad Ranganath, Andrew L. King, Daniel Andresen
2006 A conf
TACAS
Matthew B. Dwyer, John Hatcliff, Matthew Hoosier, Venkatesh Prasad Ranganath, Robby, Todd Wallentine
2006 J jnl
SIGBED Rev.
Arvind S. Krishna, Aniruddha S. Gokhale, Douglas C. Schmidt, Venkatesh Prasad Ranganath, John Hatcliff
2005 A conf
ESOP
Venkatesh Prasad Ranganath, Torben Amtoft, Anindya Banerjee, Matthew B. Dwyer, John Hatcliff
2005 B conf
FASE
Ganeshan Jayaraman, Venkatesh Prasad Ranganath, John Hatcliff
2004 B conf
FASE
Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath
2004 B conf
FASE
Adam Childs, Jesse Greenwald, Venkatesh Prasad Ranganath, Xianghua Deng, Matthew B. Dwyer, John Hatcliff, Georg Jung, Prashant Shanti, Gurdip Singh
2004 J jnl
Formal Methods Syst. Des.
Matthew B. Dwyer, John Hatcliff, Robby, Venkatesh Prasad Ranganath
2004 B conf
ICPP
Daniel Andresen, David Sexton, Kiran Devaram, Venkatesh Prasad Ranganath
2004 B conf
CC
Venkatesh Prasad Ranganath, John Hatcliff
2003 A* conf
ICSE
John Hatcliff, Xianghua Deng, Matthew B. Dwyer, Georg Jung, Venkatesh Prasad Ranganath
2003 conf
eTX
Venkatesh Prasad Ranganath, Adam Childs, Jesse Greenwald, Matthew B. Dwyer, John Hatcliff, Gurdip Singh
2003 C conf
PEPM
John Hatcliff, William Deng, Matthew B. Dwyer, Georg Jung, Venkatesh Prasad Ranganath, Robby
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())