// Detect It Easy: detection rule file
// Author: hypn0 <hypn0@mail.ru>

meta("sfx", "RAR (custom)");

function detect() {
    if (PE.compareEP("558bec83c4..535657e8........e8........33c05568........64ff30648920e8")) { //Borland Delphi 2
        for (var i = 0; i < PE.resource.length && !bDetected; i++) {
            if (PE.compare("'rar!'", PE.resource[i].Offset)) {
                sOptions = "type 1";
                bDetected = true;
            }
        }
    } else if ((PE.compareEP("a1........c1e0..a3")) // Borland C++
    && (PE.isSignaturePresent(PE.getOverlayOffset(), 4096, "'Rar!'"))) {
        sOptions = "type 2";
        bDetected = true;
    }

    return result();
}