// Detect It Easy: detection rule file format

init("packer", "UPX");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (MACH.getNumberOfSections() == 2) {
        var nOffset = MACH.findString(0, MACH.getSize(), "$Id: UPX");
        if (nOffset != -1) {
            sVersion = MACH.getString(nOffset + 9, 4);
            bDetected = true;
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}