⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wninject.c

📁 数据隐藏程序
💻 C
字号:
/**************************************************************************\
* WNINJECT(tm):  Program to inject or extract LSB's out of a PCX image. It *
*                is reccomended that the image be 24 bits for the purpose  *
*                of having it used with WNSTORM.                           *
*                                                                          *
*                             V9405130050                                  *
*                                                                          *
* Copyright (C) 1994 by Ray (Arsen) Arachelian, All Rights Reserved, GTDR  *
*                                                                          *
*                                                                          *
*    WARNING: This source code is the sole property of the author and is   *
*    to be treated as such.  The use of this source code is subject to     *
*    certain limitations stated in the documentation.  Use of this source  *
*    code is subject to the conditions stated therein. Using this source   *
*    code signifies acceptance to the terms listed in the documentation.   *
*                                                                          *
*    The ideas/algorithms of this software MAY not be patented by other    *
*    parties.                                                              *
*                                                                          *
* Ray (Arsen) Arachelian is the author and sole owner of WNINJECT(tm) and  *
* WNSTORM(tm) and maintains exclusive proprietary interests and exclusive  *
* copyright for these forementioned programs.                              *
*                                                                          *
* WNINJECT and WNSTORM are trademarks of the author                        *
*                                                                          *
* WARANTY: There ain't none.  Due to the nature of this software, the      *
*          author disclaims all warranties whether express or implied. The *
*          software distributed in this package is distributed "AS IS" and *
*          all consequences arising from its use are the solely the user's *
*          responsability.  Neither the author, nor his associates may be  *
*          held liable for any damage/consequnces arising from the use of  *
*          this software.  Some states do not allow the exclusion of       *
*          warranties, so your rights may vary.                            *
*                                                                          *
*          Don't bother suing me.   I'm not rich.                          *
*                                                                          *
*                                                                          *
* LICENSE:                                                                 *
*                                                                          *
* This is published proprietary source code of the author, and may be      *
* freely distributed and copied as long as this and any other copyright,   *
* trademark, and ownership notices are not altered in any way shape or form*
*                                                                          *
* This software is hereby deemed freeware and may not be sold.  A small    *
* duplication charge (less than $5.00 US) may be made as compensation for  *
* the specific distribution of this software. This software may be included*
* on any CD-ROM collection of shareware and or freeware.   Please feel free*
* to give out copies of this software to your friends.                     *
*                                                                          *
* You may not distribute modified copies of this software without the      *
* written consent of the author.                                           *
*                                                                          *
* Usage of this software indicates an agreement to the above license.      *
*                                                                          *
* Should any statement in this license be deemed invalid, only that        *
* statement shall be revoked, leaving the rest of this license valid.      *
*                                                                          *
* This license terminates when the user destroys all copies of this        *
* software from all media on which it resides.                             *
*                                                                          *
\**************************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <conio.h>  /* for getch()  */
#include <ctype.h>


/* Used by bit shifting i/o routine */

int inbits=0;
int fromwns=0;
int shreg=0;


int mask=1;               /* Selected by number of colors */
int highbit=1;            /* Selected by number of colors */



FILE *original;
FILE *wnfile;
FILE *newfile;
long original_end; /* Size of the original PCX file.  Doctored to work */
		   /* correctly with the pallete information.          */
long actualfilesize; /* Actual end of original PCX file                */


const char *kind="PCX";


struct pcxheader
{
       char manufacturer;
       char version;
       char encoding;
       char bitsperpixel;
       int  windowx1;
       int  windowy1;
       int  windowx2;
       int  windowy2;
       int  xdpi;
       int  ydpi;
       char colormap[48];
       char reserved;

       char numcolorplanes;

       int  bytesperline;
       int  palletteinfo;
       int  xscrsize;
       int  yscrsize;
       char filler[54];
} pcxheader;




int XSIZE, YSIZE;
long LineBytes;      /* Total memory required to hold one PCX scanline */
long PCXTotalBytes;  /* Total memory required to hold whole PCX image  */



void  pcxinfo(void);
void  helpscreen(void);
void  extract(void);
void  inject(void);
void  copyfile(void);
int   rleflag(char);
void  scanrot(void);
void  sethighbit(int);
void  bitput(char);
void  bitmix(int);
void  thermometer(void);









/***********************************************************************\
*                                                                       *
* Display a rotating cursor to inform user that program is busy.        *
*                                                                       *
* This should be replaced with a rotating watch cursor/hourglass mouse  *
* cursor.                                                               *
*                                                                       *
\***********************************************************************/

void scanrot(void)
{

 char scan[]="/-\\|";
 static int rotpos;

 rotpos++;
 rotpos=(rotpos & 3);

 printf("%c%c",scan[rotpos],8);

}



/*-------------------------------------------------------------------*\
| FUNCTION: thermometer                                               |
| ------------------------------------------------------------------- |
|                                                                     |
| Written  by: Ray Arachelian   on 07/14/1992                         |
| Modified by:                  on                                    |
| Reason for modification:                                            |
|                                                                     |
| ------------------------------------------------------------------- |
|                                                                     |
| PURPOSE: Display the infile thermometer bar                         |
|                                                                     |
| PARAMS:  none                                                       |
|                                                                     |
| RETURNS: nothing.                                                   |
|                                                                     |
| NOTE:  This function may need to be re-written for different o/s's. |
|        For unix systems running on non-80x86's, you may wish to     |
|        change the filled character to a pound symbol, and the       |
|        empty character to perhaps a minus symbol, or an underline.  |
|                                                                     |
|        Then again on unix systems, you may want to remove this      |
|        function entirely if you plan to pipe its output.            |
|                                                                     |
|        On GUI based o/s's (Mac, Windows, Next, etc.) you may wish   |
|        use o/s calls to actually draw a thermometer window, and     |
|        animate it.                                                  |
|                                                                     |
\*-------------------------------------------------------------------*/

void thermometer(void)
{
 unsigned long a,i;
 unsigned long percent;

 char filled='

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -