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

meta("compiler", "FASM");

function detect() {
    if (ELF.getElfHeader_shstrndx() == 0 && ELF.getElfHeader_shnum() == 0 && ELF.getElfHeader_shentsize()) {
        sVersion = "1.X";
        bDetected = true;

        for (var i = 0; i < ELF.getNumberOfPrograms() - 1 && bDetected; i++) {
            if (ELF.getProgramFileOffset(i) == 0) {
                bDetected = false;
            }
        }
    }

    sLang = "ASMx" + (ELF.is64() ? "64" : "86");

    return result();
}
