快讯

在BMP文件中隐藏信息

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

/* Read Password off of command line */ for (i=0; i< 129; i++) password[i]='\0'; if ((argc==6 && mode==1) || (argc==5 && mode==2)) { isencrypted=TRUE; for (i=0; i< 129; i++) { password[i]=argv[6-mode][i]; if (argv[6-mode][i]=='\0') break; } password[129]='\0'; } /* Open all necessary files */ bitmap_handle=fopen(argv[2],"rb"); if (mode==1) plaintext_handle=fopen(argv[3],"rb"); if (bitmap_handle==NULL) { printf("FATAL: Could not open bitmap %s!\n",argv[2]); exit(2); } if (plaintext_handle==NULL && mode==1) { printf("FATAL: Could not open plaintext %s!\n",argv[3]); exit(3); } /* Read source bitmap (this must be done for every command line variation) */ printf("? Reading bitmap file...."); BMPsource=(BITMAP*)calloc(1,sizeof(BITMAP)); BMPsource- >palette=(HEAP*)calloc(1,sizeof(HEAP)); BMPsource- >raster=(HEAP*)calloc(1,sizeof(HEAP)); initialiseHeap(BMPsource- >palette); initialiseHeap(BMPsource- >raster); if (!readBitmapFile(bitmap_handle,BMPsource)) { printf("ERROR\n\nFATAL: Out of memory, while reading bitmap file\n"); exit(4); } printf("OK\n"); /* Analyse Bitmap */ if (stricmp("BM",BMPsource- >signature) || BMPsource- >bitplanes!=1) { printf("FATAL: Not a valid bitmap file\n"); exit(5); } if (BMPsource- >compression!=0) { printf("FATAL: BlindSide cannot work with compressed bitmaps yet\n"); exit(6); } if (BMPsource- >bpp==1) { printf("FATAL: BlindSide can't work with monochrome images, as it is the colours\nwithin the image itself that are used to hide files within a bitmap.\nYou can only use bitmaps of greater colour depth (16c, 256c, 16Mc)\n"); exit(8); } if (BMPsource- >bpp!=4 && BMPsource- >bpp!=8 && BMPsource- >bpp!=24) { printf("FATAL: Can't work with a bitmap with %d bits per pixel\n\nTry saving the bitmap into a different bit depth in a graphics package.\n",BMPsource- >bpp); exit(8); } printf("? Image is %ld bytes (%ldx%ld), %d bits/pixel\n",BMPsource- >filesize,BMPsource- >x_size,BMPsource- >y_size,BMPsource- >bpp);
键盘也能翻页,试试“← →”键
IT热词搜索 来源:360新闻
相关文章

相关软件:

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