//**************************************************************************
//*********** Kurze-Langsame aber verständliche Weise des
Programms ********
//**************************************************************************
#include <dos.h>
#include <stdio.h>
void main(int k,char *NAME[]){
FILE *tx1,*tx2,*tx3; //BeSchreibFile
struct find_t blk1,blk2;
float f1,f2;
unsigned long int z1,z2,z3[256];
unsigned char c1,c2;
//***************************************************************************
//******************** M E I N E K L E I N E
H I L F E ******************
//***************************************************************************
if(k==1){printf("\n\t\t\tDav Sun Cracker-TOOL");
printf("\n\t\t\t===================\n");
printf("\n\tkein Name -> Hilfe (Was man jetzt gerade sieht)");
printf("\n\t ein Name -> Quersummen-Bildung dieser Datei
+ Anzahl Zeichen");
printf("\n\tzwei Namen -> Vergleich der beiden Dateien");}
//***************************************************************************
//************************** Q U E R S U M M E ******************************
//***************************************************************************
if(k==2){
if((tx1=fopen(*(++NAME),"rb"))==NULL) return;
//LESE-DATEI Öffnen (2 DATEI)
for(int i=0;i<256;i++) z3[i]=0;z1=0;z2=0;
while(!feof(tx1)){
c1=fgetc(tx1);
if(!feof(tx1)){z2=z2+c1;z1++;z3[c1]++;}}
printf("\n gesamt=%ld Quersumme=%ld",z1,z2);
if((tx3=fopen("vergl.inf","wt"))==NULL) return; //SCHREIB-DATEI
Öffnen (Info-DATEI)
for(i=0;i<256;i++){
if(i>20) fprintf(tx3,"%c ",i);
else fprintf(tx3,"? ",i,z3[i]);
fprintf(tx3,"%.3d - %ld\n",i,z3[i]);}
fprintf(tx3,"\n gesamt=%ld Quersumme=%ld",z1,z2);
fclose(tx3);
fclose(tx1);}
//WiederzuMachen der Datei1
//***************************************************************************
//*********************** D A T E I E N V E R G L E I C H *******************
//***************************************************************************
if(k==3){
_dos_findfirst(*(NAME+1),_A_NORMAL,&blk1);f1=blk1.size;
_dos_findfirst(*(NAME+2),_A_NORMAL,&blk2);f2=blk2.size;
if(blk1.size<blk2.size)f1=blk1.size;else f1=blk2.size;
if((tx1=fopen(*(NAME+1),"rb"))==NULL) return;
//LESE-DATEI Öffnen (1 DATEI)
if((tx2=fopen(*(NAME+2),"rb"))==NULL) return;
//LESE-DATEI Öffnen (2 DATEI)
if((tx3=fopen("vergl.inf","wt"))==NULL) return; //SCHREIB-DATEI
Öffnen (Info-DATEI)
z1=0;
while((!feof(tx1))||(!feof(tx2))){
c1=fgetc(tx1);c2=fgetc(tx2);
if((c1)!=(c2)) fprintf(tx3,"%ld - %.2X %.2X\n",z1,c1,c2);z1++;
}
fprintf(tx3,"\n Untersucht *** Gesamt-Byte= %ld",z1);
fclose(tx1); //WiederzuMachen
der Datei1
fclose(tx2); //WiederzuMachen
der Datei2
fclose(tx3);} //WiederzuMachen
der Datei2
//***************************************************************************
//*********************** P R O G R A M M E N D E ***************************
//***************************************************************************
}