#include <stdio.h>
#define MAXLEN 8
static const char *fnsrc = "D://MyPro//rwjpg//rwjpg//k.jpg";
static const char *fndest = "D://MyPro//rwjpg//rwjpg//kk.jpg";
static const char *mdrb = "rb";
static const char *mdwb = "wb";
static const char *key = "12345678";
int main(void)
{
int rc;
FILE *fpsrc, *fpdest;
unsigned char buf[MAXLEN];
fopen_s(&fpsrc, fnsrc, mdrb);
fopen_s(&fpdest, fndest, mdwb);
if (fpsrc == NULL)
{
printf("open %s failed!", fnsrc);
return 1;
}
while ((rc = fread(buf, sizeof(unsigned char), MAXLEN, fpsrc)) != 0)
{
int i;
for (i = 0; i < rc; i++) {
buf[i] = buf[i] ^ 'a';
}
fwrite(buf, sizeof(unsigned char), rc, fpdest);
}
fclose(fpsrc);
fclose(fpdest);
return 1;
}
#define MAXLEN 8
static const char *fnsrc = "D://MyPro//rwjpg//rwjpg//k.jpg";
static const char *fndest = "D://MyPro//rwjpg//rwjpg//kk.jpg";
static const char *mdrb = "rb";
static const char *mdwb = "wb";
static const char *key = "12345678";
int main(void)
{
int rc;
FILE *fpsrc, *fpdest;
unsigned char buf[MAXLEN];
fopen_s(&fpsrc, fnsrc, mdrb);
fopen_s(&fpdest, fndest, mdwb);
if (fpsrc == NULL)
{
printf("open %s failed!", fnsrc);
return 1;
}
while ((rc = fread(buf, sizeof(unsigned char), MAXLEN, fpsrc)) != 0)
{
int i;
for (i = 0; i < rc; i++) {
buf[i] = buf[i] ^ 'a';
}
fwrite(buf, sizeof(unsigned char), rc, fpdest);
}
fclose(fpsrc);
fclose(fpdest);
return 1;
}