看看这个对你有没帮
/* 看看这个对你有没有帮助: */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int Password(char *InFile,char *OutFile)
{
FILE *fpIn,*fpOut;
unsigned char ch;
fpIn=fopen(InFIle,"rb");
if(!fpIn) return -1;
fpOut=fopen(fname,"wb");
if(!fpOut) return -2;
while(!feof(fpIn)) {
ch=fgetc(fpIn);
fputc(ch^0x7f^0x3c+8-99,fpOut);
}
return 1;
}
int main(void)
{
int status;
status=Password("msdos.sys","msdos.pwd");
}