Skip to content

Architecture: Binary Text-Projection Intermediary Layer (Regex over Binary) #3980

Description

@squid-protocol

Explicit Goals & Capabilities

Allow the GitGalaxy regex engine to natively ingest and extract dependency graphs from compiled binaries, JARs, and raw datasets without requiring expensive, rigid decompilers (like Ghidra) or AST source code.

The Concept

Standard regex chokes on null bytes and machine code. We will build an intermediary "Text-Projection" bridge. When GitGalaxy encounters a binary file, it will not parse it directly. Instead, it will project the binary into a deterministic, highly-structured text stream, and run our standard regex extractors over that text.

Detailed Plan & Options to Consider

  1. The Dispatcher (prism.py injection): Implement a MIME/null-byte check on file ingestion. If a file is binary, route it to the BinaryProjectionBridge.
  2. Pluggable Projection Handlers:
    • Strings Handler: Replicates the Unix strings utility. Strips unprintable machine code and outputs only contiguous readable characters (configurable for ASCII or EBCDIC).
    • Hex-Grid Handler: Replicates xxd. Converts unreadable bytes into a strict 2-character hexadecimal text grid.
    • Disassembler Handler: A passthrough for modern bytecode (e.g., executing javap -c for Java .class files and capturing the text stdout).
  3. Regex Re-routing: The resulting flat text is fed back into GitGalaxy's standard registry. This enables us to use our existing COBOL, Java, or C extractors to find database calls and dependencies directly inside the compiled binary text projection.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, sensor, or structural signature

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions