// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>

meta("compiler", "Zig");

function detect() {
    if ((ELF.isSectionNamePresent(".rodata")) && (ELF.isDeepScan())) {
        var nIndex = ELF.getSectionNumber(".rodata");

        var nOffset = ELF.getSectionFileOffset(nIndex);
        var nSize = ELF.getSectionFileSize(nIndex);

        var nVersionOffset = ELF.findSignature(nOffset, nSize, "5a49475f44454255475f434f4c4f52"); // ANSI ZIG_DEBUG_COLOR

        if (nVersionOffset != -1) {
            bDetected = true;
        }
    }

    sLang = "Zig";

    return result();
}
