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

// https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/oscdimg-command-line-options
meta("tool", "CDIMAGE");

function detect() {
    var sAppId = ISO9660.getApplicationIdentifier();

    if (sAppId.indexOf("CDIMAGE") !== -1) {
        bDetected = true;

        // Try to extract version if present
        // Format: "CDIMAGE 2.54 (01/01/2005 TM)"
        var nVerPos = sAppId.indexOf("CDIMAGE");
        if (nVerPos !== -1) {
            var sVersionPart = sAppId.substring(nVerPos + 8).trim(),
                nSpacePos = sVersionPart.indexOf(" ");

            if (nSpacePos !== -1) {
                sVersion = sVersionPart.substring(0, nSpacePos);
            }
        }
    }

    return result();
}
