C/C++ 实现文件自校验代码
#include#include extern long FileSizeof(char *); int main() { if(FileSizeof("\\a.exe")==20499) #指定文件大小 { std::cout<<"没有被破解"<<std::endl; getchar(); }else { std::cout<<"已经被破解"<<std::endl; getchar(); } return 0;
} extern long FileSizeof(char *FileName) { FILE *fop; long temp; fop=fopen(FileName,"r"); fseek(fop,0,SEEK_END); temp=ftell(fop); fclose(fop); return temp; }