home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
HATCH
/
WWIVNEWS.ZIP
/
9509_2.NWS
< prev
next >
Wrap
Text File
|
1995-09-24
|
52KB
|
1,300 lines
───────────────┬─────────────────────────────────────────────┬───────────────
│ Understanding Viruses │
│ Compiled by Sam (1@4051) │
└─────────────────────────────────────────────┘
[This was taken from an FAQ I picked up on the net. It is a rather large
article, which I will post in parts over the next few newsletters.]
What are computer viruses (and why should I worry about them)?
According to Fred Cohen's well-known definition, a COMPUTER VIRUS is a computer
program that can infect other computer programs by modifying them in such a
way as to include a (possibly evolved) copy of itself. Note that a program does
not have to perform outright damage (such as deleting or corrupting files) in
order to to be called a "virus". However, Cohen uses the terms within his
definition (e.g. "program" and "modify") a bit differently from the way most
anti-virus researchers use them, and classifies as viruses some things which
most of us would not consider viruses.
Many people use the term loosely to cover any sort of program that tries to
hide its (malicious) function and tries to spread onto as many computers as
possible. (See the definition of "Trojan".) Be aware that what constitutes
a "program" for a virus to infect may include a lot more than is at first
obvious - don't assume too much about what a virus can or can't do!
These software "pranks" are very serious; they are spreading faster than they
are being stopped, and even the least harmful of viruses could be fatal. For
example, a virus that stops your computer and displays a message, in the
context of a hospital life-support computer, could be fatal. Even those who
created the viruses could not stop them if they wanted to; it requires a
concerted effort from computer users to be "virus-aware", rather than the
ignorance and ambivalence that have allowed them to grow to such a problem.
What is a Trojan Horse?
A TROJAN HORSE is a program that does something undocumented which the pro-
grammer intended, but that the user would not approve of if he knew about it.
According to some people, a virus is a particular case of a Trojan Horse,
namely one which is able to spread to other programs (i.e., it turns them
into Trojans too). According to others, a virus that does not do any
deliberate damage (other than merely replicating) is not a Trojan. Finally,
despite the definitions, many people use the term "Trojan" to refer only to a
*non-replicating* malicious program, so that the set of Trojans and the set of
viruses are disjoint.
What are the main types of PC viruses?
Generally, there are two main classes of viruses. The first class consists of
the FILE INFECTORS which attach themselves to ordinary program files. These
usually infect arbitrary .COM and/or .EXE programs, though some can infect any
program for which execution is requested, such as .SYS, .OVL, .PRG, & .MNU
files.
File infectors can be either DIRECT ACTION or RESIDENT. A direct-action virus
selects one or more other programs to infect each time the program which
contains it is executed. A resident virus hides itself somewhere in memory
the first time an infected program is executed, and thereafter infects other
programs when *they* are executed (as in the case of the Jerusalem) or when
certain other conditions are fulfilled. The Vienna is an example of a direct-
action virus. Most other viruses are resident.
The second category is SYSTEM or BOOT-RECORD INFECTORS: those viruses which
infect executable code found in certain system areas on a disk which are not
ordinary files. On DOS systems, there are ordinary boot-sector viruses, which
infect only the DOS boot sector, and MBR viruses which infect the Master Boot
Record on fixed disks and the DOS boot sector on diskettes. Examples include
Brain, Stoned, Empire, Azusa, and Michelangelo. Such viruses are always
resident viruses.
Finally, a few viruses are able to infect both (the Tequila virus is one
example). These are often called "MULTI-PARTITE" viruses, though there has
been criticism of this name; another name is "BOOT-AND-FILE" virus.
FILE SYSTEM or CLUSTER viruses (e.g. Dir-II) are those which modify directory
table entries so that the virus is loaded and executed before the desired
program is. Note that the program itself is not physically altered, only the
directory entry is. Some consider these infectors to be a third category of
viruses, while others consider them to be a sub-category of the file infectors.
What is a stealth virus?
A STEALTH virus is one which hides the modifications it has made in the file or
boot record, usually by monitoring the system functions used by programs to
read files or physical blocks from storage media, and forging the results of
such system functions so that programs which try to read these areas see the
original uninfected form of the file instead of the actual infected form. Thus
the viral modifications go undetected by anti-viral programs. However, in
order to do this, the virus must be resident in memory when the anti-viral
program is executed.
Example: The very first DOS virus, Brain, a boot-sector infector, monitors
physical disk I/O and re-directs any attempt to read a Brain-infected boot
sector to the disk area where the original boot sector is stored. The next
viruses to use this technique were the file infectors Number of the Beast
and Frodo (= 4096 = 4K).
Countermeasures: A "clean" system is needed so that no virus is present to
distort the results. Thus the system should be built from a trusted, clean
master copy before any virus-checking is attempted; this is "The Golden Rule
of the Trade." With DOS, (1) boot from original DOS diskettes (i.e. DOS
Startup/Program diskettes from a major vendor that have been write-protected
since their creation); (2) use only tools from original diskettes until virus
checking has completed.
What is a polymorphic virus?
A POLYMORPHIC virus is one which produces varied (yet fully operational) copies
of itself, in the hope that virus scanners will not be able to detect all
instances of the virus.
One method to evade signature-driven virus scanners is self-encryption with a
variable key; however these viruses (e.g. Cascade) are not termed "poly-
morphic," as their decryption code is always the same and thus can be used as
a virus signature even by the simplest, signature-driven virus scanners (unless
another virus or program uses the identical decryption routine).
One method to make a polymorphic virus is to choose among a variety of different
encryption schemes requiring different decryption routines: only one of these
routines would be plainly visible in any instance of the virus (e.g. the Whale
virus). A signature-driven virus scanner would have to exploit several sig-
natures (one for each possible encryption method) to reliably identify a virus
of this kind.
A more sophisticated polymorphic virus (e.g. V2P6) will vary the sequence of
instructions in its copies by interspersing it with "noise" instructions (e.g.
a No Operation instruction, or an instruction to load a currently unused reg-
ister with an arbitrary value), by interchanging mutually independent instruct-
ions, or even by using various instruction sequences with identical net effects
(e.g. Subtract A from A, and Move 0 to A). A simple-minded, signature-based
virus scanner would not be able to reliably identify this sort of virus;
rather, a sophisticated "scanning engine" has to be constructed after thorough
research into the particular virus.
The most sophisticated form of polymorphism discovered so far is the MtE
"Mutation Engine" written by the Bulgarian virus writer who calls himself the
"Dark Avenger". It comes in the form of an object module. Any virus can be
made polymorphic by adding certain calls to the assembler source code and
linking to the mutation-engine and random-number-generator modules.
The advent of polymorphic viruses has rendered virus-scanning an ever more
difficult and expensive endeavor; adding more and more search strings to simple
scanners will not adequately deal with these viruses.
What are fast and slow infectors?
A typical file infector (such as the Jerusalem) copies itself to memory when a
program infected by it is executed, and then infects other programs when they
are executed.
A FAST infector is a virus which, when it is active in memory, infects not only
programs which are executed, but even those which are merely opened. The re-
sult is that if such a virus is in memory, running a scanner or integrity
checker can result in all (or at least many) programs becoming infected all at
once. Examples are the Dark Avenger and the Frodo viruses.
The term "SLOW infector" is sometimes used for a virus which, if it is active
in memory, infects only files as they are modified (or created). The purpose
is to fool people who use integrity checkers into thinking that the modifi-
cation reported by the integrity checker is due solely to legitimate reasons.
An example is the Darth Vader virus.
What is a sparse infector?
The term "SPARSE infector" is sometimes given to a virus which infects only
occasionally, e.g. every 10th executed file, or only files whose lengths fall
within a narrow range, etc. By infecting less often, such viruses try to
minimize the probability of being discovered by the user.
What is a companion virus?
A COMPANION virus is one which, instead of modifying an existing file, creates
a new program which (unknown to the user) gets executed by the command-line
interpreter instead of the intended program. (On exit, the new program
executes the original program so that things will appear normal.) The only
way this has been done so far is by creating an infected .COM file with the
same name as an existing .EXE file. Note that those integrity checkers which
look only for *modifications* in *existing* files will fail to detect such
viruses.
(Note that not all researchers consider this type of malicious code to be a
virus, since it does not modify existing files.)
What is an armored virus?
An ARMORED virus is one which uses special tricks to make the tracing, dis-
assembling and understanding of their code more difficult. A good example is
the Whale virus.
Miscellaneous Jargon and Abbreviations
BSI = Boot Sector Infector: a virus which takes control when the computer
attempts to boot (as opposed to a file infector).
CMOS = Complementary Metal Oxide Semiconductor: A memory area that is used in
AT and higher class PCs for storage of system information. CMOS is battery
backed RAM (see below), originally used to maintain date and time information
while the PC was turned off. CMOS memory is not in the normal CPU address
space and cannot be executed. While a virus may place data in the CMOS or may
corrupt it, a virus cannot hide there.
DOS = Disk Operating System. We use the term "DOS" to mean any of the MS-DOS,
PC-DOS, or DR DOS systems for PCs and compatibles, even though there are
operating systems called "DOS" on other (unrelated) machines.
MBR = Master Boot Record: the first Absolute sector (track 0, head 0, sector 1)
on a PC hard disk, that usually contains the partition table (but on some PCs
may simply contain a boot sector). This is not the same as the first DOS sector
(Logical sector 0).
RAM = Random Access Memory: the place programs are loaded into in order to
execute; the significance for viruses is that, to be active, they must grab
some of this for themselves. However, some virus scanners may declare that
a virus is active simply when it is found in RAM, even though it might be
simply left over in a buffer area of RAM rather than truly being active.
TOM = Top Of Memory: the end of conventional memory, an architectural design
limit at the 640K mark on most PCs. Some early PCs may not be fully populated,
but the amount of memory is always a multiple of 64K. A boot-record virus on a
PC typically resides just below this mark and changes the value which will be
reported for the TOM to the location of the beginning of the virus so that it
won't get overwritten. Checking this value for changes can help detect a
virus, but there are also legitimate reasons why it may change (see C11). A
very few PCs with unusual memory managers/settings may report in excess of
640K.
TSR = Terminate but Stay Resident: these are PC programs that stay in memory
while you continue to use the computer for other purposes; they include pop-up
utilities, network software, and the great majority of viruses. These can
often be seen using utilities such as MEM, MAPMEM, PMAP, F-MMAP and INFOPLUS.
-=■=-
Here are a few lesser-known viruses I've found out about, and thought you
should know about so that you may be on the lookout for them.....
BOBBIT VIRUS: Removes a vital part of your hard disk then re-attaches it.
(But that part will never work again.)
OPRAH WINFREY VIRUS: Your 200MB hard drive suddenly shrinks to 80MB and then
slowly expands back to 200MB.
AT&T VIRUS: Every three minutes it tells you what great service you are
getting.
MCI VIRUS: Every three minutes it reminds you that you are paying too much
for the AT&T virus.
PAUL REVERE VIRUS: This revolutionary virus does not horse around. It warns
you of impending hard disk attack---once if by LAN, twice if by C:.
POLITICALLY CORRECT VIRUS: Never calls itself a "virus", but instead refers
to itself as an "electric micro-organism."
ROSS PEROT VIRUS: Activates every component in your system, just before the
whole damn thing quits.
MARIO CUOMO VIRUS: It would be a great virus, but it refuses to run.
TED TURNER VIRUS: Colorizes your monochrome monitor.
ARNOLD SCHWARZENEGGER VIRUS: Terminates and stays resident. It'll be back.
DAN QUAYLE VIRUS: Prevents your system from spawning any child process
without joining into a binary network.
DAN QUAYLE VIRUS #2: Their is sumthing rong wit yor komputer, ewe just cant
figyour out watt!
GOVERNMENT ECONOMIST VIRUS: Nothing works, but all your diagnostic software
says everything is fine.
NEW WORLD ORDER VIRUS: Probably harmless, but it makes a lot of people
really mad just thinking about it.
FEDERAL BUREAUCRAT VIRUS: Divides your hard disk into hundreds of little
units, each of which does practically nothing, but all of which claim to be
the most important part of your computer.
GALLUP VIRUS: Sixty percent of the PCs infected will lose 38 percent of
their data 14 percent of the time. (plus or minus a 3.5 percent
margin of error)
TEXAS VIRUS: Makes sure that it is bigger than any other file.
ADAM AND EVE VIRUS: Takes a couple of bytes out of your Apple.
CONGRESSIONAL VIRUS: The computer locks up, screen splits erratically with a
message appearing on each half blaming the other side for the problem.
AIRLINE VIRUS: You're in Dallas, but your data is in Singapore.
FREUDIAN VIRUS: Your computer becomes obsessed with marrying its own
motherboard.
PBS VIRUS: Your programs stop every few minutes to ask for money.
OLLIE NORTH VIRUS: Causes your printer to become a paper shredder.
NIKE VIRUS: Just does it.
SEARS VIRUS: Your data won't appear unless you buy new cables, power supply
and a set of shocks.
JIMMY HOFFA VIRUS: Your programs can never be found again.
CONGRESSIONAL VIRUS #2: Runs every program on the hard drive simultaneously,
but doesn't allow the user to accomplish anything.
STAR TREK VIRUS: Invades your system in places where no virus has gone
before.
HEALTH CARE VIRUS: Tests your system for a day, finds nothing wrong, and
sends you a bill for $4,500.
GEORGE BUSH VIRUS: It starts by boldly stating, "Read my docs... No new
files!" on the screen. It proceeds to fill up all the free space on your
hard drive with new files, then blames it on the Congressional Virus.
-=■=-
───────────────┬─────────────────────────────────────────────┬───────────────
│ Type 2/0 Forum │
│ Edited by Sam (1@4051) │
└─────────────────────────────────────────────┘
Have a comment? Got a beef? Wanna issue long-overdue kudos? Here is the
for it! Send your letters/comments/questions to Sam, 1@4051, for publication
in WWIVNews.
───────────────┬─────────────────────────────────────────────┬───────────────
│ Microsoft's Bid to │
│ Acquire the Vatican │
│ (Quasi-TechNotes by Sam (1@4051)) │
└─────────────────────────────────────────────┘
[Note: In the absence of Omega Man's TechNOTES, which he has told me he will
try to have in the next newsletter, I have attempted to try to fill the void
until Omega Man readies his submission. I found this article on the AP news-
wire, and thought some of you may find it interesting. I am for capitalism
as much as anyone, but perhaps this time Mr Gates has gone to far....]
MICROSOFT Bids to Acquire Catholic Church
By Hank Vorjes
VATICAN CITY (AP) -- In a joint press conference in St. Peter's Square this
morning, MICROSOFT Corp. and the Vatican announced that the Redmond software
giant will acquire the Roman Catholic Church in exchange for an unspecified
number of shares of MICROSOFT common stock. If the deal goes through, it will
be the first time a computer software company has acquired a major world
religion.
With the acquisition, Pope John Paul II will become the senior vice-president
of the combined company's new Religious Software Division, while MICROSOFT
senior vice-presidents Michael Maples and Steven Ballmer will be invested in
the College of Cardinals, said MICROSOFT Chairman Bill Gates.
"We expect a lot of growth in the religious market in the next five to ten
years," said Gates. "The combined resources of MICROSOFT and the Catholic
Church will allow us to make religion easier and more fun for a broader range
of people."
Through the MICROSOFT Network, the company's new on-line service, "we will
make the sacraments available on-line for the first time" and revive the
popular pre-Counter-Reformation practice of selling indulgences, said Gates.
"You can get Communion, confess your sins, receive absolution -- even reduce
your time in Purgatory -- all without leaving your home."
A new software application, MICROSOFT Church, will include a macro language
which you can program to download heavenly graces automatically while you are
away from your computer.
An estimated 17,000 people attended the announcement in St Peter's Square,
watching on a 60-foot screen as comedian Don Novello -- in character as
Father Guido Sarducci -- hosted the event, which was broadcast by satellite
to 700 sites worldwide.
Pope John Paul II said little during the announcement. When Novello chided
Gates, "Now I guess you get to wear one of these pointy hats," the crowd
roared, but the pontiff's smile seemed strained.
The deal grants MICROSOFT exclusive electronic rights to the Bible and the
Vatican's prized art collection, which includes works by such masters as
Michelangelo and Da Vinci. But critics say MICROSOFT will face stiff challenges
if it attempts to limit competitors' access to these key intellectual
properties.
"The Jewish people invented the look and feel of the holy scriptures," said
Rabbi David Gottschalk of Philadelphia. "You take the parting of the Red Sea
-- we had that thousands of years before the Catholics came on the scene."
But others argue that the Catholic and Jewish faiths both draw on a common
Abrahamic heritage. "The Catholic Church has just been more successful in
marketing it to a larger audience," notes Notre Dame theologian Father
Kenneth Madigan. Over the last 2,000 years, the Catholic Church's market
share has increased dramatically, while Judaism, which was the first to
offer many of the concepts now touted by Christianity, lags behind.
Historically, the Church has a reputation as an aggressive competitor,
leading crusades to pressure people to upgrade to Catholicism, and entering
into exclusive licensing arrangements in various kingdoms whereby all subjects
were instilled with Catholicism, whether or not they planned to use it. Today
Christianity is available from several denominations, but the Catholic version
is still the most widely used. The Church's mission is to reach "the four
corners of the earth," echoing MICROSOFT's vision of "a computer on every
desktop and in every home".
Gates described MICROSOFT's long-term strategy to develop a scalable religious
architecture that will support all religions through emulation. A single core
religion will be offered with a choice of interfaces according to the religion
desired -- "One religion, a couple of different implementations," said Gates.
The MICROSOFT move could spark a wave of mergers and acquisitions, according to
Herb Peters, a spokesman for the U.S. Southern Baptist Conference, as other
churches scramble to strengthen their position in the increasingly competitive
religious market.
───────────────┬─────────────────────────────────────────────┬───────────────
│ Filo's Mod of the Month │
│ by Filo (1@4000) │
└─────────────────────────────────────────────┘
The Mod of the Month is selected by Filo and represents his choice of what
appears to be the most promising mod posted during the past month on Mod Net
(subtype 2370). UUencoded mods are not considered for selection as part of the
mod of the month due to the difficulty of including them in the WWIVnews. Mods
which involve the use of related files such as ENHANCE.C, or any of the
various COMMON type files are also not considered due to the amount of space
required to include them here. Many of these mods have NOT been tested by
Filo and are selected based on their description as a promising, practical
mod.
This month's selection is written by Papa Bear.
Papa Bear #1 @11579
┌────────────────────────────A CEREBRUM RELEASE!─────────────────────────────┐
│ Mod Name: SPV031IK.MOD Mod Authors: 8-Ball │
│ Difficulty: ▓▓▓▓▓▓░░░░ <<< TAKE NOTE! Repo Man │
│ Revision Dates: FIRST [01/10/92] Captain EJ │
│ LAST [07/18/95] Pâpâ ßêâr (1@11579 WW4net) │
│ WWIV Version: 4.24 [not for versions previous to 4.24!] │
│ Files Affected: MSGBASE.C MSGBASE1.C READMAIL.C FCNS.H VARS.H VARDEC.H │
│ Description: 8-Ball's Quote Mod! As revised by Repo Man and myself. Code │
│from Captain EJ included. I think this is the *best* quote mod I've seen! │
│>>> NOW WORKS WITH NON-FSE's AS WELL AS FSE's!!! Added Anonymous support. │
╞═────────────────────────────────────═╤═───────────────────────────────────═╡
│ StarPort Valhalla [ ] - ASV 28.8kbps Home of the SPV mod series! │
└─────────────────────────────────────═╧═────────────────────────────────────┘
>>> OFFICIAL WWIV SUPPORT SITE! <<<
Word of Warning: You installed it, you're responsible! Make back-ups BEFORE
attempting to install this modification! Read all text before beginning.
Again, READ THIS ENTIRE MOD >BEFORE< BEGINNING!
─────────────────────────────────────────────────────────────────────────────
LEGEND:
== Original Code [use this to search on]
++ Add this Line [mods ALWAYS add stuff, don't they?]
-- Delete this Line [or comment out, its not needed]
-+ Change this Line [I usually comment these lines]
... Skipping some code here [keeps the mod shorter]
─────────────────────────────────────────────────────────────────────────────
LONG DESCRIPTION: The famous SPV modification redone for WWIV 4.24. You
should note that 4.24 introduced the M command at the mail prompt that will
allow you reply to E-Mail to a different address than it was sent from. For
that reason, this that feature has been removed from this mod proper. The @
command will allow you to send a subboard post to a E-Mail address other than
the one it originated from.
REVISION "K"
- Added ability to use the /Q command in WWIVEdit to quote text.
- Added #define so you could simply not bother FSED users with quoting
individual lines. (Since the /Q now works.)
- Found a HUGE section of existing 4.24 coding that can now be removed.
To UPGRADE:
Find all occurances of SPV031IK and add/change/delete accordingly. See
STEPs: 7, 9a, 11, 13a, 13b, 14, 15a
─────────────────────────────────────────────────────────────────────────────
STEP 1: Add this line the the top of MSGBASE.C
== #include "vars.h"
==
== #pragma hdrstop
== #include <mem.h>
== #include <errno.h>
== #include "subxtr.h"
++ #include <ctype.h> // SPV031
==
== #define ALLOW_FULLSCREEN 1
─────────────────────────────────────────────────────────────────────────────
STEP 2: In MSGBASE.C, make the following changes in:
char *readfile(messagerec *m1, char *aux, long *l)
== return(NULL);
== }
== l1=filelength(f);
-+ if ((b=malloca(l1+2L))==NULL) { // SPV031 - add +2L
== sh_close(f);
== return(NULL);
== }
. . . SKIPPING SOME LINES HERE, TAKE CARE TO NOTE THE PROPER LOCATION! . . .
== return(NULL);
== }
== l1=filelength(f);
-+ if ((b=malloca(l1+258L))==NULL) { // SPV031 - change 256 to 258
== sh_close(f);
== return(NULL);
== }
== sh_read(f,(void *)b,l1);
─────────────────────────────────────────────────────────────────────────────
STEP 3: Add these variable declarations in MSGBASE.C to void inmsg(...)
== struct {char tlen, ttl[81], anon; } fedit_data;
== xtrasubsnetrec *xnp;
== char q_txt[256];
++ FILE *pbquote; // SPV031
++ char pb[13],pb1[161]; // SPV031
++ int j=0; // SPV031
==
== oiia=iia;
─────────────────────────────────────────────────────────────────────────────
STEP 3a: Add these lines in the same function
== inputl(title,60);
== }
== if ((title[0]==0) && (needtitle)) {
// SPV031 block START
sprintf(pb1,"%sINPUT.MSG",syscfgovr.tempdir);
unlink(pb1);
// SPV031 block END
== pl(get_string(14));
== m.stored_as=0xffffffff;
─────────────────────────────────────────────────────────────────────────────
STEP 4: Still in void inmsg(...) a little ways down, make these changes
== outstr(get_string(627));
== pln(maxli);
== pl(get_string(628));
// SPV031 block START
if (quoted) {
nl();
pl("9Type 1/Q9 in the message to view the quoted text!0");
nl();
}
// SPV031 block END
== strcpy(s,get_string(629));
== s[thisuser.screenchars]=0;
== pl(s);
. . . JUST A LITTLE FURTHER DOWN NOW . . .
== if (stricmp(s,get_string(942))==0) {
== savel=0;
== printmenu(2);
== }
// START SPV031 BLOCK COPY
if (stricmp(s,"/Q")==0) {
// if (stricmp(stripcolors(s),"/Q")==0) { // NOTE 1 -- SPV031
if (quoted) {
sprintf(pb,"%sINPUT.MSG",syscfgovr.tempdir);
printfile(pb);
} else {
nl();
pl("6You must quote the message you're replying to to0");
pl("6use this command. Please continue your message.0");
nl();
}
}
// END SPV031 BLOCK COPY
== if (stricmp(s,get_string(943))==0) {
== savel=0;
== prt(5,get_string(630));
NOTE 1: If using FMD's FMD-39A.MOD (keep color) uncomment this line, and
comment out the one ABOVE it!
─────────────────────────────────────────────────────────────────────────────
STEP 5: Still in void inmsg(...) a LOT further down, make these changes
== sh_read(i5, (void *) (& (b[l1]) ),ll);
== l1 += ll;
== sh_close(i5);
== } else {
// START SPV031 BLOCK COPY
if (quoted) {
sprintf(pb,"%sINPUT.MSG",syscfgovr.tempdir);
pbquote=fsh_open(pb,"rt");
if (!pbquote) {
nl();
pl(get_stringx(4,91));
j=0;
nl();
} else {
do {
fgets(pb1,160,pbquote);
addline(b,pb1,&l1);
} while (!feof(pbquote));
}
fsh_close(pbquote);
unlink(pb);
}
nl();
if (j)
pl(get_stringx(4,92));
// END SPV031 BLOCK COPY
== for (i5=0; i5<curli; i5++)
== addline(b,&(lin[i5*LEN]),&l1);
== }
==
== if (sysinfo.flags & OP_FLAGS_MSG_TAG) {
─────────────────────────────────────────────────────────────────────────────
STEP 5a: Add these lines a bit further down:
== if (fsed)
== unlink(fnx);
== pl(get_string(14));
// SPV031 block START
sprintf(pb1,"%sINPUT.MSG",syscfgovr.tempdir);
unlink(pb1);
// SPV031 block END
== m.stored_as=0xffffffff;
== }
== *m1=m;
─────────────────────────────────────────────────────────────────────────────
STEP 6: Add these lines in MSGBASE.C
== if (an) {
== strcat(s,nam(&ur,un));
== sysoplog(s);
++ Unknown=0; // SPV031
== } else {
++ Unknown=1; // SPV031
== strcpy(s1,s);
== strcat(s1,nam(&ur,un));
== sysoplog(s1);
== strcat(s,get_string(482));
. . . A little farther down . . .
== if (an) {
== read_user(un,&ur);
== strcpy(s2,nam(&ur,un));
++ Unknown=0; // SPV031
-+ } else { // SPV031 added {
++ Unknown=1; // SPV031
== strcpy(s2,get_string(482));
++ } // SPV031
== } else {
== if (net_num_max>1) {
─────────────────────────────────────────────────────────────────────────────
STEP 7: Add these three functions to the end of MSGBASE.C
// SPV031 BLOCK COPY START
void extract_out2(char *org, long len, int type, long daten)
{
char s[255],s1[81],s2[81],*p,buf[255],*b,tb[81],tb1[81],b1[81],pb[81],ch;
int i,ii=0,j,jj,length,qnq=1,line_control,done,k;
FILE *Output;
printfile("QUOTE");
if (!okfsed())
pausescr();
nl();
quoted=0;
#ifdef BOTHER_USER_QUOTE // SPV031IK
if (okfsed()) {
npr("5Do you want to select the lines to quote? 0");
if (!yn())
qnq=0;
else
outchr(12);
} else
outchr(12);
#else // SPV031IK
if (okfsed()) // SPV031IK
qnq=0; // SPV031IK
else // SPV031IK
outchr(12); // SPV031IK
#endif // SPV031IK
p=b=org;
if (!hangup) {
sprintf(s2,"%sINPUT.MSG",syscfgovr.tempdir);
unlink(s2);
if ((Output=fopen(s2,"w+t"))==NULL) {
sprintf(s,"6ERR2: 9Could not create 1%s9! 5(1quote file5)0");
nl();
if (so())
pl(s);
else {
ssm(1,0,s);
pl("6Could not create quote file -- SysOp notified!0");
}
nl();
return;
}
while (*p!='\r')
++p;
*p='\0';
strcpy(s1,b);
p+=2;
len=len-(p-b);
b=p;
while (*p!='\r')
++p;
p+=2;
len=len-(p-b);
b=p;
sprintf(pb,"%s",ctime(&daten));
sprintf(s2,"1%s7, 1%s7. 1%s7, 1%s0",
(strnncpy(pb,0,2)),
(strnncpy(pb,4,6)),
(strnncpy(pb,8,9)),
(strnncpy(pb,20,23)));
strcpy(tb1,stripcolors(strip_to_node(s1)));
properize(tb1);
if (strlen(tb1)%2!=0)
sprintf(tb," %s",tb1);
else
strcpy(tb,tb1);
jj=tb1[0]=0;
for (j=0;j<strlen(tb);j++) {
if ((toupper(tb[j])==tb[j]) &&
(isalpha(tb[j]))) {
tb1[jj]=tb[j];
tb1[jj+1]=0;
jj++;
}
}
if (!tb1[0]) {
if (tb[0]==32)
tb1[0]=tb[1];
else
tb1[0]=tb[0];
tb1[1]=0;
}
if (Unknown) {
sprintf(tb," %s",get_string(482));
strcpy(tb1,"6>2U6<0");
Unknown=0;
}
switch (type) {
case 1:
sprintf(buf,"3» 9In your E-Mail of 1%s7,9 you wrote: 3«0",s2);
break;
case 2:
sprintf(buf,
"3» 9This was forwarded from 1%s9, sent on 1%s9. 3«0",tb,s2);
break;
case 3:
sprintf(buf,
"3» 9In a message posted 1%s7,9 you wrote: 3«0",s2);
break;
case 4:
sprintf(buf,"3» 9On 1%s7, 1%s9 said this: 3«0",s2,tb);
break;
}
length=0;
for (j=0;j<strlen(buf);j++) {
if ((buf[j]!='\003') && (buf[j-1]!='\003'))
length++;
}
jj=(39-(length/2));
fprintf(Output,"2%s%s%s0\n",charstr(jj,196),buf,charstr(jj,196));
line_control=1;
done=0;
k=77-strlen(tb1);
while ((len>0) && (!done) && (!hangup)) {
while ((strchr("\r\001",*p)==NULL) && ((p-b)<(len<253 ? len : 253)))
++p;
if (*p=='\001')
*(p++)='\0';
*p='\0';
if ((*b!='\004') && (strchr(b,'\033')==NULL)) {
for (j=0;j<k;j++) {
if (((b[j]=='0') && (b[j-1]!='\003')) || (b[j]!='0'))
b1[j]=b[j];
else
b1[j]='7';
b1[j+1]=0;
}
if ((qnq) && (line_control>thisuser.screenlines)) {
line_control=0;
outchr(12);
}
if ((qnq) && (okansi())) {
goxy(0,line_control);
line_control++;
}
if ((ii) && (okansi()) && (qnq)) {
pl(charstr(79,32));
goxy(0,line_control-1);
}
sprintf(buf,"1%s7»9%s0",tb1,b1);
if (qnq) {
if (!okansi())
outchr(12);
pl(buf);
if (okansi()) {
goxy(0,line_control);
line_control++;
}
npr(
"5Quote this line? 3(1[2Y1]es, [2n1]o, [2q1]uit, [2a1]bort3) 0");
ch=onek("QY\rNA");
switch (ch) {
case '\r':
case 'Y':
fprintf(Output,"%s\n",buf);
quoted=1;
ii=0;
line_control--;
goxy(0,line_control);
pl(charstr(79,32));
done=0;
break;
case 'N':
line_control-=2;
ii=1;
done=0;
break;
case 'A':
pl("Aborted!");
quoted=0;
done=1;
break;
default:
case 'Q':
done=1;
break;
}
} else {
fprintf(Output,"%s\n",buf);
quoted=1;
}
}
p+=2;
len=len-(p-b);
b=p;
}
nl();
pl("5Enter your reply text 3(1default6: 2My reply to this3)0");
mpl(60);
inputl(s,60);
if (!s[0])
strcpy(s,"My reply to this");
jj=(39-((strlen(s)+4)/2));
fprintf(Output,"2%s3» 4%s3 «2%s0\n",
charstr(jj,196),s,charstr(jj,196));
outchr(12);
if (!okfsed())
fprintf(Output,"\n");
fclose(Output);
// if (!quoted) { // SPV031IK removed
// sprintf(s2,"%sINPUT.MSG",syscfgovr.tempdir); // SPV031IK removed
// unlink(s2); // SPV031IK removed
// } // SPV031IK removed
}
farfree(org);
}
char *strip_to_node(char *txt)
{
int i,ok,ok1,i1=-1;
char s[81],s1[81];
if (txt[0]==96 && txt[1]==96) {
for (i=2;(i<=strlen(txt)) && (txt[i]!=96);i++) {
s[i-2]=txt[i];
s[i-1]=0;
}
return(s);
}
if (strstr(txt,"AT")) {
ok=1;
for (i=2; i<strlen(txt); i++) {
if (ok) {
s[++i1]=txt[i];
s[i1+1]=0;
}
if (txt[i+1]==96)
ok=0;
}
return(s);
}
if (strstr(txt,"@")) {
if (strstr(txt,"#")==NULL) {
strcpy(s1,strrev(txt));
ok=ok1=0;
for (i=0;i<strlen(s1);i++) {
if ((ok) && (ok1)) {
s[i1++]=s1[i];
s[i1+1]=0;
}
if ((ok1) && (!ok)) {
if (s1[i+1]==32)
ok=1;
}
if ((s1[i]==64) && (!ok1))
ok1=1;
}
return(strrev(s));
} else {
ok=1;
for (i=0; i<strlen(txt); i++) {
if (ok) {
s[i]=txt[i];
s[i+1]=0;
}
if (txt[i+2]==35)
ok=0;
}
return(s);
}
}
return(txt);
}
char *strnncpy(char *str_parse, int start_ch, int end_ch)
{
int i,j=0;
char s[255];
if (start_ch<0)
start_ch=0;
if (end_ch>(strlen(str_parse)))
end_ch=strlen(str_parse);
for (i=start_ch;i<(end_ch+1);i++) {
s[j]=str_parse[i];
s[j+1]=0;
j++;
}
return(s);
}
// SPV031 BLOCK COPY END
NOTE: To use this function, simply call it something like:
strcpy(s,(strnncpy("This is a test",5,8)));
This places "is a" into the variable s.
─────────────────────────────────────────────────────────────────────────────
STEP 8: Prototype the function ins FCNS.H:
== int existprint(unsigned char *fn);
== void read_message(int n, int *next, int *val);
== void lineadd(messagerec *m1, char *sx, char *aux);
++ void extract_out2(char *org, long len, int type, long daten); //SPV031
++ char *strip_to_node(char *txt); //SPV031
++ char *strnncpy(char *str_parse, int start_ch, int end_ch); //SPV031
==
== /* File: msgbase1.c */
─────────────────────────────────────────────────────────────────────────────
STEP 9: Add these global variable declarations to VARS.H in the __EXTRN__
int section:
== use_workspace, using_modem, wfc, x_only,
== instance,debuglevel,multitasker,tagging,tagptr,cursormove,
-+ titled, abortext,quoted,Unknown; // SPV031
==
== __EXTRN__ unsigned short com_speed, *csn_index, crc, *gat, modem_flag,
== modem_mode, modem_speed, net_sysnum, curloc, eflags;
─────────────────────────────────────────────────────────────────────────────
STEP 9a: Add this line to the top of VARDEC.H
== #ifndef __OS2__
== #define RIPDRIVE
== #endif
==
++ #define BOTHER_USER_QUOTE // SPV031IK - NOTE
==
== #define OK_LEVEL 0
== #define NOK_LEVEL 1
NOTE : Comment this line out if you don't want to bother your users by asking
them if they want to quote. With this commented out, it will quote
everytime. Additionally, when commented out, it'll stop asking FSED
users if they want to quote by line ('cause the /Q works in WWIVEdit
now.)
─────────────────────────────────────────────────────────────────────────────
STEP 10: In MSGBASE1.C, add this line in
void scan(int msgnum, int optype, int *nextsub)
== write_inst(INST_LOC_SUBS, usub[cursub].subnum, INST_FLAGS_NONE);
== switch(optype) {
== case 0: /* Read Prompt */
++ quoted=0; // SPV031
== if (E_C) {
== sprintf(s,"1%s0:7(11-%u,^%u7)1,? 0: ",get_string(678),
== nummsgs,msgnum);
─────────────────────────────────────────────────────────────────────────────
STEP 11: In MSGBASE1.C, make the following changes in:
void scan(int msgnum, int optype, int *nextsub)
== optype=2;
== msgnum=i;
== } else
== if (s[1]==0) {
// START SPV031 BLOCK COPY
if ((s[0]=='A') || (s[0]=='W')) {
#ifdef BOTHER_USER_QUOTE // SPV031IK
nl();
npr("5Quote from this message? 0");
if (ny()) {
#endif // SPV031IK
p2=*get_post(msgnum);
grab_quotes(&(p2.msg),subboards[curlsub].filename);
if ((msgnum>0) && (msgnum<=nummsgs)) {
b=readfile(&(get_post(msgnum)->msg),
(subboards[curlsub].filename),&len);
extract_out2(b,len,((s[0]=='A')?3:4),p2.daten);
}
#ifdef BOTHER_USER_QUOTE // SPV031IK
}
#endif // SPV031IK
}
// END SPV031 BLOCK COPY
== switch(s[0]) {
==
== /* Find addition */
─────────────────────────────────────────────────────────────────────────────
STEP 12: In MSGBASE1.C, make the following changes in:
void scan(int msgnum, int optype, int *nextsub)
++ case '@': // SPV031
== case 'A':
== if (rip_on()) {
== sprintf(s,"\n!|w000%c271610|e|#\r ", formery);
== comstr(s);
. . . SKIPPING DOWN A HAIR . . .
== pl(get_string(679));
== break;
== }
== }
// START SPV031 BLOCK COPY
if (s[0]=='@') {
nl();
pl("4Replying to a different address!0");
send_email();
} else {
// END SPV031 BLOCK COPY
== if ((lcs()) || (ss.ability & ability_read_post_anony) ||
== (get_post(msgnum)->anony==0))
== else
== email(get_post(msgnum)->owneruser,
== get_post(msgnum)->ownersys,0,get_post(msgnum)->anony);
++ } // SPV031 added }
== irt_sub[0]=0;
== grab_quotes(NULL, NULL);
DID YOU ADD THE } (4 LINES ABOVE HERE)
─────────────────────────────────────────────────────────────────────────────
STEP 13: Make these changes in MSGBASE1.C, function:
void scan(int msgnum, int optype, int *nextsub)
== if ((msgs[msgnum].anony & anony_sender) &&
== ((syscfg.sl[actsl].ability & ability_read_post_anony)==0)) {
== strcat(s,get_string(482));
++ Unknown=1; // SPV031
== } else {
++ Unknown=0; // SPV031
== b=readfile(&(msgs[msgnum].msg),(subboards[curlsub].filename),
== &len);
─────────────────────────────────────────────────────────────────────────────
STEP 13a: Add these lines to MSGBASE1.C
void grab_quotes(messagerec *m, char *aux):
++ //#define REMOVE_COLOR // SPV031IK NOTE
==
== void grab_quotes(messagerec *m, char *aux)
== {
++ FILE *File; // SPV031IK
++ char ch,pb[161],pb1[161]; // SPV031IK
== char *ss,*ss1;
== long l,l1,l2,l3;
== FILE *f;
NOTE: Normally this mod adds quite a bit of color to the quoted text. In
using the /Q mode of WWIVEdit, all this color *can* cause the editor
to add extra, blank, lines. These lines can easily be removed by you
using CTRL-Y on the blank line. (This is due to the line length being
80 instead of 79 characters.) If you want a more ordered output, one
that has no blank lines, and no color as well, then uncomment this
line (#define REMOVE_COLOR).
─────────────────────────────────────────────────────────────────────────────
STEP 13b: Now add this block at the end of the same function:
== quotes_nrm=NULL;
== quotes_nrm_l=0;
== #endif
== }
== }
== }
// START SPV031IK block copy
sprintf(q_txt,"%sINPUT.MSG",syscfgovr.tempdir);
if (exist(q_txt)) {
f=fopen(q_txt,"rt");
sprintf(q_txt,"%sQUOTES.TXT",syscfgovr.tempdir);
File=fopen(q_txt,"wt");
fputs(" \n \n",File);
pb1[0]=0;
while ((!hangup) && (!feof(f))) {
fgets(pb,160,f);
if (strcmp(pb,pb1)) {
strcpy(pb1,pb);
#ifdef REMOVE_COLOR
fprintf(File,"%-79s",stripcolors(pb));
#else
fprintf(File,"%s",pb);
#endif
}
}
fclose(f);
fclose(File);
nl();
npr("5Auto-Display quoted text in editor? 0");
if (!ny()) {
sprintf(q_txt,"%sINPUT.MSG",syscfgovr.tempdir);
unlink(q_txt);
}
}
// END SPV031IK block copy
== }
─────────────────────────────────────────────────────────────────────────────
STEP 14: Now in READMAIL.C make these changes in void readmail(void)
== pl(get_string(715));
== nl();
== break;
== }
== nln(2);
// START SPV031 BLOCK COPY
#ifdef BOTHER_USER_QUOTE // SPV031IK
nl();
npr("5Quote this message?0 ");
if (ny()) {
#endif // SPV031IK
b=readfile(&(m.msg),"EMAIL",&len);
extract_out2(b,len,2,m.daten);
nl();
pl("6Forwarding this E-Mail.0");
send_email();
// break; // SPV031IK REMOVED THIS LINE
#ifdef BOTHER_USER_QUOTE // SPV031IK
}
#endif // SPV031IK
// END SPV031 BLOCK COPY
== prt(2,get_string(716));
== input(s,75);
. . . SKIPPING SOME MORE LINES! . . .
== case 'A':
== case 'S':
== case 'M':
// START SPV031 BLOCK READ
#ifdef BOTHER_USER_QUOTE // SPV031IK
nl();
npr("5Quote from this message? 0");
if (ny()) {
#endif // SPV031IK
grab_quotes(&(m.msg),"EMAIL");
b=readfile(&(m.msg),"EMAIL",&len);
extract_out2(b,len,((ch=='M')?2:1),m.daten);
if (ch=='M') {
nl();
pl("5Forwarding this E-Mail!0");
}
#ifdef BOTHER_USER_QUOTE // SPV031IK
}
#endif // SPV031IK
// END SPV031 BLOCK READ
== if (rip_on()) {
== sprintf(s,"\n!|w000%c271610|e|#\r ", formery);
. . .SKIP DOWN JUST A FEW MORE LINES . . .
== i2=0;
== break;
== } else if (m.fromuser!=65535) {
-- grab_quotes(&(m.msg),"EMAIL"); // SPV031 delete this line
== if (ch=='M') {
─────────────────────────────────────────────────────────────────────────────
STEP 15: Make these changes throughout READMAIL.C
== sprintf(s,"2%3d 7%c0 ",i+1,okansi()?'│':'|');
== if ((m.anony & anony_sender) &&
== ((ss.ability & ability_read_email_anony)==0)) {
== strcat(s,get_string(482));
++ Unknown=1; // SPV031
== } else {
++ Unknown=0; // SPV031
== if (m.fromsys==0) {
== if (m.fromuser==65535) {
. . . SKIPPING DOWN . . .
== strcpy(s,nam1(&thisuser,usernum,net_sysnum));
-+ if (m.anony & anony_receiver) { // SPV031 added {
== strcpy(s,get_string(482));
++ Unknown=1;
++ } else
++ Unknown=0;
== strcat(s,get_string(713));
. . . DOWN SOME MORE . . .
== sprintf(s,"%s: %s",net_name,nam1(&thisuser,usernum,net_sysnum));
== else
== strcpy(s,nam1(&thisuser,usernum,net_sysnum));
-+ if (m.anony & anony_receiver) { // SPV031 added {
== strcpy(s,get_string(482));
++ Unknown=1;
++ } else
++ Unknown=0;
== strcat(s,get_string(713));
. . .YEP, GO DOWN SOME MORE! (YES IT LOOKS THE SAME AS ABOVE). . .
== sprintf(s,"%s: %s",net_name,nam1(&thisuser,usernum,net_sysnum));
== else
== strcpy(s,nam1(&thisuser,usernum,net_sysnum));
-+ if (m.anony & anony_receiver) { // SPV031 added {
== strcpy(s,get_string(482));
++ Unknown=1;
++ } else
++ Unknown=0;
== strcat(s,get_string(713));
== strcat(s,date());
─────────────────────────────────────────────────────────────────────────────
STEP 15a: Go back to the top of the top of the void readmail(void) function
and find this large block of code. Remove it all.
// SPV031IK START CODE REMOVAL
-- prt(2,get_string(716));
-- input(s,75);
. . . continue removing (commenting out) code all the way down to here . . .
-- if ((!wfc) && (incom))
-- topscreen();
-- mailcheck=1;
-- }
-- }
-- }
-- }
// SPV031IK END CODE REMOVAL
== break;
== case 'A':
== case 'S':
== case 'M':
─────────────────────────────────────────────────────────────────────────────
STEP 16: In NEWUSER.C, make this change in: void properize(char *s)
== for (i=0;i<strlen(s);i++) {
== if ((i==0) || ((i>0) && ((s[i-1]==' ') ||
++ (s[i-1]=='-') || // SPV031
== (s[i-1]=='.')))) {
─────────────────────────────────────────────────────────────────────────────
STEP 17: Make a file in your GFILES and call it QUOTE.MSG. Mine looks like
this, and yours should be similar!
QUOTE.MSG
---------
You are about to send a msg/e-mail with a quotation in it. You should
remove unnecessary lines, including taglines and signoff macros. This
helps reduce network LD costs.
─────────────────────────────────────────────────────────────────────────────
STEP 18: Recompile this beast, and enjoy your new quoting!
─────────────────────────────────────────────────────────────────────────────
Well, this is a complete overhauled mod for 4.24. I've installed it first
thing on my virgin 4.24 system 'cause this is the most installation intensive
mod I make.
The word is, it works fine...
This mod is copyright 1993-1995 by Tracy Baker, aka Papa Bear, and is
distributed as freeware. Permission is granted to distribute and post this
mod on BBS systems and online services, provided no alterations are made
(removal of message headers/taglines allowed). This mod may contain some
parts of WWIV source code, which is copyright 1988-1994 by Wayne Bell and
licensed only to registered users of WWIV. Use of WWIV source without
registration constitutes a license violation and could lead to legal
prosecution and certain doom.
Shareware distributors and CD-ROM publishers may not distribute this mod
without express written permission of the Author or WWIV Software Services.
-=■=-