Convert Figma logo to code with AI

horsicq logoDetect-It-Easy

Program for determining types of files for Windows, Linux and MacOS.

7,796
740
7,796
30

Top Related Projects

Reverse Engineer's Toolkit

15,782

Free and Open Source Reverse Engineering Platform powered by rizin

51,154

Ghidra is a software reverse engineering (SRE) framework

FLARE Obfuscated String Solver - Automatically extract obfuscated strings from malware.

Scans a given process. Recognizes and dumps a variety of potentially malicious implants (replaced/injected PEs, shellcodes, hooks, in-memory patches).

Quick Overview

Detect It Easy (DIE) is a utility that can detect the type of executable files. It supports a wide range of file formats, including PE, ELF, Mach-O, and more. DIE can be used to quickly identify the file type and architecture of a given binary, which can be useful for reverse engineering, malware analysis, and other security-related tasks.

Pros

  • Extensive File Format Support: DIE can detect a wide range of file formats, including PE, ELF, Mach-O, Java class files, and many others.
  • Cross-Platform: DIE is available for Windows, Linux, and macOS, making it a versatile tool for various operating systems.
  • Actively Maintained: The project is actively maintained, with regular updates and bug fixes.
  • Open-Source: DIE is an open-source project, allowing users to contribute, customize, and extend the tool as needed.

Cons

  • Command-Line Interface: DIE primarily has a command-line interface, which may not be as user-friendly as a graphical user interface (GUI) for some users.
  • Limited Automation: While DIE can be used in scripts, it may lack some advanced automation features compared to other file analysis tools.
  • Steep Learning Curve: The extensive file format support and configuration options in DIE can make it challenging for new users to get started.
  • Potential False Positives: As with any file analysis tool, DIE may occasionally produce false positive results, especially for less common or obfuscated file formats.

Code Examples

Here are a few examples of how to use DIE in your code:

  1. Detecting the file type of a binary:
from die import DIE

file_path = "path/to/your/binary"
die = DIE()
result = die.analyze(file_path)
print(result.get_type())
  1. Extracting file information:
from die import DIE

file_path = "path/to/your/binary"
die = DIE()
result = die.analyze(file_path)
print(result.get_info())
  1. Checking the file architecture:
from die import DIE

file_path = "path/to/your/binary"
die = DIE()
result = die.analyze(file_path)
print(result.get_architecture())
  1. Saving the analysis report:
from die import DIE

file_path = "path/to/your/binary"
die = DIE()
result = die.analyze(file_path)
result.save_report("analysis_report.txt")

Getting Started

To get started with DIE, follow these steps:

  1. Install DIE:

    • On Windows, you can download the latest release from the GitHub repository.
    • On Linux or macOS, you can install DIE using your package manager (e.g., apt-get, brew) or by compiling the source code.
  2. Run DIE from the command line:

    • On Windows, open a command prompt and navigate to the DIE directory, then run die.exe.
    • On Linux or macOS, open a terminal, navigate to the DIE directory, and run ./die.
  3. Analyze a file:

    • To analyze a file, simply pass the file path as an argument to the die command, e.g., die path/to/your/binary.
    • DIE will then display the file type, architecture, and other relevant information.
  4. Customize DIE:

    • DIE has a wide range of configuration options, which you can find in the documentation.
    • You can customize the file detection rules, output format, and other settings to suit your needs.

That's the basic getting started guide for DIE. For more advanced usage and features, please refer to the project's documentation and GitHub repository.

Competitor Comparisons

Reverse Engineer's Toolkit

Pros of retoolkit

  • Provides a wide range of tools for reverse engineering, including disassemblers, debuggers, and binary analysis utilities.
  • Supports multiple file formats and architectures, making it a versatile tool for analyzing various types of binaries.
  • Offers a user-friendly interface with a modern design, making it easier to navigate and use.

Cons of retoolkit

  • May have a steeper learning curve compared to Detect-It-Easy, as it offers a more comprehensive set of features.
  • Some users may find the interface less intuitive or overwhelming, especially for those new to reverse engineering.
  • Requires more system resources than Detect-It-Easy, which may be a concern for users with limited hardware.

Code Comparison

Detect-It-Easy:

def detect_file(filename):
    try:
        with open(filename, 'rb') as f:
            data = f.read()
            for rule in rules:
                if rule.match(data):
                    return rule.name
    except:
        pass
    return 'Unknown'

retoolkit:

def analyze_file(filename):
    try:
        with open(filename, 'rb') as f:
            data = f.read()
            for analyzer in analyzers:
                if analyzer.is_compatible(data):
                    return analyzer.analyze(data)
    except:
        pass
    return 'Unknown'

The code snippets show that both Detect-It-Easy and retoolkit have similar approaches to file analysis, where they iterate through a set of rules or analyzers to determine the file type. The main difference is that retoolkit uses a more modular approach with separate analyzer classes, while Detect-It-Easy has a more straightforward implementation.

15,782

Free and Open Source Reverse Engineering Platform powered by rizin

Pros of Cutter

  • Cutter provides a graphical user interface (GUI) for the Rizin reverse engineering framework, making it more user-friendly for beginners and those who prefer a visual approach.
  • Cutter offers a wide range of features, including disassembly, debugging, and code analysis, which can be useful for various reverse engineering tasks.
  • Cutter is actively maintained and has a growing community of contributors, ensuring regular updates and improvements.

Cons of Cutter

  • Cutter is primarily focused on the Rizin framework, which may not be as widely used as other reverse engineering tools like IDA Pro or Ghidra.
  • The learning curve for Cutter may be steeper than that of Detect-It-Easy, as it requires understanding the Rizin framework and its capabilities.
  • Cutter may have a larger resource footprint compared to Detect-It-Easy, as it is a full-fledged GUI application.

Code Comparison

Detect-It-Easy (horsicq/Detect-It-Easy):

def detect_file(file_path):
    try:
        with open(file_path, 'rb') as f:
            data = f.read()
            for plugin in plugins:
                if plugin.check(data):
                    return plugin.get_name()
    except:
        pass
    return 'Unknown'

Cutter (rizinorg/cutter):

void CutterCore::loadFile(const QString &path, uint64_t loadaddr, uint64_t mapaddr, int perms, int va, int bits, bool loadbin) {
    QList<QString> warnings = this->loadList(path, loadaddr, mapaddr, perms, va, bits, loadbin);
    for (const QString &warning : qAsConst(warnings)) {
        this->addWarning(warning);
    }
    this->triggerRefreshAll();
}
51,154

Ghidra is a software reverse engineering (SRE) framework

Pros of Ghidra

  • Ghidra is a powerful and feature-rich reverse engineering tool, with a wide range of capabilities including disassembly, debugging, and analysis.
  • Ghidra has a large and active community, with extensive documentation and support available.
  • Ghidra is open-source and free to use, making it accessible to a wide range of users.

Cons of Ghidra

  • Ghidra has a steep learning curve, and can be challenging for beginners to use effectively.
  • Ghidra is a large and complex application, which can make it resource-intensive and slow to load on some systems.

Code Comparison

Detect-It-Easy:

def detect_file(file_path):
    try:
        with open(file_path, 'rb') as f:
            data = f.read()
            for rule in rules:
                if rule.match(data):
                    return rule.name
    except:
        pass
    return 'Unknown'

Ghidra:

public void analyzeFile(File file) {
    try {
        FileSystem fileSystem = FileSystemService.getInstance().getFileSystem(file);
        Program program = ProgramBuilder.build(file, fileSystem, TaskMonitor.DUMMY, new MessageLog());
        // Perform analysis on the program
    } catch (Exception e) {
        // Handle exceptions
    }
}

FLARE Obfuscated String Solver - Automatically extract obfuscated strings from malware.

Pros of Flare-FLOSS

  • Flare-FLOSS is a powerful tool for extracting obfuscated strings from malware samples, which can be useful for reverse engineering and analysis.
  • The project has a large and active community, with regular updates and contributions from security researchers.
  • Flare-FLOSS supports a wide range of file formats, including PE, ELF, and Mach-O files.

Cons of Flare-FLOSS

  • Flare-FLOSS is primarily focused on string extraction, and may not provide the same level of functionality as Detect-It-Easy for file identification and classification.
  • The installation and setup process for Flare-FLOSS can be more complex than Detect-It-Easy, which may be a barrier for some users.

Code Comparison

Detect-It-Easy:

def get_file_info(filename):
    try:
        with open(filename, 'rb') as f:
            data = f.read()
            return {
                'filename': filename,
                'size': len(data),
                'type': get_file_type(data)
            }
    except Exception as e:
        return {
            'filename': filename,
            'size': 0,
            'type': 'Unknown'
        }

Flare-FLOSS:

def extract_strings(data, min_length=4):
    """
    Extract strings from the given data.
    """
    strings = []
    for match in re.finditer(b'[\x20-\x7E]{%d,}' % min_length, data):
        start = match.start()
        end = match.end()
        strings.append(data[start:end].decode('ascii', errors='ignore'))
    return strings

Scans a given process. Recognizes and dumps a variety of potentially malicious implants (replaced/injected PEs, shellcodes, hooks, in-memory patches).

Pros of PE-Sieve

  • PE-Sieve is designed specifically for analyzing and detecting malicious modifications in Windows PE (Portable Executable) files, making it a more specialized tool compared to Detect-It-Easy.
  • PE-Sieve provides detailed information about the detected modifications, including the type of modification and the affected module.
  • PE-Sieve supports a wide range of Windows versions, from Windows XP to the latest versions.

Cons of PE-Sieve

  • Detect-It-Easy has a more user-friendly interface and is easier to use for non-technical users, while PE-Sieve requires more technical expertise.
  • Detect-It-Easy supports a broader range of file formats, including ELF, Mach-O, and others, while PE-Sieve is focused solely on Windows PE files.

Code Comparison

Here's a brief code comparison between the two projects:

Detect-It-Easy (horsicq/Detect-It-Easy):

bool CDetectItEasy::isFileSupported(const QString& fileName)
{
    QFile file(fileName);

    if(file.open(QIODevice::ReadOnly))
    {
        QByteArray data=file.read(4);

        file.close();

        if(data.size()==4)
        {
            return isFileSupported(data);
        }
    }

    return false;
}

PE-Sieve (hasherezade/pe-sieve):

bool PESieve::checkPEFile(const std::wstring& file_path)
{
    HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId());
    if (hProcess == NULL) {
        return false;
    }

    PeParser pe_parser(file_path, hProcess);
    if (!pe_parser.loadPe()) {
        CloseHandle(hProcess);
        return false;
    }

    CloseHandle(hProcess);
    return true;
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

🔍 Detect It Easy (DiE)

Donate GitHub tag (latest SemVer) GitHub All Releases gitlocalized

Detect It Easy (DiE) is a powerful tool for file type identification, popular among malware analysts, cybersecurity experts, and reverse engineers worldwide. Supporting both signature-based and heuristic analysis, DiE enables efficient file inspections across a broad range of platforms, including Windows, Linux, and MacOS. Its adaptable, script-driven detection architecture makes it one of the most versatile tools in the field, with a comprehensive list of supported OS images.

🚀 Getting Started

Screenshot

💡 Why Use Detect It Easy?

Detect It Easy’s flexible signature system and scripting capabilities make it an essential tool for malware analysis and digital forensics. With traditional static analyzers often limited in scope and prone to false positives, DiE’s customizable design enables precise integration of new detection logic, ensuring reliable results across diverse file types.

Screenshot

Key Advantages:

  • Flexible Signature Management: Easily create, modify, and optimize signatures.
  • Cross-Platform Support: Runs on Windows, Linux, and MacOS.
  • Minimal False Positives: Combined signature and heuristic analysis ensures high detection accuracy.

📄 Supported File Types

Detect It Easy supports a wide range of executable and archive types, including:

  • PE (Portable Executable format for Windows)
  • ELF (Executable and Linkable Format for Linux)
  • APK (Android Application Package)
  • IPA (iOS Application Package)
  • JAR (Java Archive)
  • ZIP (Compressed archives)
  • DEX (Dalvik Executable for Android)
  • MS-DOS (MS-DOS executable files)
  • COM (Simple executable format for DOS)
  • LE/LX (Linear Executable for OS/2)
  • MACH (Mach-O files for MacOS)
  • NPM (JavaScript packages)
  • Amiga (Executable format for Amiga computers)
  • Binary (Other unclassified files)

Unknown formats undergo heuristic analysis, providing identification for both known and unrecognized files.

🔑 Key Features

  • Flexible Signature Management: Define or modify detection signatures.
  • Scripted Detection: Use a JavaScript-like scripting language for custom detection algorithms.
  • Cross-Platform Compatibility: Available for Windows, Linux, and MacOS.
  • Reduced False Positives: Combines signature and heuristic scanning for accuracy.

📥 Installation

📦 Install via Package Managers

  • Windows: Chocolatey
  • Linux:
    • Parrot OS: Package name detect-it-easy
    • Arch Linux: AUR package detect-it-easy-git
    • openSUSE: OBS
    • REMnux: Malware analysis distribution

[!NOTE] Use Detect It Easy bot via Telegram to quickly check files: @detectiteasy_bot

⚙️ Build from Source

See the BUILD.md for detailed instructions.

🐳 Docker Installation

Run DiE in a Docker container:

git clone --recursive https://github.com/horsicq/Detect-It-Easy
cd Detect-It-Easy/
docker build . -t horsicq:diec

🖥️ Usage

Detect It Easy offers three versions:

  • die - Graphical interface.
  • diec - Command-line version for batch processing.
  • diel - Lightweight GUI version.

For detailed usage, refer to the RUN.md.

🔎 Example Use Cases

  • Malware Analysis: Identify file types, packers, or protections.
  • Security Audits: Determine executable file types and potential security risks.
  • Software Forensics: Inspect software components and validate compliance.

🏆 Special Thanks

Thanks to all contributors!

Thanks to PELock Software Protection & Reverse Engineering

Mascot