unit FI_CHK;


{***************************************************************************************}
{ This is a small part of my identifier library, cant work alone, only for information }

{ All rights reserved 1999/09; M.H.                        mailto:herinmi@tu-cottbus.de }

{ No mail crap please.. Thanks..                        Full source is NOT available!   }
{***************************************************************************************}



{###########################################################################}
INTERFACE       { Public symbols }
{###########################################################################}

uses fi_tool;                              {for IS_FOUND, IS_BUF, FOUND, IS_JMP and other tools}

function CHK4_BIN:boolean;                 {INCLUDED; archives, moduls, other }
function CHK4_COM:boolean;                 {all of com what available }

function CHK4_EXP:boolean;                 {exeprotectors/execryptors/scrambler}
function CHK4_EXC:boolean;                 {exepacker}
function CHK4_EXT:boolean;                 {INCLUDED; dosextender}

function CHK4_CMP(hchr:char):boolean;      {INCLUDED; compiler}

function CHK4_WIN:boolean;                 {lx/le/ne/pe}


{###########################################################################}
 IMPLEMENTATION { Private symbols }
{###########################################################################}

const                  { !!! Permission to added comments, nothing else !!! M.H. }
  T_unk_COM  = 00099;
  Tscr_abk   = 00100;  {COM-Protector, -Scrambler, -Packer}
  Tscr_ady   = 00110;
  Tc_apack   = 00120;
  Tc_avpack  = 00130;
  {'A'}
  Tbinlock   = 00200;
  Tbat2exc   = 00210;
  {'B'}
  Tcc286     = 00300;
  Tcom2txt   = 00310;
  Tcom2txt2  = 00311;
  Tcomcry97  = 00320;
  Tcomcry98  = 00321;
  Tcomlock   = 00330;
  Tcop       = 00340;
  Tcompack4  = 00350;
  Tcompack5  = 00351;
  Tcompro10  = 00360;
  Tcompro11  = 00361;
  Tcomfprot  = 00365;
  Tcomt      = 00370;
  Tc_cii     = 00380;
  Tccrypt02  = 00390;
  Tcryptcom  = 00400;
  Tcryptcom1 = 00404;
  Tcryptcom2 = 00407;
  Tc_crypt7  = 00410;
  Tc_cscry30 = 00420;
  {'C'}
  Tc_dstop   = 00500;
  Tdeepcrypt = 00510;
  Tc_diet    = 00520;
  Tdscrypt   = 00530;
  {'D'}
  Tc_elite   = 00600;
  Tc_elite2  = 00601;
  Tencrypt   = 00610;
  Tencrycom6 = 00620;
  Texe2comMS = 00630;
  Texe2comDOP= 00631;
  Texe2comJM = 00632;
  Texe2com1  = 00633;
  Texe2com2  = 00634;
  Texc1      = 00635;
  Tc_execode = 00640;
  Tc_extols  = 00650;
  Tc_extols3 = 00651;
  {'E'}
  Tfalcon    = 00700;
  Tfdscry4   = 00710;
  Tfdscry4a  = 00711;
  {'F'}
  Tc_gangel  = 00800;
  {'G'}
  Tc_hstop   = 00900;
  Thdkprot   = 00910;
  {'H'}
  Tibmcrew   = 01000;
  Tice       = 01010;
  Tc_ilucry4 = 01020;
  Tc_ilucry5 = 01021;
  Tc_ilucry7 = 01022;
  Tc_ilucry8 = 01023;
  Tc_ilucry9 = 01024;
  {'I'}
  Tjmcrypt5a = 01100;
  Tc_jmtseng = 01109;
  Tjvp       = 01110;
  {'J'}
  Tkhrome    = 01200;
  {'K'}
  Tlockp5a   = 01300;
  {'L'}
  Tmask      = 01400;
  Tc_mclock  = 01410;
  Tmcrypt    = 01420;
  Tc_mess    = 01430;
  Tmisha     = 01440;
  Tscr_moshe = 01450;
  Tmscc      = 01460;
  {'M'}
  Tnetrun    = 01500;
  {'N'}
  Tpcrypt    = 01700;
  Tc_pklite  = 01710;
  Tc_pklite2 = 01711;
  Tpmutate   = 01720;
  Tc_propa08 = 01730;
  Tc_propa14 = 01731;
  Tc_prot5x  = 01740;
  Tc_protx21 = 01750;
  Tc_protx30 = 01751;
  Tc_protx31 = 01752;
  {'P'}
  Trcc286    = 01800;
  Trcc386    = 01810;
  Trcrypt91  = 01820;
  Trscc      = 01830;
  {'R'}
  Tsageprot  = 01900;
  Tscram5    = 01910;
  Tscram8a   = 01911;
  TscrE2B    = 01920;
  Tc_scrnch  = 01930;
  Tscrypt    = 01940;
  Tscrypt_u  = 01941;
  Tsecure21  = 01950;
  Tselfenc   = 01960;
  Tshrink1   = 01970;
  Tshrink2   = 01971;
  Tc_snoop13 = 01980;
  Tc_snoop15 = 01981;
  Tc_snoop15r= 01982;
  Tc_spirit  = 01990;
  Tc_stillson= 02000;
  Tsynopsis  = 02010;
  {'S'}
  Ttpack     = 02100;
  Tc_scr_tpc = 02110;
  Tc_trap13  = 02120;
  Tc_trapx   = 02121;
  {'T'}
  Tc_upx     = 02200;
  Tc_upx76   = 02209;
  Tc_upx81   = 02210;
 {Tc_upx82   = 02211;}
  {'U'}
  Tx3        = 02300;
  TxcomOr99  = 02310;
  TxcomOr99f = 02311;
  TxcomOr99h = 02312;
  TxcomOr99i = 02313;
  Txorcopy   = 02320;
  Tc_xpack   = 02330;
  {'X'}
  T624       = 02500;
  T6241      = 02501;

  {*****************}

  T_unk_EXE  = 09999;
  T_adyglue  = 10000;  {EXE-Cryptor, -Scrambler, -Protector}
  T_alec     = 10010;
  T_alec13   = 10011;
  T_alec15   = 10012;
  T_antiupc0 = 10020;
  T_antiupcl = 10021;
  T_protupc  = 10022;
  T_ateu11   = 10030;
  T_ateu12   = 10031;
  {'A'}
  T_bitlock  = 10100;
  T_bitlok3  = 10110;
  T_blok7nt  = 10120;
  {'B'}
  T_ciph46   = 10200;
  T_comvert  = 10210;
  T_cstop0   = 10220;
  T_cstop1   = 10221;
  T_cstop2   = 10222;
  T_cstop3   = 10223;
  T_cryexe4  = 10230;
  T_cryx_max = 10231;
  T_crypt21  = 10240;
  T_crypt7   = 10241;
  T_crypack3 = 10250;
  T_crypta2  = 10260;
  T_crypta3  = 10261;
  T_cryptx0  = 10270;
  T_cryptx01 = 10271;
  T_cryptx04 = 10272;
  T_crexc09  = 10280;
  T_crexc101 = 10281;
  T_cscry30  = 10290;
  {'C'}
  T_dstop    = 10400;
  T_dcr12    = 10410;
  T_dcrexe2  = 10411;
  T_demo2    = 10420;
  {'D'}
  T_epack16  = 10500;
  T_espteam  = 10510;
  T_execode  = 10520;
  T_exeguard = 10530;
  T_exelock  = 10540;
  T_exelock1 = 10541;
  T_exlo666  = 10550;
  T_exeman30 = 10560;
  T_exeman33 = 10561;
  T_exeman40 = 10562;
  T_extols   = 10570;
  {'E'}
  T_flat12   = 10600;
  T_fse4e    = 10610;
  T_fse5     = 10611;
  T_fse6     = 10612;
  {'F'}
  T_gaheader = 10700;
  T_gangel   = 10710;
  T_gamewiz  = 10720;
  {'G'}
  T_hstop    = 10800;
  {'H'}
  T_ilucry4  = 10900;
  T_ilucry5  = 10901;
  T_ilucry7  = 10902;
  T_ilucry8  = 10903;
  T_ilucry9  = 10904;
  {'I'}
  T_jmce7j   = 11000;
  {'J'}
  T_kartz    = 11100;
  T_kshell10 = 11110;
  T_kshell21 = 11111;
  {'K'}
  T_lockexe  = 11200;
  T_lstop    = 11210;
  {'L'}
  T_madokan  = 11300;
  T_mexeBW   = 11310;
  T_mclock   = 11320;
  T_mess     = 11330;
  T_mess07   = 11331;
  T_mess13   = 11332;
  T_mess14   = 11333;
  T_mess20   = 11334;
  T_mess_max = 11339;
  T_msep     = 11340;
  {'M'}
  T_ntshell4 = 11400;
  {'N'}
  T_overlay3 = 11500;
  {'O'}
  T_paspatch = 11600;
  T_pcrypt50 = 11610;
  T_pcguard  = 11620;
  T_phrozen  = 11630;
  T_pmutate  = 11640;
  T_protx21  = 11650;
  T_protx30  = 11651;
  T_protx31  = 11652;
  T_protect  = 11660;
  T_prot5x   = 11661;
  T_prot6    = 11662;
  {'P'}
  T_rec      = 11700;
  T_rec3     = 11701;
  T_recs01   = 11710;
  T_recs02   = 11711;
  T_recs02a  = 11712;
  T_recs03   = 11713;
  T_recs04   = 11714;
  T_recs05   = 11715;
  T_recsa01  = 11720;
  T_recsa02  = 11721;
  T_recsa03  = 11722;
  T_rerp     = 11730;
  {'R'}
  T_secure0  = 11800;
  T_secure21 = 11810;
  T_senprot  = 11820;
  T_spirit   = 11830;
  T_stillson = 11840;
  T_suckstop = 11850;
  {'S'}
  T_tbav     = 11900;
  T_tcec     = 11910;
  T_tinyprot = 11920;
  T_scr_tpc  = 11930;
  T_trap     = 11940;
  T_trap13   = 11941;
  T_trap13x  = 11942;
  T_trap14   = 11943;
  T_trap15   = 11944;
  T_trap16   = 11945;
  T_trap17   = 11946;
  T_trap18   = 11947;
  T_trap20   = 11948;
  T_trap21   = 11949;
  T_trap22   = 11950;
  T_trap23   = 11951;
  T_trap24   = 11952;
  {'T'}
  T_un2pack  = 12000;
  T_upstop2  = 12010;
  T_upstop4  = 12011;
  T_upstop5  = 12012;
  T_upstop6  = 12013;
  T_upstop7  = 12014;
  T_username = 12020;
  T_utilcode = 12030;
  {'U'}
  T_wwpmut   = 12100;
  T_wwpmut10 = 12101;
  T_wwpmut11 = 12102;

  {*****************}

  T_aep      = 20000;  {EXE-Packer}
  T_ainexe   = 20010;
  T_aluwain9 = 20020;
  T_apack    = 20030;
  T_avpack   = 20040;
  {'A'}
  T_compack  = 20200;
  T_comprex  = 20210;
  T_cruncher = 20220;
  T_com2exe  = 20230;
  T_scrb2e   = 20231;
  {'C'}
  T_diet     = 20300;
  {'D'}
  T_elite    = 20400;
  T_elite2   = 20401;
  T_exehigh  = 20410;
  {'E'}
  T_jam      = 20900;
  {'J'}
  T_kvetch   = 21000;
  {'K'}
  T_lglz     = 21100;
  T_lzexe    = 21110;
  {'L'}
  T_megalite = 21200;
  T_msepa    = 21210;
  T_msepa365 = 21211;
  T_msepa369 = 21212;
  T_msepa400 = 21213;
  T_msepa403 = 21214;
  T_msepa405 = 21215;
  T_msepa407 = 21216;
  {'M'}
  T_optlink  = 21400;
  {'O'}
  T_packwin  = 21500;
  T_pack1    = 21510;
  T_pack2    = 21511;
  T_pgmpack  = 21520;
  T_pklite   = 21530;
  T_pklite2  = 21531;
  T_pksmart  = 21540;
  T_pktiny   = 21550;
  T_propa08  = 21560;
  T_propa14  = 21561;
  {'P'}
  T_rjcrush  = 21600;
  T_rosetiny = 21610;
  {'R'}
  T_scrnch   = 21700;
  T_seaxe    = 21710;
  {'S'}
  T_tinyprog = 21800;
  T_tnyprog3 = 21801;
  T_tnyprog6 = 21802;
  T_tnyprog8 = 21803;
  T_tnyprog9 = 21804;
  {'T'}
  T_ucexe    = 21900;
  T_upx      = 21910;
  T_upx05    = 21911;
  T_upx81    = 21920;
 {T_upx82    = 21921;}
  {'U'}
  T_wwp      = 22000;
  T_wwpreloc = 22001;
  T_wwp3     = 22002;
  T_wwp5     = 22003;
  {'W'}
  T_xpack1   = 22100;
  T_xpack64  = 22101;
  T_xpack66  = 22102;
  T_xpack67f = 22103;
  T_xpack67j = 22104;
  T_xpack67k = 22105;
  T_xpack67_ = 22106;
  T_xe1      = 22110;
  {'X'}

  {*****************}

  T_cpav     = 25030;  {Immunization}
  T_fshield  = 25060;
  T_fxlock16 = 25061;
  T_immun12  = 25080;
  T_mcafee   = 25120;
  T_rendds   = 25170;
  T_tnt      = 25190;
  T_vss      = 25210;

  {*****************}

  T__dos16   = 30000;  {DosExt}
  T16_4g_32l = 30010;
  T16_causew = 30020;
  T16_djp    = 30030;
  T16_dos32  = 30040;
  T16_pmwl   = 30050;
  T16_upx    = 30060;

  {*****************}

  T__NE      = 35000;  {NE}
  Tne_pcgua  = 35010;
  Tne_pkl    = 35020;
  Tne_shrnk  = 35030;

  {*****************}

  T__LE      = 40000;  {LE}
  Tle_32lite = 40010;
  Tle_upx    = 40020;
  Tle_xe     = 40030;

  {*****************}

  T__LX      = 45000;  {LX}
  Tlx_rle    = 45010;
  Tlx_lite18 = 45020;

  {*****************}

  T__PE      = 50000;  {PE}

  Tpe_aspck2 = 50010;
  Tpe_aspck4 = 50011;
  Tpe_aspck5 = 50012;
  Tpe_aspck6 = 50013;
  Tpe_aspck7 = 50014;
  Tpe_aspck8 = 50015;
  Tpe_aspck83= 50016;
  {A}
  Tpe_bjfnt1 = 50100;
  Tpe_bjfnt2 = 50101;
  Tpe_bjfnt3 = 50102;
  {B}
  Tpe_csafe2 = 50200;
  Tpe_csafe3 = 50201;
  Tpe_crypt  = 50210;
  {C}
  Tpe_dblock = 50300;
  {D}
  Tpe_expro37= 50400;
  {E}

  Tpe_gleam  = 50600;
  {G}
  {H}{I}{J}{K}
  Tpe_locknt1= 51000;
  Tpe_locknt2= 51001;
  Tpe_locknt3= 51002;
  Tpe_locknt4= 51003;
  {L}
  {M}
  Tpe_neol1x = 51300;
  Tpe_neol20 = 51301;
  {N}
  {O}
  Tpe_pack99 = 51400;
  Tpe_pack00 = 51401;
  Tpe_pepsi  = 51410;
  Tpe_phan08 = 51420;
  Tpe_phan1  = 51421;
  Tpe_ptit2  = 51430;
  Tpe_ptit3  = 51431;
  Tpe_ptit4  = 51432;
  Tpe_ptit20 = 51433;
  Tpe_ptit21 = 51434;
  Tpe_pcpec  = 51440;
  Tpe_pcshr2 = 51450;
  Tpe_privx2 = 51460;
  Tpe_prot9  = 51470;
  {P}
  {Q}{R}
  Tpe_shiel1 = 51600;
  Tpe_shiel2 = 51601;
  Tpe_shrnk2 = 51610;
  Tpe_shrnk3 = 51611;
  Tpe_shrnk4 = 51612;
  Tpe_stone  = 51620;
  {S}
  {T}
  Tpe_upx    = 51800;
  {U}
  Tpe_vgcry75= 51900;
  {V}
  Tpe_wwp11  = 52000;
  {W}
  {*****************}

  T_compiler = 64000;
  T_archiver = 65000;

  {*****************}


{****************************************************************************
 ****************************** HELP_STRING *********************************
 ****************************************************************************}

procedure FILL_STR(var hs:str80; addstr:str08);
var h0:byte absolute hs;
begin
  if (h0>28) then h0:=28;
  while (h0<30) do
  begin
    inc(h0);
    hs[h0]:=#32;
  end;
  Insert(addstr,hs,h0);
end;

procedure GET_NAME(var hs:str80; addpos:longint; hlen:byte; addstr:str25);
begin
  move(mem[cbuf:pos_s+addpos],hs[1],hlen);
  hs[0]:=char(hlen);
  Insert(addstr,hs,hlen);
end;

procedure CUT_NAME(var hs:str80; anfi:byte; hlen:byte; hc:char; addi:shortint);
var i:byte;
begin
  i:=anfi; if (i>hlen) then i:=hlen;
  while (hs[i]<>hc)and(i<hlen) do inc(i);
  hs[0]:=char(i+addi);
end;

{****************************************************************************
 ******************************* BIN_Check **********************************
 ****************************************************************************}

function CHK4_BIN:boolean;
var i    :byte;
    hc   :char;
    tmpw :word;
begin
  s[0]:=#0; flag_typ:=0;
  i:=1;
  repeat
    case i of
      01:begin
           if IS_BUF(1,#$80#$10#0) then       flag_typ:=65000
           else {ACB}
           if IS_BUF(7,'**ACE**') then        flag_typ:=65001
           else {ACE}
           if IS_BUF(0,#$21#$11#0#0#0#0) or
              IS_BUF(0,#$21#$12#0#0#0#0) then flag_typ:=65002
           else {AIN}
           if IS_BUF(0,#$AD#$36#$22) then     flag_typ:=65003
           else {AMGC}
           if IS_BUF(0,#$1A#08) then          flag_typ:=65004
           else {ARC}
           if IS_BUF(0,#$0A#01#09#$4F) then   flag_typ:=65005
           else {ARH}
           if IS_BUF(0,#$60#$EA) then         flag_typ:=65006
           else {ARJ}
           if IS_BUF(0,',AR7') then           flag_typ:=65007
           else {AR7}
           if IS_BUF(0,#$41#$53#$44) then     flag_typ:=65008
           else {ASD}

           if IS_BUF(0,'BOA'#0':') then       flag_typ:=65020
           else {BOA}
           if IS_BUF(01,'BSG') then           flag_typ:=65021
           else {BSA}

           if IS_BUF(0,'MSCF') then           flag_typ:=65040
           else {CAB}
           if IS_BUF(0,'SZDD') then           flag_typ:=65041
           else {COMPRESS 5.0}
           if IS_BUF(0,'KWAJ') then           flag_typ:=65042
           else {COMPRESS 6.22}

           if IS_BUF(0,'ESP>') then           flag_typ:=65070
           else {ESP}

           if IS_BUF(0,#$48#$41) then         flag_typ:=65100
           else {HA}
           if IS_BUF(0,#$91#$33#$48#$46) then flag_typ:=65101
           else {HAP}
           if IS_BUF(0,#$48#$50#$41#$4B) then flag_typ:=65102
           else {HAPack}
           if IS_BUF(0,#$55#$42#$25) then     flag_typ:=65103
           else {HIT}
           if IS_BUF(0,#$1A#$48#$50#$26) then flag_typ:=65104
           else {HYP}

           if IS_BUF(0,#$13#$5D#$65#$8C) then flag_typ:=65120
           else {Inst.Shield}

           if IS_BUF(0,#$0#$20#$20#$20#$20#$20#$20#$20#$20#$20#$20#$20#$0#$0#$40)
                                         then flag_typ:=65140
           else {LBR}
           if IS_BUF(02,'-lh') then           flag_typ:=65141
           else {LHA}
           if IS_BUF(0,'LM'#$1A#$08) then     flag_typ:=65142
           else {LIM}
           if IS_BUF(02,'-lz') then           flag_typ:=65143
           else {LZH}
           if IS_BUF(0,#$89#$4C#$5A#$4F) then flag_typ:=65144
           else {LZOP}

           if IS_BUF(0,#$4D#$44#$6D#$64) then flag_typ:=65160
           else {MDCD}

           if IS_BUF(0,'OWS') then            flag_typ:=65200
           else {oWS}

           if IS_BUF(0,'DSIGDCC') then        flag_typ:=65220
           else {CrossePAC}

           if IS_BUF(0,'DS'#0'a') then        flag_typ:=65240
           else {QUANTUM}
           if IS_BUF(0,#$37#$04#$10#0) then   flag_typ:=65241
           else {QUARK}

           if IS_BUF(0,'Rar!') then           flag_typ:=65260
           else {RAR}
           if IS_BUF(0,#$2A#$80#$0F) then     flag_typ:=65261
           else {RKIVE}

           if IS_BUF(0,#$4E#$F5#$46#$E9) then flag_typ:=65280
           else {ShrinkIt}
           if IS_BUF(0,'BC'#$40) then         flag_typ:=65281
           else {SKY}
           if IS_BUF(0,'HLSQZ') then          flag_typ:=65282
           else {SQZ}
           if IS_BUF(02,'-sw1-') then         flag_typ:=65283
           else {SWG}

           if IS_BUF(0,#$1F#$8B#$08) then     flag_typ:=65300
           else {TGZ}

           if IS_BUF(0,'UC2'#$1A) then        flag_typ:=65320
           else {UC2}
           if IS_BUF(0,'UFA') then            flag_typ:=65321
           else {UFA}

           if IS_BUF(0,'WIC') then            flag_typ:=65340
           else {wIC}

           if IS_BUF(0,#$58#$31) then         flag_typ:=65360
           else {X1}
           if IS_BUF(0,'MS'#$0E#01) then      flag_typ:=65361
           else {MSXIE}

           if IS_BUF(13,#01'YC'#0) then       flag_typ:=65380
           else {YAC}

           if IS_BUF(0,'OZ'#$DD) then         flag_typ:=65400
           else {ZET}
           if IS_BUF(0,'PK'#03#04) then       flag_typ:=65401
           else {ZIP}
           if IS_BUF(0,'ZOO') then            flag_typ:=65402
         end;   {ZOO}
      02:begin
           if IS_BUF(0,#$0A#5#1) and
              IS_BUF(08,#$7F#2#$DF#1) then     s:='P:PCX'
           else
           if IS_BUF(0,'BM') and
              IS_BUF(06,#0#0#0) then           s:='P:BMP'
           else
           if IS_BUF(2,'Edsun CEG') then       s:='P:CEG'
           else
           if IS_BUF(0,'FORM') and
              IS_BUF(12,'BMHD') then           s:='P:LBM'
           else
           if IS_BUF(0,'GIF') then
           begin
             if IS_FOUND(0,$500,#$0B'NETSCAPE')
               then                            s:='P:GIF animated'
             else                              s:='P:GIF'
           end
           else
           if IS_BUF(0,'II*'#0) then           s:='P:TIF'
           else
           if IS_BUF(0,#$D7#$CD#$C6#$9A) then  s:='P:WMF'
           else
           if IS_BUF(0,#$FF#$D8#$FF) and
              IS_BUF(06,'JFIF') then           s:='P:JPEG'

           else
           if IS_BUF(0,#0#0#1#$B3) then        s:='V:MPEG'
           else
           if IS_BUF(0,#07#$AA#0#0) then       s:='V:MUX'
           else
           if IS_BUF(0,'Interplay MVE') then   s:='V:MVE'
           else
           if IS_BUF(0,'RIFF') and
              IS_BUF(08,'AVI') then            s:='V:AVI'
           else
           if IS_BUF(0,'SMK2') then            s:='V:SMK'
           else
           if IS_BUF(0,'kVGT') then            s:='V:TGV'
           else
           if IS_BUF(4,#$AF#$12) then          s:='Anim: FLC'
           else
           if IS_BUF(4,#$AF#$11) then          s:='Anim: FLIc'
           else
          {if IS_BUF(0,#$FF#$FD) then          s:='S:MP2 single'
           else
           if IS_BUF(0,#$FF#$F2) then          s:='S:MP3 single'
           else
           if IS_BUF(0,#$FF#$F3) then          s:='S:MP3 stereo'
           else}
           if IS_BUF(0,'Creative Voice') then  s:='S:Voc'
           else
           if IS_BUF(0,'CTMF') then            s:='S:Cmf'
           else
           if IS_BUF(0,'FORM'#0#0#0) then      s:='S:Xmi'
           else
           if IS_BUF(0,'FORM') and
              IS_BUF(08,'AIFF') then           s:='S:Aif'
           else
           if IS_BUF(0,'MThd') then            s:='S:Midi'
           else
           if IS_BUF(0,'RIFF') and
              IS_BUF(08,'WAVEfmt') then        s:='S:Wav'
         end;
      03:begin
           if IS_BUF(0,'if') and
              IS_POS($F0,#$FF#4#4#4) then      s:='m:669 (669 Mod Composer)'
           else
           if IS_BUF(0,'AMShdr'#$1A) then      s:='m:AMS (X-Tracker by Extreme)'
           else
           if IS_BUF(0,'DDMF') then            s:='m:DMF (X-Tracker by D-Lusion)'
           else
           if IS_BUF(0,'DMDL') then            s:='m:MDL (DigiTracker)'
           else
           if IS_BUF(0,'Extended Module:') then s:='m:XM'
           else
           if IS_BUF(0,'FAR'#$FE) then         s:='m:FAR (Fandarole Composer)'
           else
           if IS_BUF(0,'GDM') then            s:='m:GDM'
           else
           if IS_BUF(0,'IMPM') then            s:='m:IT (ImpulseTracker)'
           else
           if IS_BUF(0,'MAS_UTrack_V') then    s:='m:ULT (UltraTracker)'
           else
           if IS_BUF(0,'MTM'#$10) then         s:='m:MTM (MultiTrackerModule)'
           else
           if IS_BUF(0,'MTRAC') then           s:='m:MTS (MasterTracker)'
           else
           if IS_BUF($14,#$1A#$10'MUWFB') then s:='m:UWF (UltraTracker)'
           else
           if IS_BUF($14,'!Scream!') then      s:='m:STM (ScreamTracker)'
           else
           if IS_BUF($2B,#0'SCRM') then        s:='m:S3M (ScreamTracker3)'
           else
           if IS_BUF($2C,'PTMF') then          s:='m:PTM (PolyTracker)'
           else

           if IS_BUF(0,'PS16') then            s:='M:ProTracker Studio16'
           else
           if IS_POS(1080,'M.K.') then         s:='M:ProTracker [M.K.]'
           else
           if FOUND(1,'CHN') then              s:='M:FastTracker ['+chr(mem[cbuf:0])+'CHN]'
           else
           if FOUND(0,'FLT') then              s:='M:StarTrekker [FLT'+chr(mem[cbuf:3])+']'
           else
           if IS_POS($1D3,#0#0) and
              FOUND(04,'x') then               s:='M:Tracker [15 Instruments]';
         end;
      04:begin
           if IS_BUF(0,'AIL3') then
           begin
             if IS_BUF(4,'DIG') then s:='Dig: Driver by Miles Design'
             else
             if IS_BUF(4,'MDI') then s:='Mdi: Driver by Miles Design';
           end
           else
           if IS_BUF(0,'TPU') then
           begin
             if (ebuf[3]=$36)then s:='TP: Unit v6.0'
             else
             if (ebuf[3]=$51)then s:='TP: Unit v7.0';
           end
           else
           if IS_FOUND(2,40,#8'BGI Device') then
           begin
             GET_NAME(s,5,30,'');
             CUT_NAME(s,1,30,'.',2);
             s:='TP: '+s;
           end
           else
           if IS_FOUND(2,40,#8'BGI Stroked') then s:='TP: BGI-CHRFont';
         end;
      05:begin
           if IS_BUF(0,#0#1#0#0#0) then         s:='W:Font-TrueType'
           else
           if IS_BUF(0,#0#0#2#0#6#4#6#0#8) then s:='W:Lotus-123 file'
           else
           if IS_BUF(0,#$DB#$A5#$2D#0) then     s:='W:WinWord v2.0 file'
           else
           if IS_BUF(0,#$D0#$CF#$11#$E0#$A1#$B1#$1A#$E1) and
              IS_FOUND(0,fsize,'R'#0'o'#0'o'#0't'#0' '#0'E'#0'n'#0't') then
           begin
             tmpw:=pos_s;
             if IS_FOUND(tmpw,fsize,'Microsoft ') then
             begin
               GET_NAME(s,0,35,'');
               CUT_NAME(s,1,30,#0,-1);
             end
             else
             if IS_FOUND(tmpw,fsize,'P'#0'P'#0'4'#0'0'#0) then
                  s:='PowerPoint v4.0 file'
             else s:='MS-Office file';
             s:='W:'+s;
           end
           else
           if (IS_BUF(0,'PMCC')) then           s:='W:".grp" file'
           else
           if (IS_BUF(0,#$3F#$5F#03#00)) and (IS_BUF(08,#$FF#$FF#$FF#$FF)) then
                                                s:='W:Help file'
           else
           if (IS_BUF(0,#$4C#0#0#0#01#$14#02#0)) then
           begin
             if IS_FOUND(0,fsize,#0#$1C#0#0#0#1#0#0#0#$1C#0#0#0) and
                IS_FOUND(pos_s+32,fsize,':\') then
             begin
               GET_NAME(s,-1,35,'');
               CUT_NAME(s,1,33,#0,-1);
               s:='Lnk: '+s;
             end
             else s:='W:".lnk" file'
           end
           else
           if IS_BUF(0,'REGEDIT4'#$0D#$0A) then
           begin
             if IS_FOUND(0,fsize,'[HKEY_') then
             s:='Win98: ".reg" file ';
           end
           else
           if IS_FOUND(0,$100,'<HTML>') then
           begin
             if IS_FOUND(pos_s,fsize,'</HTML>') then
             s:='W:HTML file';
           end
           else
           if IS_FOUND(0,$100,'<html>') then
           begin
             if IS_FOUND(pos_s,fsize,'</html>') then
             s:='W:HTML file';
           end;
         end;
    end;
    inc(i);
  until (i>10) or (flag_typ<>0) or (s[0]<>#0);

  case flag_typ of
    65000:s:='A:ACB v2.00';
    65001:s:='A:ACE';
    65002:s:='A:Ain';
    65003:s:='A:Amgc';
    65004:s:='A:ARC';
    65005:s:='A:Squash v1.21 (ARH)';
    65006:s:='A:ARJ';
    65007:s:='A:Ar7 (e-mail crypt)';
    65008:s:='A:Asd';

    65020:s:='A:Boa';
    65021:s:='A:Bsa';

    65040:s:='A:MicroSoft CAB';
    65041:s:='A:Ms Compress v5.0';
    65042:s:='A:Ms Compress v6.22';

    65060:{D};
    65070:s:='A:Esp';
    65080:{F,G};

    65100:s:='A:Ha';
    65101:s:='A:Hap';
    65102:s:='A:HPack';
    65103:s:='A:Hit';
    65104:s:='A:Hyp';

    65120:s:='A:Install Shield'{I,J,K};

    65140:s:='A:Lu (LBR)';
    65141:s:='A:LHA';
    65142:s:='A:Limit (LIM)';
    65143:s:='A:LZH';
    65144:s:='A:Lzop';

    65160:s:='A:Mdcd';

    65180:{N};

    65200:s:='Fake: oWS  *WaRnnG*';

    65220:s:='A:CrossePac (PAC)';

    65240:s:='A:Quantum (Q)';
    65241:s:='A:Quark';

    65260:s:='A:RAR';
    65261:s:='A:Rkive (RKV)';

    65280:s:='A:ShrinkIt';
    65281:s:='A:Sky';
    65282:s:='A:Sqz';
    65283:s:='A:Swg';

    65300:s:='A:Tgz';

    65320:s:='A:Uc2';
    65321:s:='A:Ufa';

    65340:s:='Fake: wIC  *WaRnnG*'{V,W};

    65360:s:='A:X1';
    65361:s:='A:MercurySoft XIE';

    65380:s:='A:Yac';

    65400:s:='A:Zet';
    65401:s:='A:ZIP';
    65402:s:='A:Zoo';
  end; {case end}

  if (s[2]=':') then
  begin
    hc:=s[1];
    Delete(s,1,2);
  end
  else hc:='#';
  case hc of
    'A':s:='Arc: '  +s;
    'M':s:='Mod: '  +s;
    'm':s:='Modul: '+s;
    'P':s:='Pic: '  +s;
    'S':s:='Sound: '+s;
    'V':s:='Video: '+s;
    'W':s:='Win: '  +s;
  end; {case end}

  if (s[0]<>#0) then CHK4_BIN:=true
  else               CHK4_BIN:=false;
end;

{****************************************************************************
 ******************************* COM_CHECK **********************************
 ****************************************************************************}

function IS_CSCRYPT(hchr:char):boolean;   { not my own idea, only adapted for include M.H.}
var thi  :byte;
    i,j  :integer;
    tmpw :word;
    flag :boolean;
    h    :array[-3..2] of byte;
begin
  case hchr of
    'E':flag:=IS_JUMP(xrec.entry,3,#0);
'P','C':flag:=IS_JUMP(0         ,3,#0);   { pos_s:= E9 -> Ofs }
  end; {case end}
  Seek(f,pos_s); BlockRead(f,mem[cbuf:0],800,ergo);
 {hs:=#32+HEX(pos_s,4,'h');}

  i:=3; flag:=false;
  repeat
    h[-3]:=mem[cbuf:i-3];
    h[-2]:=mem[cbuf:i-2];
    h[-1]:=mem[cbuf:i-1];
    h[ 0]:=mem[cbuf:i  ];
    h[ 1]:=mem[cbuf:i+1];
    h[ 2]:=mem[cbuf:i+2];

    if (h[-1] in [$E8,$E9]) then            { is JMP near / CALL near? }
    begin
      case hchr of
      'E':begin
            j:= -(i+2 +$3c4 - $1a);         { Normal protected files }
            if (h[0]=LO(j))and(h[1]=HI(j)) then flag:=true;
            if not flag then
            begin
              j:= -(i+2 +$5ea - $1a);       { Password protected files }
              if (h[0]=LO(j))and(h[1]=HI(j)) then flag:=true;
            end;
          end;
      'C':begin
            j:= -(i+2 +$327);               { Normal protected files }
            if (h[0]=LO(j))and(h[1]=HI(j)) then flag:=true;
          end;
      'P':begin
            j:= -(i+2 +$54B);               { Password protected files }
            if (h[0]=LO(j))and(h[1]=HI(j)) then flag:=true;
          end;
      end; {case end}
    end;

    if not flag then
    begin
      case hchr of
        'E':tmpw:=$1A;                  { EXE - both variants equal }
        'C':tmpw:=pos_s+$100 - $327;    { COM - without password }
        'P':tmpw:=pos_s+$100 - $54B;    { COM - with password }
      end; {case end}
      thi:=hi(tmpw);
      if (h[0]=lo(tmpw)) then
      begin
        { Is  LEA reg16, [value] ? -- 8D | ?? | lo(value) | hi(value) }
        if (h[1]=thi)and(h[-2]=$8d)  then flag:=true
        else
        { Is MOV reg8/16, lo(value)/value ?  }
        if (h[-1]>=$b0)and(h[-1]<=$bf) then
        begin
        { Is MOV reg16, value ? }
          if (h[1]=thi)and(h[-1]>=$B8) then flag:=true
          else
          begin
            { MOV reg8, lo(value)
              MOV reg8, hi(value) }
            if (h[2] =thi)and(h[1] =h[-1]+4) then flag:=true;
            { MOV reg8, hi(value)
              MOV reg8, lo(value) }
            if (h[-2]=thi)and(h[-3]=h[-1]+4) then flag:=true;
          end;
        end;
      end;
    end;

    inc(i);
  until (i>797) or flag;
  IS_CSCRYPT:=flag;
end;

procedure IS_PROTX31(hchr:char);
var
  i:longint;
begin
  if ((ebuf[0]=$E8)or(ebuf[0]=$E9)or(ebuf[0]=$EB)) then
  begin
    if (hchr='C') then i:=0
    else               i:=xrec.entry;
    if IS_JUMP(i,10,#$BB) then;
    if (mem[cbuf:0]>$AF)and(mem[cbuf:0]<$C0)and(mem[cbuf:2]=0) and
       ((mem[cbuf:1]=$06) or (mem[cbuf:1]=$0E)) then
    begin
      s:=HEX(mem[cbuf:0],2,#32)+HEX(mem[cbuf:1],2,#32)+HEX(mem[cbuf:2],2,'h');
      s:='ProtExe v3.1x ('+s+')';
      if (hchr='C') then flag_typ:=Tc_protx31
      else
      begin
        flag_typ:=T_protx31;
        if (xrec.osize>0) and IS_FOUND(0,$40,'CryEXE') then
        begin
          s:='CryExe v4.0';
          flag_typ:=T_cryexe4;
        end;
      end;
    end;
  end;
end;

procedure IS_APACK9x(hchr:char);
var i,j:longint;
begin
  if (hchr='C') then
  begin
    i:=$15;
    j:=$100;
  end
  else
  begin
    i:=fsize-xrec.osize-$100;
    j:=fsize-xrec.osize-$15;
  end;

  if IS_FOUND(i,j,'XSA') then s:='90b/0.91b'
  else
  if IS_FOUND(i,j,'AAXS') then s:='94b'
  else
  if IS_FOUND(i,j,'AAX') then s:='96b'
  else
  if IS_FOUND(i,j,'AAX') then s:='98b'
  else
  if (hchr='E') and IS_FOUND(fsize-xrec.osize-$070,j,'AAV'#$8B) then
  begin
    s:='XE v1.39 - 1.41';
    flag_typ:=T_xe1;
  end
end;

procedure IS_UPX0x(hchr:char);
var i,j:longint;
    k  :byte;
begin
  if (hchr='C') then
  begin
    i:=$15;
    j:=$30;
  end
  else
  begin
    i:=$1C;
    j:=$100;
  end;

  k:=0;
  if IS_FOUND(i,j,'UPX!') then
  case mem[cbuf:pos_s+4] of
    1:begin
        s:='05'; k:=1;
      end;
    3:begin
        s:='20'; k:=2;
      end;
    4:begin
        s:='30'; k:=3;
      end;
    5:begin
        if ((hchr='E') and IS_FOUND(fsize-120,fsize,#$8C#$DB#$80#$C7#$0C#$8E#$DB)) or
           ((hchr='C') and FOUND(pos_s-3,#$E9#$51)) then
        begin
          s:='40'; k:=4;
        end
        else
        begin
          s:='50/0.51'; k:=5;
        end;
      end;
    7:begin
        s:='60 - 0.62'; k:=6;
      end;
    8:begin
        s:='70'; k:=7;
      end;
    9:begin
        s:='71/0.72'; k:=8;
      end;
   10:begin
        if (hchr='E') then
        begin
          if IS_FOUND(fsize-$100,fsize,#$00#$73#$FB#$41#$41#$81#$FD#$D1) then;
          if FOUND(pos_s+12,#$8C#$C0#$29) then
          begin
            s:='76.1'; k:=9;
          end
          else
          if FOUND(pos_s+12,#$29#$E8#$8E) then
          begin
            s:='81/0.82'; k:=10;
          end
          else
          begin
            s:='8?'; k:=10;
          end
        end;
      end;
  else
  begin
    if (hchr='E') then s:='20 - 0.82 generic '+DEZ(mem[cbuf:4],1,'0');
  end;
  end; {case end}
  if (hchr='C') then flag_typ:=Tc_upx
  else               flag_typ:=T_upx;
  inc(flag_typ,k);
end;



{----------------------------------------------------------------------------}

function CHK4_EXT:boolean;
begin
  s[0]:=#0; flag_typ:=0;

  if (xrec.reloc=0)and(xrec._SP=256) and IS_POS(xrec.twin,'PMW') then
  begin
    s:='PmwLite v'+HEX(mem[cbuf:04],1,'.')+DEZ(mem[cbuf:05],2,'0')+' (PMODE)';
    flag_typ:=T16_pmwl;
  end

  else
  if (ebuf[0]=$EB) and IS_FOUND(0,xrec.entry,'DOSX16') then
  begin
    s:='DosExt: DosX16';
  end

  else
  if (xrec._IP=84)and(xrec._CS=0)and(xrec._SS=0)and(xrec.osize>0) and
     IS_BUF(0,#$0E#$1F#$8C#$1E#$24#$00) then
  begin
    flag_typ:=T16_djp;
    if IS_FOUND(fsize-xrec.osize,fsize-xrec.osize+$100,'$Id: UPX') then
    begin
      GET_NAME(s,9,5,' (CWSDPMI)');
      s:='UPX v'+s;
      flag_typ:=T16_upx;
    end
    else
    if IS_FOUND(fsize-xrec.osize,fsize-xrec.osize+$100,'$Id: djp') then
    begin
      GET_NAME(s,9,5,' (CWSDPMI)');
      s:='DJP v'+s;
      flag_typ:=T16_djp;
    end
    else s:='DosExt: CWSDPMI by DJ Delorie';
  end

  else
  if (xrec.relo1=28)and(ebuf[0]=$0E)and(xrec.osize>0) and {(xrec.reloc=02)}
     IS_BUF(10,#$CD#$21#$73#$C1#$58#$CD#$21) then
  begin
    s:='DosExt: DPMI by D.Huffman';
  end

  else
  if (xrec.relo1=30)and(ebuf[0]=$BF)and(ebuf[1]=$00)and(ebuf[3]=$8E) then
  begin {(xrec.reloc=78)}
    if IS_FOUND(xrec.entry,fsize,#0'DOS4GPATH'#0'PATH'#0) and
       IS_FOUND(xrec.entry+pos_s,xrec.entry+pos_s+$600,#$FC#$B8#$57#$41#$54#$43#$4F#$4D) then
    begin
      s:='32LiTE v0.02d (DOS4GW)';
      flag_typ:=T16_4g_32l;
    end
    else
    begin
      if (ebuf[4]=$D7) then s:='4GW'
      else
      if (ebuf[4]=$C7) then s:='16M.386'
      else                  s:='16M ??';
      s:='DosExt: DOS/'+s+' by Tenberry Soft';
    end;
  end

  else
  if (xrec.relo1=32)and(xrec.reloc=0)and(xrec.osize>0) and
     IS_FOUND(0,fsize,'CauseWay DOS') then
  begin
    if (mem[cbuf:pos_s+22]=ord('v')) then GET_NAME(s,23,4,'') {move(mem[cbuf:pos_s+21],s[1],6); s[0]:=#6;}
    else                                  s:=' ?.??';
    s:='CauseWay v'+s+' by M.Devore (packed)';
    flag_typ:=T16_causew;
  end

  else
  if (xrec.relo1=62)and(ebuf[0]=$0E)and(xrec.osize>0) and
     IS_POS(fsize-xrec.osize,'Adam') then
  begin
    s:='DosExt: Dos32 v'+HEX(mem[cbuf:5],1,'.')+HEX(mem[cbuf:4],2,#32)+' by A.Seychell';
    flag_typ:=T16_dos32;
  end;

  if (s[0]<>#0) then
  begin
    if (flag_typ=0) then flag_typ:=T__dos16;
    CHK4_EXT:=true;
  end
  else CHK4_EXT:=false;
end;

{----------------------------------------------------------------------------}

function CHK4_CMP(hchr:char):boolean;
var tmpl:longint;
begin
  s[0]:=#0; flag_typ:=0;

  if (hchr='C') then
  begin
    if (ebuf[0]=$8C) and IS_BUF(02,#$2E#$89#$16) and
       IS_BUF(07,#$B4#$30#$CD#$21) then
       s:='C/C++'
    else
    if (ebuf[0]=$E9) and IS_JUMP(0,0,#$90#$90#$CD#$AB#$43#$6F#$70#$79) then
       s:='TPascal v3.0'
    else
    if IS_BUF(02,#$CA#$2E#$89#$16) and
       IS_BUF(07,#$03#$B4#$30#$CD#$21) then
       s:='Borland C++'
    else
    if IS_BUF($1C,#$01#$8A#$00#$01#$15#$65) then
       s:='TopSpeed C v3.0'
    else
    if (fsize<=Tmem) then
    begin
      if IS_BUF(0,#$FF#$FF#$FF#$FF)and(HLB(ebuf[4],'h')=0) then
      begin
        move(ebuf[10],s[1],8); s[0]:=#8;
        s:='sYsDriver "'+s+'"';
      end
      else
      if (ebuf[0] in [$E8,$E9,$EB,$B0..$BF]) or
         (ebuf[1] in [$E8,$E9,$EB,$B0..$BF]) or
         IS_BUF(0,#$33#$C0) or IS_BUF(0,#$06#$1E) then
         s:='-cOm file';
    end;
    if (s[0]<>#0)and(s[1]<>'-') then s:=s+' (cOm)';
  end

  else
  begin
    if IS_BUF(0,#$2E#$8C#$1E) and IS_BUF(05,#$2E#$C7#$06) then
    begin
      if (ebuf[3]=$B2)and(ebuf[8]=ebuf[3]-4) then   s:='TurboBasic [1987]'
      else
      begin
        s:='?.??';
        if (ebuf[3]=$3E)and(ebuf[8]=ebuf[3]-2) then s:='2.10'
        else
        if (ebuf[3]=$80)and(ebuf[8]=ebuf[3]-2) then s:='3.2';
        s:='PowerBasic v'+s;
      end;
    end
    else
    if (ebuf[0]=$8C)and(xrec._IP=256) then
    begin
      if IS_BUF(01,#$CA#$2E#$89) and (xrec._CS=xrec._SS) then
         s:='Tasm (library C++)'
      else
      if IS_BUF(01,#$D8#$8E#$C0#$B8) then
         s:='C++ by John Bridges';
    end
    else
    if (ebuf[0]=$9A)  then
    begin
      tmpl:=longint(xrec.phead)*16 +longint(ebuf[4] SHL 8 +ebuf[3])*16 +(ebuf[2] SHL 8 +ebuf[1]);
      Seek(f,tmpl); BlockRead(f,mem[cbuf:0],$250,ergo);
      if FOUND(0,#$1E#$06#$9A) and FOUND(07,#$2E#$8C#$06) and
         FOUND(12,#$8C#$C8#$8E#$D8) then
      begin
        s:='RTLink by VM Manager ('+HEX(tmpl,8,'h')+')';
      end
      else
      if FOUND(0,#$F8#$60#$F9#$72#$1F#$8B#$DC#$36#$C5#$1F) then
      begin
        s:='TPascal & Library from N.Juffa';
      end
      else
      if FOUND(0,#$BA) and FOUND(3,#$8E#$DA#$8C#$06) then
      begin
        if FOUND(09,#$33#$ED#$8B#$C4#$05#$13#$00#$B1#$04#$D3#$E8#$8C#$D2#$03#$C2#$A3) then
        begin
          if FOUND(43,#$26#$A1#$02#$00#$2D#$00#$10#$A3) then
          s:='v5.0'
          else
          if FOUND(46,#$26#$8B#$16#$02#$00#$89#$16) then
          s:='v6.0'
          else
          s:='v5.x '+HEX(tmpl,8,'h');
        end
        else
        if FOUND(09,#$8B#$C4#$05#$13#$00#$B1#$04#$D3#$E8#$8C#$D2#$03#$C2#$A3) then
        s:='v4.0'
        else
        if FOUND(17,#$8B#$C4#$05#$13#$00#$B1#$04#$D3#$E8#$8C#$D2#$03#$C2#$A3) then
        begin
          s:='v7.0';
          if (not FOUND($49,#$BF#$0E#$05#$BE#$39#$02#$B9#$13#$00)) and
             (not FOUND($67,#$BA#$0C#$01#$B8#$00#$25#$CD#$21)) then
          begin
            s:=s+' AntiUPC v1.00 (Boogie)';
            flag_typ:=T_antiupc0;
          end
          else
          if (not FOUND($56 ,#$B4#$35#$CD#$21)) and
             (not FOUND($1AF,#$CD#$21)) then
          begin
            s:=s+' ProtUPC v1.0g7 (DaRKMaN)';
            flag_typ:=T_protupc;
          end
          else
          if (not FOUND($234,#$B4#$06#$CD#$21#$C3#$00#$02#$1B#$21)) then
          begin
            s:=s+' AntiUPC (Lukundoo/HPA)';
            flag_typ:=T_antiupcl;
          end
        end
        else
        begin
          s:='unknow '+HEX(tmpl,8,'h');
        end;
        s:='TPascal '+s;
      end
      else
      begin
        if (mem[cbuf:0]+$20=mem[cbuf:4]) and FOUND(5,#$8C#$06) then
        begin
          s:='Pascal Patcher (ByteWorx)';
          flag_typ:=T_paspatch;
        end
        else s:='call 9A';
        s:=s+#32+HEX(tmpl,8,'h');
      end;
    end
    else
    if (ebuf[0]=$B4)  then
    begin
      if IS_BUF(07,#$05#$33#$C0) then s:='MsC'
      else
      if IS_BUF(07,#$02#$CD#$20) then s:='MsQC';
    end
    else
    if IS_BUF(0,#$FB#$BA) and IS_BUF(04,#$2E#$89#$16#$A3#$01#$B4#$30#$CD#$21) and
       IS_BUF(38,#$C7#$06) and IS_BUF(42,#$FF#$FF) then
    begin
      s:='Turbo-C v1.0 [1987]'
    end
    else
    if (ebuf[0]=$BA) and IS_BUF(03,#$2E#$89#$16) and IS_BUF(08,#$B4#$30) then
    begin
      s:='C/C++';
      if IS_BUF(37,#$C7#$06) and IS_BUF(41,#$FF#$FF)  then
      begin
        if (ebuf[43]=$8E) then s:='v1.x'
        else
        if (ebuf[43]=$E8) then s:='v2.0'
        else                   s:='';
        s:='Turbo-C '+s+' [1988]';
      end
      else
      if (ebuf[37]=$E8)and(ebuf[39]=$01) then
      begin
        s:='BC/C ++';
        if (ebuf[07]=$02)and(ebuf[40]=$A1) and IS_BUF(43,#$8E#$C0#$33#$C0#$8B#$D8#$8B#$F8#$B9) then
        s:='Borland C++ 1991-1994'
        else
        if IS_BUF(40,#$C4#$3E) and IS_BUF(44,#$8B#$C7#$8B#$D8#$B9) then
        s:='Turbo C++ v3.0 [1990]'
      end;
    end
    else
    if (ebuf[0]=$BF) and IS_BUF(03,#$8E#$DF#$FA) then
    begin
      s:='Symantec C';
    end
    else
    if (ebuf[0]=$E9)and(ebuf[3]=$57) and IS_BUF(09,#$20#$43#$2F) then
    begin
      s:='Watcom C/C++';
    end
    else
    if IS_BUF(0,#$FA#$FC#$B8) and (ebuf[5]=$8E) then
    begin
      s:='Zortech C';
    end;
  end;

  if (s[0]<>#0) then
  begin
    if (POS('-cOm',s)<>1)and(flag_typ=0) then flag_typ:=T_compiler;
    CHK4_CMP:=true;
  end
  else CHK4_CMP:=false;
end;

{----------------------------------------------------------------------------}

begin
end.