Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is pretty old now, have newer versions somewhere without the fake basic like syntax
- #include "defines.h"
- struct files
- {
- FILE *input;
- };
- MAIN;
- //ARG_CHECK(2);
- UCHAR inbyte[argc];
- ULONG pos=0;
- struct files pointer[argc];
- UINT d=0;
- UINT change=0;
- ULONG fs=0;
- UINT e=0;
- for (d=0; d < argc; d++ )
- {
- inbyte[d]='\0';
- }
- for(d=0; d < argc-1; d++)
- {
- if ( ( pointer[d].input = fopen(argv[d+1],"r") ) == NULL )
- {
- printf("File %s open failed\n",argv[d+1]);
- exit(-1);
- }else{
- printf("File %s opened for r\n",argv[d+1]);
- }
- }
- fseek(pointer[0].input,0L,SEEK_END);
- fs=ftell(pointer[0].input);
- fseek(pointer[0].input,0L,SEEK_SET);
- while ( pos < fs )
- {
- for(d=0; d < argc-1; d++ )
- {
- fread(&inbyte[d],1,1,pointer[d].input);
- //printf("Read %d from file %s\n",inbyte[d],argv[d+1]);
- }
- for(d=0; d < argc-1; d++ )
- {
- for(e=0; e < argc-1; e++)
- {
- if ( inbyte[d] != inbyte[e] )
- {
- change++;
- }
- }
- }
- if ( change >= (argc-1)*2 )// *(argc-1) )
- {
- printf("%d: ", pos );
- for(d=0; d < argc-1; d++ )
- {
- if ( d == argc-2 )
- {
- printf("%d",inbyte[d]);
- }else{
- printf("%d -> ",inbyte[d]);
- }
- }
- printf("\n");
- }
- for (d=0; d < argc-1; d++ )
- {
- inbyte[d]='\0';
- }
- pos++;
- change=0;
- END;
- for(d=0; d < argc-1; d++)
- {
- CLOSE(pointer[d].input);
- }
- RET;
- END;
Advertisement
Add Comment
Please, Sign In to add comment