N. S. Nagaraj

28 papers A* 7C 2Misc 8Journal 1Unranked 10
YearRankTypeTitle / Venue / Authors
2009 A* conf
DAC
Jason Cong, N. S. Nagaraj, Ruchir Puri, William H. Joyner, Jeff Burns, Moshe Gavrielov, Riko Radojcic, Peter Rickert, Hans Stork
2008 A* conf
DAC
Juan C. Rey, N. S. Nagaraj, Andrew B. Kahng, Fabian Klass, Rob Aitken, Cliff Hou, Luigi Capodieci, Vivek Singh
2006 Misc conf
VLSI Design
N. S. Nagaraj
2006 conf
APCCAS
Dharin Shah, Kothamasu Siva, G. Girishankar, N. S. Nagaraj
2006 Misc conf
VLSI Design
Usha Narasimha, Anthony M. Hill, N. S. Nagaraj
2006 conf
ISQED
Usha Narasimha, Binu Abraham, N. S. Nagaraj
2005 A* conf
DAC
N. S. Nagaraj, Tom Bonifield, Abha Singh, Clive Bittlestone, Usha Narasimha, Viet Le, Anthony M. Hill
2005 conf
SLIP
N. S. Nagaraj
2005 Misc conf
VLSI Design
N. S. Nagaraj, William R. Hunter, Poras T. Balsara, Cyrus D. Cantrell
2004 Misc conf
VLSI Design
Sanjive Agarwala, Paul Wiley, Arjun Rajagopal, Anthony M. Hill, Raguram Damodaran, Lewis Nardini, Tim Anderson, Steven Mullinnix, Jose Flores, Heping Yue, Abhijeet Chachad, John Apostol, Kyle Castille, Usha Narasimha, Tod Wolf, N. S. Nagaraj, Manjeri Krishnan, Luong Nguyen, Todd Kroeger, Mike Gill, Peter Groves, Bill Webster, Joel Graber, Christine Karlovich
2004 conf
GCC Workshops
Renuka Sindhgatta, Swaminathan Natarajan, Krishnakumar Pooloth, Colin Pinto, N. S. Nagaraj
2004 Misc conf
VLSI Design
N. S. Nagaraj, Tom Bonifield, Abha Singh, Roger Griesmer, Poras T. Balsara
2003 conf
ISQED
N. S. Nagaraj, Tom Bonifield, Abha Singh, Frank Cano, Usha Narasimha, Mak Kulkarni, Poras T. Balsara, Cyrus D. Cantrell
2002 J jnl
IEEE J. Solid State Circuits
Sanjive Agarwala, Timothy Anderson, Anthony M. Hill, M. D. Ales, Raguram Damodaran, Paul Wiley, Steven Mullinnix, J. Leach, Anthony Lell, Michael Gill, Arjun Rajagopal, Abhijeet Chachad, M. Agarwala, John Apostol, Manjeri Krishnan, Duc Bui, Quang An, N. S. Nagaraj, Tod Wolf, T. T. Elappuparackal
2002 conf
ASP-DAC/VLSI Design
N. S. Nagaraj, Poras T. Balsara, Cyrus D. Cantrell
2001 conf
ISQED
Narain Arora, N. S. Nagaraj
2000 Misc conf
VLSI Design
N. S. Nagaraj, Frank Cano, Duane Young, Deepak Vohra, Manoj Das
2000 conf
ISQED
Wonjae L. Kang, Brad Potts, Ray Hokinson, John Riley, David Doman, Frank Cano, N. S. Nagaraj, Noel Durrant
2000 conf
ISQED
Steffen Rochel, N. S. Nagaraj
2000 A* conf
DAC
N. S. Nagaraj, Andrzej J. Strojwas, Sani R. Nassif, Ray Hokinson, Tak Young, Wonjae L. Kang, David Overhauser, Sung-Mo Kang
1998 A* conf
DAC
N. S. Nagaraj, Frank Cano, Haldun Haznedar, Duane Young
1998 A* conf
DAC
N. S. Nagaraj, Kenneth L. Shepard, Takahide Inone
1997 conf
ISPD
R. G. Bushroe, S. Dasgupta, A. Dengi, P. Fisher, S. Grout, G. Ledenbach, N. S. Nagaraj, R. Steele
1994 C conf
ISCAS
N. S. Nagaraj, Paul Krivacek, Mark Harward
1993 A* conf
DAC
N. S. Nagaraj
1993 C conf
ISCAS
N. S. Nagaraj
1992 Misc conf
VLSI Design
N. S. Nagaraj
1992 Misc conf
VLSI Design
S. Nagaraj, N. Padmini, N. S. Nagaraj, R. Ramesh, V. Sachidanand
redb/extractors/pe_extractors/pe_imports.py
← Index redb/extractors/pe_extractors/pe_imports.py python
import inspect
from typing import Any, List, Tuple
from datetime import datetime, timezone

from redb.extractors.enum import Tag
from redb.extractors.pe_extractor import PEExtractor
from redb.models.dataclasses import PEImport


class PEImportExtractor(PEExtractor):

    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,
            pe,
        )
        self.elastic_index = self.index_prefix + "-pe_imports"
        self.log.debug(inspect.currentframe().f_code.co_name)

    def tag(self):
        return Tag.PE_IMPORT.value

    def _extract_imports(self):
        self.log.debug(inspect.currentframe().f_code.co_name)

        imports_symbols = []
        imports_lib = []
        imports_total = 0
        # pe_import = None
        try:
            directory_entry_import = getattr(self.pe, "DIRECTORY_ENTRY_IMPORT", [])
            imports_total = len(directory_entry_import)
            for entry in directory_entry_import:
                symbols = []
                tmp_import = {}
                libname = entry.dll.decode() if entry.dll else ""
                imports_lib.append(libname)
                # replace . with _ to avoid issues with elastic
                # entryname = entryname.replace(".", "_")
                for symbol in entry.imports:
                    if symbol.name:
                        symbols.append(symbol.name.decode())
                # imports_symbols[entryname] = symbols
                tmp_import[libname] = symbols
                imports_symbols.append(tmp_import)
            return PEImport(
                pe_imports_total=imports_total,
                pe_import_libraryName=imports_lib if imports_lib else None,
                pe_import_functions=imports_symbols if imports_symbols else None,
            )
        except Exception as e:
            self.log.error(f"Extract imports error {self.hash.sha256} Exception: {e}")
        return pe_import

    def extract(self):
        try:
            self.log.debug(inspect.currentframe().f_code.co_name)
            return self._extract_imports()
        except Exception as e:
            self.log.error(f"Extract imports error {self.hash.sha256} Exception: {e}")
            return None

    def prepare_export_data(self, exporter_type: str) -> Any:
        if exporter_type == "ElasticsearchExporter":
            return self.extract()
        elif exporter_type == "ClickHouseExporter":
            imports = self.extract()
            if (
                imports is None
                or imports.pe_imports_total == 0
                or (
                    imports.pe_import_libraryName is None
                    and imports.pe_import_functions is None
                )
            ):
                return None

            # Flatten the data - one row per function import
            data = []
            current_time = datetime.now(timezone.utc)

            for lib_funcs in imports.pe_import_functions:
                for lib, funcs in lib_funcs.items():
                    for func in funcs:
                        data.append(
                            [
                                self.sha256,  # sha256
                                self.md5,  # md5
                                self.sha1,  # sha1
                                lib,  # library_name
                                func,  # function_name
                                current_time,  # analysis_date
                            ]
                        )

            column_names = [
                "sha256",
                "md5",
                "sha1",
                "library_name",
                "function_name",
                "analysis_date",
            ]

            column_type_names = [
                "FixedString(64)",
                "FixedString(32)",
                "FixedString(40)",
                "LowCardinality(Nullable(String))",
                "LowCardinality(Nullable(String))",
                "DateTime64(3, 'UTC')",
            ]

            if not data:
                return None

            return (data, column_names, column_type_names)

    def get_clickhouse_table(self) -> str:
        return "redb_pe_imports"