亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cpp

?? 基于BMP圖像的信息隱藏
?? CPP
?? 第 1 頁 / 共 4 頁
字號:

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 

/************************************\ 
* B L I N D S I D E * 
* * 
* Image stego/crypto tool, please * 
* see http://www.blindside.co.uk * 
* * 
* Compile with GCC or equiv ANSI C * 
* * 
* John Collomosse (mapjpc@bath.ac.uk)* 
* Freeware/public domain * 
* * 
\************************************/ 

#define HEAP_UNITSIZE (102400) 
#define HEAP_INITUNITS (1) 
#define LOOKUP_INITLEN (2048) 
#define FALSE (0) 
#define TRUE (-1) 
#define PATH_SEP ('\\') /* OS Specific Path Seperator */ 
#define BANNER ("BlindSide BMP Cryptographic Tool - (c) John Collomosse 2000\nRelease v0.9. All Rights Reserved, contact: ma7jpc@bath.ac.uk\n\n") 
#define THIS_PROTO_VER (1) 

/* Heap Structure (memory storage class for uchars) */ 
typedef struct heapstruct { 
unsigned int heapunits; /* Heap size to nearest 'unit' */ 
unsigned char *dataspace; /* Dataspace where data stored */ 
unsigned char *nextchar; /* Pointer to end of dataspace */ 
unsigned long heaplen; /* Length of data in heap */ 
} HEAP; 

typedef struct lookupstruct { 
unsigned long int* dataspace; 
unsigned long int currentlen; 
unsigned long int curitem; 
} LOOKUP; 

/* Bitmap Structure */ 
typedef struct bmpstruct { 
char* signature; //圖像格式標識
long filesize; //圖像文件大小
long x_size; //圖像的寬度(以像素為單位)
long y_size; //圖像的高度(以像素為單位)
int bitplanes; //圖像色彩平面數,固定為1;
int bpp; //圖像的垂直分辨率
long compression; 
long compresssize; 
long x_pix_per_metre; 
long y_pix_per_metre; 
long colours; 
long cols_important; //圖像中重要的色彩數目
HEAP* palette; 
HEAP* raster; 
} BITMAP; 

typedef struct pixstruct { 
unsigned char red; 
unsigned char green; 
unsigned char blue; 
} PIXEL; 

/* Function prototypes */ 
int initialiseHeap (HEAP*); 
int expandHeap (int, HEAP*); 
void removeHeap (HEAP*); 
int putToHeap (unsigned char,HEAP*); 
int streamFileToHeap (FILE*, HEAP*); 
int readBitmapFile (FILE*, BITMAP*); 
void promoteTo24 (BITMAP*, BITMAP*); 
unsigned long resolveMaxEncode (BITMAP*, LOOKUP*); 
void writeBitmapFile (FILE*, BITMAP*); 
unsigned int biggest_of_3 (unsigned int,unsigned int,unsigned int); 
void longToStream (FILE*,unsigned long int); 
unsigned long streamToLong (FILE*); 
void process24gotpixel (unsigned char, unsigned char*,HEAP*); 
unsigned int calcEOLpad (int, long); 
PIXEL getIndexedPixel (unsigned long int, BITMAP*); 
void encodeData (BITMAP*, HEAP*, LOOKUP*); 
void setIndexedPixel (unsigned long int, BITMAP*, PIXEL); 
unsigned char getNextHeapBit (unsigned long int, int, HEAP*); 
int decodeData (BITMAP*, HEAP*); 
//void cryptoData (HEAP* data, unsigned char* key); 
unsigned char xor (unsigned char, unsigned char); 
int rotl4 (int); 
int hash_func (unsigned char*); 
int pow (int,int); 
int stricmp (const char*, const char*); 
int formatDataspace (BITMAP*, HEAP*); 
void dumpFileDirectory (HEAP*); 
void dumpFileStats (BITMAP*, HEAP*); 
void addFileToArchive (HEAP*, FILE*, char*); 
int checkExists (char*); 
int extractFile (HEAP*, char*); 
void flattenBitmap (BITMAP*, LOOKUP*); 

int main (int argc, char** argv) { 
int mode; 
FILE* bitmap_handle=NULL; //指向BMP圖片
FILE* plaintext_handle=NULL; //指向普通的需要隱藏的文本文件
FILE* outfile_handle=NULL; //輸出文件
BITMAP* BMPsource=NULL; //結構體
BITMAP* BMPworking=NULL; //結構體
HEAP* filespace=NULL; 
LOOKUP* hotspots; 
unsigned long int i; 
//int isencrypted=FALSE; 
//char password[130]; 

//printf(BANNER); 

mode=0; 
if (argc >=2) { 
/* deduce mode of operation */ 
if (stricmp(argv[1],"-A")==0) 
mode=1; 
if (stricmp(argv[1],"-X")==0) 
mode=2; 
if (stricmp(argv[1],"-C")==0) 
mode=3; 
if (stricmp(argv[1],"-L")==0) 
mode=4; 
} 

if (mode==0 || (mode==1 && (argc!=5 && argc!=6)) || (mode==2 && (argc!=3 && argc!=4 && argc!=5)) || (mode==3 && argc!=3) || (mode==4 && argc!=3)) { 
printf("USAGE: BSIDE < option > < filenames - see below >\n\n"); 
printf("Option Description\n"); 
printf("~~~~~~ ~~~~~~~~~~~\n"); 
printf(" -A Add a file into image, need to specify files as follows\n"); 
printf(" BSIDE -A < BMP file > < plaintext file > < result BMP file > [password]\n\n"); 
printf(" -X eXtract file(s) from image, need to specify files as follows\n"); 
printf(" BSIDE -X < BMP file > [file to extract] [password if needed]\n\n"); 
printf(" -C Calculate data storage statistics of a bitmap\n"); 
printf(" BSIDE -C < BMP file >\n\n"); 
printf(" -L List files stored within a bitmap\n"); 
printf(" BSIDE -L < BMP file >\n\n"); 
printf("Please note that wildcards are NOT currently supported\n\n"); 
printf("BlindSide is (c) John Collomosse 2000, All Rights Reserved\nComments/suggestions to ma7jpc@bath.ac.uk, updates see www.blindside.co.uk\n"); 
exit(1); 
} 

/* 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); 

/* Colour depth increase if need be */ 
if (BMPsource->bpp< 24) { 
printf("? Increasing Colour Depth to 16M colours (24bpp)..."); 
BMPworking=(BITMAP*)calloc(1,sizeof(BITMAP)); 
if (BMPworking==NULL) { 
printf("\n\nFATAL: Out of memory while increasing colour depth"); 
exit(4); 
} 
BMPworking->palette=(HEAP*)calloc(1,sizeof(HEAP)); 
BMPworking->raster=(HEAP*)calloc(1,sizeof(HEAP)); 
if (BMPworking->palette==NULL || BMPworking->raster==NULL) { 
printf("\n\nFATAL: Out of memory while increasing colour depth"); 
exit(4); 
} 
if (!initialiseHeap(BMPworking->palette) || !initialiseHeap(BMPworking->raster)) { 
printf("\n\nFATAL: Out of memory while increasing colour depth"); 
exit(4); 
} 
/* Do the promote to 24bpp */ 
promoteTo24(BMPsource, BMPworking); 
/* cleanup source */ 
removeHeap(BMPsource->palette); 
removeHeap(BMPsource->raster); 
free(BMPsource); 
BMPsource=NULL; 
printf("OK\n"); 
} 
else { 
/* Source was fine -> already 24 bpp */ 
BMPworking=BMPsource; 
BMPsource=NULL; 
} 

/* Prepare BS dataspace */ 
printf("? Analysing Data Patterns...."); 
filespace=(HEAP*)calloc(1,sizeof(HEAP)); 
initialiseHeap(filespace); 
switch (decodeData(BMPworking,filespace)) { 
case 0: printf("OK\n"); 
break; 
case 1: removeHeap(filespace); 
initialiseHeap(filespace); 
if (mode==2 || mode==4) { 
printf("ERROR\n\nFATAL: File does not contain any BlindSide hidden data\n"); 
exit(4); 
} 
printf("OK\n"); 
if (mode==1) { 
printf("? Creating New Archive...."); 
if (formatDataspace(BMPworking, filespace)) 
printf("OK\n"); 
else { 
printf("ERROR\n\nFATAL: There isn't enough space in the bitmap to hold any Blindside hidden data\n"); 
exit(4); 
} 
} 
break; 
case 2: printf("\nFATAL: Out of memory while analysing bitmap\n"); 
exit(4); 
break; 
case 3: printf("\nFATAL: Bitmap was encoded using a higher version of BlindSide than this one\n"); 
exit(4); 
break; 
} 

/* 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); 
} 

/***************************** HEAP MANAGEMENT ***********************/ 
int initialiseHeap(HEAP* heap) { 
heap->dataspace=NULL; 
heap->heapunits=0; 
heap->nextchar=NULL; 
heap->heaplen=0; 

heap->dataspace=(unsigned char*)calloc(HEAP_INITUNITS,HEAP_UNITSIZE*sizeof(unsigned char)); 
if (heap->dataspace==NULL) 
return FALSE; 
else { 
heap->heapunits=HEAP_INITUNITS; 
heap->nextchar=heap->dataspace; 
return TRUE; 
} 
} 

int expandHeap(int newunits, HEAP* heap) { 
if (newunits> heap->heapunits) { 
unsigned char* tmpheap; 
int i; 

tmpheap=heap->dataspace; 
heap->dataspace=(unsigned char*)calloc(newunits,HEAP_UNITSIZE*sizeof(unsigned char)); 
if (heap->dataspace==NULL) { 
heap->dataspace=tmpheap; 
return FALSE; 
} 
else { 
for (i=0; i< heap->heapunits*HEAP_UNITSIZE; i++) 
heap->dataspace[i]=tmpheap[i]; 
free(tmpheap); 
heap->nextchar=(heap->dataspace)+(heap->heapunits*HEAP_UNITSIZE); 
heap->heapunits=newunits; 
} 
} 
return TRUE; 
} 

void removeHeap(HEAP* heap) { 
if (heap->dataspace!=NULL) { 
free (heap->dataspace); 
heap->heapunits=0; 
heap->dataspace=NULL; 
heap->nextchar=NULL; 
heap->heaplen=0; 
} 
} 

int streamFileToHeap(FILE* infile, HEAP* heap) { 
unsigned char readchar; 

while (fscanf(infile,"%c",&readchar) >0) { 
if (!putToHeap(readchar,heap)) 
return FALSE; 
} 

return TRUE; 
} 

int putToHeap(unsigned char data, HEAP* heap) { 

unsigned long hopeful_pos=heap->heaplen; 
unsigned long current_pos=(heap->heapunits*HEAP_UNITSIZE); 


if (hopeful_pos >= current_pos) { 
int discrep=(int)hopeful_pos/HEAP_UNITSIZE; 
discrep++; 
if (!expandHeap(discrep, heap)) { 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99综合影院在线| 亚洲一区二区精品久久av| 美脚の诱脚舐め脚责91| 91丨porny丨国产| 成人免费在线播放视频| 国产精品亚洲综合一区在线观看| 欧美mv日韩mv| 精品一区二区在线免费观看| 日韩一区二区三区在线观看| 日韩精品视频网| 日韩三级视频在线看| 国内精品视频一区二区三区八戒| 精品久久久三级丝袜| 免费精品视频最新在线| 精品国产一区二区三区四区四 | 欧美日本一区二区在线观看| 一区二区久久久久久| 欧美日韩国产首页| 亚洲欧美国产毛片在线| 欧美影片第一页| 日本成人在线电影网| 久久午夜免费电影| 经典三级视频一区| 欧美高清在线一区二区| 91麻豆.com| 无吗不卡中文字幕| 欧美成人性福生活免费看| 国产成人在线电影| 亚洲精选一二三| 一本色道久久综合精品竹菊| 天天操天天色综合| 久久影视一区二区| 色噜噜狠狠色综合欧洲selulu| 亚洲午夜激情av| 精品国产露脸精彩对白| 不卡一区二区三区四区| 亚洲最新视频在线观看| 欧美第一区第二区| 97se亚洲国产综合自在线不卡| 一区二区三区在线视频免费| 欧美日韩黄色一区二区| 国产乱码字幕精品高清av | 欧美性生活久久| 久久99国产精品麻豆| 亚洲三级在线看| 88在线观看91蜜桃国自产| 成人免费视频一区二区| 亚洲18女电影在线观看| 欧美国产丝袜视频| 5858s免费视频成人| 成人18精品视频| 久久狠狠亚洲综合| 夜夜夜精品看看| 国产色婷婷亚洲99精品小说| 欧美日韩另类国产亚洲欧美一级| 色88888久久久久久影院按摩| 蜜臀精品一区二区三区在线观看| 亚洲欧洲色图综合| 欧美经典一区二区三区| 欧美va亚洲va| 欧美一区二区三区白人| 88在线观看91蜜桃国自产| 欧美老女人在线| 欧美性猛交xxxx黑人交 | 在线视频国内自拍亚洲视频| av成人老司机| 97se亚洲国产综合自在线不卡| 国产99久久久久久免费看农村| 精品在线免费观看| 久久99精品久久久久久久久久久久| 日韩电影一二三区| 美国三级日本三级久久99| 奇米精品一区二区三区在线观看一| 亚洲成人av电影| 五月激情综合色| 免费成人av在线| 激情综合网天天干| 国产精品 欧美精品| 国产很黄免费观看久久| 国产suv精品一区二区6| 成人黄色大片在线观看| 91美女片黄在线观看| 欧美自拍偷拍一区| 欧美精品在线观看一区二区| 日韩午夜电影av| 2021中文字幕一区亚洲| 日本一区二区三区久久久久久久久不| 国产亚洲人成网站| 国产精品久久久久久久久久久免费看 | 91在线观看污| 欧美专区日韩专区| 欧美日韩成人高清| 精品第一国产综合精品aⅴ| 国产人成一区二区三区影院| 亚洲人快播电影网| 日韩电影在线免费观看| 精品一区二区免费| 成人精品视频网站| 欧美自拍偷拍午夜视频| 欧美一级二级三级蜜桃| 久久网站热最新地址| 亚洲欧美区自拍先锋| 婷婷综合另类小说色区| 国产一区二区三区久久悠悠色av| 成人午夜激情在线| 欧美无乱码久久久免费午夜一区 | 久久精品国产久精国产爱| 国产精品一区二区在线播放 | 中文字幕一区二区在线播放| 亚洲一区免费视频| 韩国精品免费视频| 色94色欧美sute亚洲13| 精品日韩一区二区三区| 中文字幕一区视频| 日本欧美在线观看| av电影在线观看不卡| 日韩欧美一区电影| 亚洲视频一二区| 国内精品自线一区二区三区视频| 色一情一乱一乱一91av| 亚洲精品一区二区三区精华液 | 国产精品99久久久久| 一本一本大道香蕉久在线精品| 日韩一级大片在线| 一区二区三区日本| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 一区二区三区色| 国产最新精品精品你懂的| 91浏览器入口在线观看| 26uuu亚洲综合色欧美| 亚洲成av人**亚洲成av**| 国产91精品一区二区麻豆网站 | 久久午夜羞羞影院免费观看| 亚洲在线视频一区| www.欧美日韩国产在线| 日韩精品影音先锋| 午夜国产精品影院在线观看| 北岛玲一区二区三区四区 | 国产精品久久久久精k8| 美脚の诱脚舐め脚责91| 亚洲一线二线三线久久久| 亚洲激情自拍视频| 国产一区视频网站| 成年人午夜久久久| 久久精品网站免费观看| 秋霞午夜av一区二区三区| 在线中文字幕一区| 亚洲天堂久久久久久久| 国产成人在线网站| 2020国产成人综合网| 日本大胆欧美人术艺术动态| 欧美性感一区二区三区| 国产精品久久久久一区| 国产传媒欧美日韩成人| 久久久久久麻豆| 精品在线观看免费| 日韩精品一区二区在线| 日本中文字幕一区二区有限公司| 欧美日韩免费在线视频| 亚洲一区成人在线| 欧美日韩中文字幕一区二区| 亚洲乱码国产乱码精品精98午夜 | 一区二区在线观看视频| 色综合久久99| **性色生活片久久毛片| 99re热这里只有精品免费视频 | 欧美亚洲综合另类| 一区二区三区成人在线视频| 日本韩国欧美国产| 亚洲综合激情小说| 欧美色手机在线观看| 国产麻豆精品在线| 欧美国产97人人爽人人喊| 成人少妇影院yyyy| 亚洲免费观看高清完整版在线| 91麻豆免费观看| 亚洲成年人影院| 日韩美女视频在线| 国产精品99久久久久久宅男| 国产精品色婷婷久久58| 91免费看视频| 亚洲一二三四在线观看| 欧美一区二区三级| 国产伦精品一区二区三区视频青涩| 国产日韩成人精品| 91免费观看视频| 午夜精品爽啪视频| 精品女同一区二区| 成人av资源在线| 亚洲午夜电影网| 精品国一区二区三区| av不卡在线观看| 婷婷久久综合九色国产成人| 精品福利二区三区| 91啪九色porn原创视频在线观看| 水蜜桃久久夜色精品一区的特点 | 91精品综合久久久久久| 国产伦精品一区二区三区免费| 亚洲色图.com| 欧美大片国产精品|