// Detect It Easy: detection rule file format
// Author: sendersu
/*
If errors pls contact sendersu on cracklab.team
*/

init("protection", "Wibu Codemeter");

function detect(bShowType, bShowVersion, bShowOptions) {
    var nFound = 0;
    var nOffset;

    for (var i = 0; i <= PE.nLastSection; i++) {
        nOffset = PE.section[i].FileOffset;
        sSection = PE.section[i].Name;
        if (sSection == "__wibu00") {
            ++nFound;
        } else if (sSection == "__wibu01") {
            ++nFound;
        }
        // actually you may see many more __wibuXX sections,
        // we test just first two
        if (nFound == 2) {
            bDetected = true;
            break;
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}