Jacques Loeckx

28 papers A* 2Journal 6Unranked 12
YearRankTypeTitle / Venue / Authors
1996 book
Specification of abstract data types.
Jacques Loeckx, Hans-Dieter Ehrich, Markus Wolf
1995 ch.
KORSO Book
Jacques Loeckx, Jörg Zeyer
1993 conf
GI Jahrestagung
Heinrich Hußmann, Jacques Loeckx, Wolfgang Reif
1993 J jnl
Acta Informatica
Thomas Lehmann, Jacques Loeckx
1993 ch.
Current Trends in Theoretical Computer Science
Jacques Loeckx
1990 J jnl
Bull. EATCS
Jacques Loeckx
1989 book
Jacques Loeckx, Kurt Mehlhorn, Reinhard Wilhelm
1988 conf
Innovative Informations-Infrastrukturen
Jacques Loeckx, Joachim Philippi
1988 conf
ADT
Jacques Loeckx, Annette Hoffmann
1987 J jnl
ACM Trans. Program. Lang. Syst.
Jacques Loeckx
1987 book
The Foundations of Program Verification, 2nd ed.
Jacques Loeckx, Kurt Sieber
1987 conf
ADT
Thomas Lehmann, Jacques Loeckx
1986 J jnl
Bull. EATCS
Hartmut Ehrig, Jacques Loeckx, Bernd Mahr
1986 book
Jacques Loeckx, Kurt Mehlhorn, Reinhard Wilhelm
1986 conf
ADT
Jacques Loeckx
1985 conf
Mathematical Methods of Specification and Synthesis of Software Systems
Jacques Loeckx
1984 conf
ADT
Claus-Werner Lermen, Jacques Loeckx
1984 book
The Foundations of Program Verification, 1st ed.
Jacques Loeckx, Kurt Sieber
1983 conf
ADT
Jacques Loeckx
1982 conf
ADT
Jacques Loeckx
1981 A* conf
ICALP
Jacques Loeckx
1981 conf
GI Jahrestagung
Jacques Loeckx
1978 conf
Mathematical Studies of Information Processing
Jacques Loeckx, Ingrid Glasner
1977 conf
Theoretical Computer Science
Jacques Loeckx
1974 A* ed.
ICALP
Jacques Loeckx
1972 book
Jacques Loeckx
1972 J jnl
J. Comput. Syst. Sci.
Jürgen Eickel, Jacques Loeckx
1970 J jnl
Inf. Control.
Jacques Loeckx
redb/extractor_registry.py
← Index redb/extractor_registry.py python
"""
Extractor registry with lazy loading by file type.

Groups extractors by file type (pe, elf, macho, apk) and only imports
the relevant group when that file type is first encountered. This avoids
loading heavy dependencies (pefile, lief, androguard, etc.) into workers
that don't need them.
"""
import importlib
import logging

logger = logging.getLogger(__name__)

# Registry: group name -> list of (module_path, class_names)
_REGISTRY = {
    "pe": [
        ("redb.extractors.pe_extractors", [
            "PEFeaturesExtractor",
            "PEImportExtractor",
            "PEResourceExtractor",
            "PEOverlayExtractor",
            "PESectionExtractor",
            "PESignatureExtractor",
            "PEExtraFindings",
            "PEInconstistencyTestsExtractor",
            "PEDotNetExtractor",
        ]),
    ],
    "elf": [
        ("redb.extractors.elf_extractors", [
            "ELFFeaturesExtractor",
            "ELFSegmentExtractor",
            "ELFSectionExtractor",
            "ELFDependencyExtractor",
            "ELFSymbolExtractor",
            "ELFImportExtractor",
            "ELFExportExtractor",
            "ELFRelocationExtractor",
            "ELFNotesExtractor",
        ]),
    ],
    "macho": [
        ("redb.extractors.macho_extractors", [
            "MachOFeaturesExtractor",
            "MachOSegmentExtractor",
            "MachOImportExtractor",
            "MachOExportExtractor",
            "MachODylibExtractor",
            "MachOSignatureExtractor",
        ]),
    ],
    "apk": [
        ("redb.extractors.apk_extractors", [
            "APKFeaturesExtractor",
            "APKManifestExtractor",
            "APKPermissionsExtractor",
            "APKSignatureExtractor",
            "APKDexExtractor",
            "APKResourceExtractor",
            "APKNativeLibExtractor",
            "APKInconsistencyTestsExtractor",
        ]),
        ("redb.extractors.decompiler.DecompileAPK", [
            "DecompileAPK",
        ]),
    ],
    "js": [
        ("redb.extractors.js_extractors", [
            "JSFeaturesExtractor",
            "JSSuspiciousAPIsExtractor",
            "JSStringsExtractor",
            "JSDeobfuscationExtractor",
            "JSContentExtractor",
        ]),
    ],
}

# Map filetype labels (from Magika) to registry group names
FILETYPE_TO_GROUP = {
    "pebin": "pe",
    "elf": "elf",
    "macho": "macho",
    "apk": "apk",
    "javascript": "js",
}

# Cache: group name -> {class_name: class}
_group_cache = {}


def _load_group(group_name):
    """Import all extractors for a group. Cached after first call."""
    if group_name in _group_cache:
        return _group_cache[group_name]

    logger.debug(f"Loading extractor group: {group_name}")

    # Suppress androguard logging before importing APK extractors
    if group_name == "apk":
        from loguru import logger as loguru_logger
        loguru_logger.disable("androguard")

    classes = {}
    for module_path, class_names in _REGISTRY[group_name]:
        mod = importlib.import_module(module_path)
        for name in class_names:
            classes[name] = getattr(mod, name)

    _group_cache[group_name] = classes
    return classes


def get_filetype_modules(filetype):
    """Get the list of format-specific extractor classes for a filetype.

    Returns only analysis extractors (excludes decompilers like DecompileAPK).
    """
    group = FILETYPE_TO_GROUP.get(filetype)
    if not group:
        return []
    classes = _load_group(group)
    return [cls for name, cls in classes.items() if not name.startswith("Decompile")]


def get_extractor_class(name):
    """Look up a single extractor class by name across all groups.

    Checks cached groups first, then loads groups on demand.
    """
    # Check already-loaded groups first
    for group_classes in _group_cache.values():
        if name in group_classes:
            return group_classes[name]

    # Search all groups (triggers lazy loading)
    for group_name in _REGISTRY:
        classes = _load_group(group_name)
        if name in classes:
            return classes[name]

    return None