int getMabBuf(char* fileName, char* mabBuf)
{
char sBlock[256+1];
FILE *pfFileI;
struct stat fbuf;
if(stat(fileName,&fbuf) < 0)
{
return -1;
}
if ((pfFileI = fopen(fileName, "r")) == NULL)
{
return -2;
}
while (!feof(pfFileI))
{
memset(sBlock, 0, sizeof(sBlock));
fread(sBlock, __BLOCKSIZE, 1, pfFileI);
Do_XOR(mabBuf, sBlock, __BLOCKSIZE);
}
fclose(pfFileI);
return 0;
}
void doXOR( char* deststr , char* source , int strlength )
{
int i = 0;
for( i = 0 ; i < strlength ; i++ )
{
deststr[i] ^= source[i];
}
}
#define __BLOCKSIZE 256