快讯

在BMP文件中隐藏信息

2004-02-14 09:34  出处:PConline  作者:网上收集  责任编辑:zwg 

/* At this point 'filespace' is always a working BS archive (although it may be one with no files contained) */ /* In case of Mode 3 it MAY NOT be the case that filespace is archive - it may be empty heap */ /* Decrypt if necessary */ if (filespace- >heaplen!=0) { if (*(filespace- >dataspace+1)=='E') { /* decrypt */ if (strcmp(password,"")==0) { /* get pword */ printf("\nData is encrypted, please enter password: "); scanf("%s",password); printf("\n"); } printf("? Decrypting Data...."); cryptoData(filespace,password); if (*(filespace- >dataspace+7)=='O' && *(filespace- >dataspace+8)=='K') { printf("OK\n"); isencrypted=TRUE; } else { printf("ERROR\n\nFATAL: Incorrect password\n"); exit(9); } } } /* Do whichever of the operations was requested */ switch (mode) { case 1: printf("\n"); for (i=strlen(argv[3]); i >0; i--) { if (argv[3][i]==PATH_SEP) break; } if (i!=0 || (argv[3][0]==PATH_SEP)) i++; addFileToArchive(filespace,plaintext_handle,&(argv[3][i])); printf("\n"); break; case 2: printf("\n"); if (argc >=3) extractFile(filespace,argv[3]); else extractFile(filespace,NULL); break; case 3: dumpFileStats(BMPworking, filespace); break; case 4: dumpFileDirectory(filespace); break; } /* Output to disk */ /* If we were in ADD mode, write the bitmap out (Xtract, Calc, and List are READ ONLY) */ if (mode==1) { /* close plaintext */ fclose(plaintext_handle); if (isencrypted==TRUE) { printf("? Encrypting Data...."); cryptoData(filespace,password); printf("OK\n"); } printf("? Encoding Data...."); hotspots=(LOOKUP*)calloc(1,sizeof(LOOKUP)); if (hotspots==NULL) { printf("ERROR\n\nOut of memory\n"); exit(4); } hotspots- >dataspace=(unsigned long int*)calloc(LOOKUP_INITLEN,sizeof(unsigned long int)); if (hotspots==NULL) { printf("ERROR\n\nOut of memory\n"); exit (4); } hotspots- >currentlen=LOOKUP_INITLEN; flattenBitmap(BMPworking,hotspots); encodeData(BMPworking,filespace,hotspots); printf("OK\n"); printf("? Writing result to %s....",argv[4]); outfile_handle=fopen(argv[4],"wb"); writeBitmapFile(outfile_handle, BMPworking); fclose(outfile_handle); printf("OK\n"); } /* Cleaup and exit */ printf("\nDone!\n"); removeHeap(filespace); free(filespace); removeHeap(BMPworking- >palette); free(BMPworking- >palette); removeHeap(BMPworking- >raster); free(BMPworking- >raster); free(BMPworking); return(0); }
键盘也能翻页,试试“← →”键
IT热词搜索 来源:360新闻
软件论坛帖子排行
相关文章

相关软件:

腾讯QQ2012
大小:52.93 MB 授权:免费
腾讯QQ2012
立即下载
腾讯QQ2013
大小:49.32 MB 授权:免费
腾讯QQ2013
立即下载