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

meta("packer", "FSG");

function detect() {
    if (PE.compareEP("BE........BF........BB........53BB........B280")) {
        sVersion = "1.31";
    } else if (PE.compareEP("BB........BF........BE........53E80A00000002D275058A164612D2")) {
        sVersion = "1.0";
    } else if (PE.compareEP("BB........BF........BE........FCB2808A064688074702D275058A16")) {
        sVersion = "1.1";
    } else if (PE.compareEP("EB02CD2003..8D..80....00..................EB02")) {
        sVersion = "1.10";
        sOptions = "Watcom C/C++ EXE";
    } else if (PE.compareEP("80E9A1C1C11368E4167546C1C1055EEB019D6864863746EB028CE05FF7D0")) {
        sVersion = "1.10";
        sOptions = "WinRAR-SFX";
    } else if (PE.compareEP("EB0102EB02CD20B8........EB0155BEF400000013DF13D80FB638D1F3F7")) {
        sVersion = "1.10";
        sOptions = "WinRAR-SFX";
    } else if (PE.compareEP("EB02CD202BC868........EB021EBB5EEB02CD2068B12B6E37405B0FB6C9")) {
        sVersion = "1.10";
        sOptions = "Borland C++ 1999";
    } else if (PE.compareEP("23CAEB025A0DE8020000006A3558C1C910BE........0FB6C9EB02CD20BB")) {
        sVersion = "1.10";
        sOptions = "Borland C++";
    } else if (PE.compareEP("2BC2E802000000954A598D3D52F12AE8C1C81CBE2E....18EB02ABA003F7")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi/Borland C++";
    } else if (PE.compareEP("EB012EEB02A555BB........87FE8D05AACEE063EB0175BA5ECEE063EB02")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi/Borland C++";
    } else if (PE.compareEP("EB02CD20EB02CD20EB02CD20C1E618BB........EB0282B8EB01108D05F4")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi/Microsoft Visual C++/ASM";
    } else if (PE.compareEP("C1C810EB010FBF03746677C1E91D6883....77EB02CD205EEB02CD202BF7")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi/Microsoft Visual C++";
    } else if (PE.compareEP("1BDBE8020000001A0D5B68........E801000000EA5A58EB02CD2068F400")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi/Microsoft Visual C++";
    } else if (PE.compareEP("EB0156E802000000B2D9596880..4100E8020000006532595EEB02CD20BB")) {
        sVersion = "1.10";
        sOptions = "Borland Delphi 2.0";
    } else if (PE.compareEP("F7D80FBEC2BE........0FBEC9BF083B6507EB02D829BBECC59AF8EB0194")) {
        sVersion = "1.10";
        sOptions = "MASM32/TASM32/Microsoft Visual Basic";
    } else if (PE.compareEP("03F723FE33FBEB02CD20BB........EB0186EB0190B8F400000083EE052B")) {
        sVersion = "1.10";
        sOptions = "MASM32/TASM32";
    } else if (PE.compareEP("EB01DBE80200000086435E8D1DD075CF83C1EE1D6850..8F83EB023D0F5A")) {
        sVersion = "1.10";
        sOptions = "MASM32";
    } else if (PE.compareEP("EB0209940FB7FF68........81F68E0000005BEB0211C28D05F400000047")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual Basic/MASM32";
    } else if (PE.compareEP("C1CB10EB010FB90374F6EE0FB6D38D0583....EF80F3F62BC1EB01DE6877")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual Basic 5.0/6.0";
    } else if (PE.compareEP("2C711BCAEB012AEB01658D3580....0080C98480C968BBF4000000EB01EB")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 4.X/LCC Win32 1.X";
    } else if (PE.compareEP("33D20FBED2EB01C7EB01D88D0580......EB02CD20EB01F8BEF4000000EB")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 5.0/6.0";
    } else if (PE.compareEP("E8010000005A5EE802000000BADD5E03F2EB0164BB........8BFAEB01A8")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/7.0/ASM";
    } else if (PE.compareEP("0BD08BDAE80200000040A05AEB019DB8........EB02CD2003D38D35F400")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/7.0";
    } else if (PE.compareEP("87FEE80200000098CC5FBB80....00EB02CD2068F4000000E801000000E3")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/7.0";
    } else if (PE.compareEP("F7D84049EB02E00A8D3580......0FB6C2EB019C8D1DF4000000EB013C80")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/7.0";
    } else if (PE.compareEP("F7DB80EABFB92F4067BAEB010168AF..A7BA80EA9D58C1C2092BC18BD768")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/7.0";
    } else if (PE.compareEP("F7D0EB02CD20BEBB741CFBEB02CD20BF3B....FBC1C10333F7EB02CD2068")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0/ASM";
    } else if (PE.compareEP("03DEEB01F8B8........EB02CD206817A0B3ABEB01E8590FB6DB680BA1B3")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("91EB02CD20BF50BC046F91BED0....6FEB02CD202BF7EB02F0468D1DF400")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("C1CE10C1F60F68........2BFA5B23F98D15........E801000000B65E0B")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("E8010000000E59E8010000005858BE........EB0261E968F4000000C1C8")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("EB014D83F64C68........EB02CD205BEB012368481C2B3AE80200000038")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("EB02AB35EB02B5C68D05........C1C211BEF4000000F7DBF7DB0FBE38E8")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("EB02CD20..CF....80....00................00")) {
        sVersion = "1.10";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("C1F007EB02CD20BE........1BC68D1DF40000000FB606EB02CD208A160F")) {
        sVersion = "1.20";
        sOptions = "Borland C++";
    } else if (PE.compareEP("0FBEC1EB010E8D35C3BEB622F7D16843....22EB02B5155FC1F11533F780")) {
        sVersion = "1.20";
        sOptions = "Borland Delphi/Borland C++";
    } else if (PE.compareEP("0FB6D0E8010000000C5AB8........EB0200DE8D35F4000000F7D2EB020E")) {
        sVersion = "1.20";
        sOptions = "Borland Delphi/Microsoft Visual C++";
    } else if (PE.compareEP("33C22CFB8D3D7E45B480E8020000008A45586802..8C7FEB02CD205E80C9")) {
        sVersion = "1.20";
        sOptions = "MASM32/TASM32";
    } else if (PE.compareEP("EB02CD20EB01918D35........33C26883937E7D0CA45B23C36877937E7D")) {
        sVersion = "1.20";
        sOptions = "Microsoft Visual C++ 6.0/7.0";
    } else if (PE.compareEP("C1E006EB02CD20EB0127EB0124BE........49EB01998D1DF4000000EB01")) {
        sVersion = "1.20";
        sOptions = "Microsoft Visual C++ 6.0";
    } else if (PE.compareEP("BB........BF........BE........53BB........B280A4B680FFD373F9")) {
        sVersion = "1.31";
    } else if (PE.compareEP("BE........AD93AD97AD5696B280A4B680FF1373")) {
        sVersion = "1.33";
    } else if (PE.compareEP("BE........AD97AD569683CD..EB")) {
        sVersion = "1.3.3";
    } else if (PE.compareEP("8725........619455A4B6..FF13")) {
        sVersion = "2.0";
    }

    bDetected = bDetected || Boolean(sVersion);

    return result();
}
