home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d07xx
/
d0797.lha
/
BBBF
/
Programmers
/
BootblockLibrary.doc
next >
Wrap
Text File
|
1993-01-10
|
10KB
|
288 lines
Bootblock.library
version 1.0 beta
Released the 11th of November 1992
Programmed by Johan Eliasson, SHI member.
Copyright ⌐ Safe Hex International 1992
INTRODUCTION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bootblock.library/brainfile is an attempt to make life a little
bit easier for programmers of anti-virus utilities, diskcopy programs,
directory utilities, disk packers and for whoever who wants to check the
bootblock of some device, and of course for you, the user, who are dead-
tired of those %$ú&%$& viruses...
The library has some easy-to-use functions to read the brainfile, and to
check a bootblock with it. The brainfile will be kept in memory for
you by the library, so that more than one program can use it simultaneously.
I know this doc is short, but take a look at my CheckDrive.c source
and you will get it. If not, write me a letter!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEGAL STUFF
~~~~~~~~~~~
The BBBF package is freely distributable as long as all of its files are
included in their original form without additions, deletions, or
modifications of any kind, with the following exception:
If your program uses the Bootblock.library/Bootblock.brainfile then they
may be distributed along with it.
If you use this library in your program you must give credit to SHI (like
the note below) and the programmer in your documentation.
The BBBF package may not be used in a commercial program without written
permission by Safe Hex International.
Only a nominal fee (maximum 6$) may be charged for the distribution of BBBF.
This software is provided "AS IS" without warranty of any kind, either
expressed or implied. By using the BBBF package, you agree to accept the
entire risk as to the quality and performance of the program.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some Notes About SHI
--------------------
I'm member of SHI (Safe Hex International) a world wide Amiga user-
group, special founded to get the Amiga more popular and to fight
against virus spreading.
ABOUT SAFE HEX INTERNATIONAL
If you know a virus programmer you can get a reward of $ 1000 for
supplying his name and address. The fact is that the law punishes data
crime very severely (5 years in jail in most countries).
We are an international user group with more than 500 members, who have
started trying to stop the spreading of viruses. Let me give you some
example:
1. Our motto is: "Safe Hex, who dares do anything else today?".
2. A virus bank containing all well known virus killer programmes.
3. We help people to get money back lost by virus infection.
4. We write articles about virus problems for 9 Amiga magazines.
5. We release the newest and the best virus killers around.
6. We have more than 30 "Virus Centers" worldwide where you can get
free virus help by phoning our "Hotlines", and of cause get the
newest virus killers too translated in your own.... language for
a very little cost.
For more information contact:
SAFE HEX INTERNATIONAL (Please send 2 "Coupon-Response
Erik Loevendahl Soerensen International" and a self addres-
Snaphanevej 10 sed envelope, if you want more
DK-4720 Praestoe information about SHI by letter)
Denmark
Phone: + 45 55 99 25 12
Fax : + 45 55 99 34 98
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TABLE OF CONTENTS
Bootblock.library/ReadBBBF
Bootblock.library/FreeBBBF
Bootblock.library/CheckBoot
Bootblock.library/GetBBBFInfo
Bootblock.librray/ListBBBF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/ReadBBBF
result = ReadBBBF(name);
long ReadBBBF(char *);
A0
DESCRIPTION
Will read the Bootblock.brainfile from name, and keep it in memory
for you until you FreeBBBF() it.
INPUTS
name = "L:Bootblock.brainfile" or wherever you want to load it from.
RESULT
result = errorcode.
if result > 0 then result is the code returned by IoErr() in case
of an IO error. Use Fault() to get the meaning of that.
if result = 0 then the brainfile is successfully loaded and
everything's fine.
if result = -1 It was no brainfile...strange...
-2 Corrupted brainfile. Someone has fiddled with it.
-3 Already loaded by someone else!
-4 No memory for brainfile. Free some and try again...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/FreeBBBF
result = FreeBBBF();
void FreeBBBF(void);
DESCRIPTION
Will free the memory used for the brainfile, ie. unload it.
If the brainfile is not loaded the function will just return.
INPUTS
none
RESULT
none
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/CheckBoot
Boot = CheckBoot(buffer,&status);
struct Bootblock *CheckBoot(char *,APTR);
A0 A1
DESCRIPTION
INPUTS
buffer = simply the bootblock that you want to check.
status = address of an ULONG. Status will afterwards contain one
of the following values:
-1 : Error - The brainfile is not loaded.
0 : The bootblock is unknown (send it to me!)
1 : The bootblock is a virus! Kill it!
2 : The bootblock is not bootable...
RESULT
Boot Bootblock struct that contains the name of the bootblock.
If status != 1 then Boot will be NULL.
NOTES
If the bootblock is a virus, then you'll have to append ' virus!' to
the name from the Bootblock structure. It saved me quite a lot of bytes
in the brainfile. 200 ' virus!' would be 1400 bytes...
I hope you don't mind!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/GetBBBFInfo
result = GetBBBFInfo(&virus,version);
long GetBBBFInfo(USHORT *,char[30]);
A0 A1
DESCRIPTION
INPUTS
virus = will contain the number of viruses known by this brainfile.
version = string that will contain the brainfile version-string,
without the '$VER: '.
RESULT
result If result == -1 then the brainfile is not loaded.
If success then result will be 0.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/ListBBBF
Boot = ListBBBF()
struct Bootblock *ListBBBF(void)
DESCRIPTION
This function returns the pointer to the first Bootblock structure.
Useful for listing all known bootblocks etc.
INPUTS
none
RESULT
Boot Pointer to the first Bootblock structure, or
NULL == the brainfile is not loaded.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bootblock.library/ReadBoot
result = ReadBoot(drive,buffer);
ULONG ReadBoot(ULONG,char *);
D0 A0
DESCRIPTION
This function will read the bootblock from the desired drive,
using the trackdisk.device and CMD_READ.
INPUTS
drive = drive number (0-3)
buffer = the destination of the bootblock. Must be at least 1024
bytes. Note that it must be in chip ram if running
under kickstart V36 or below.
RESULT
result = either NULL = success,
or the errorcode returned by IoErr(),
Could occur during the OpenDevice() (see <exec/errors.h>
or the bootread (see <devices/trackdisk.h>)
It can also be 103 (out of memory).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LIBRARY HISTORY
~~~~~~~~~~~~~~~
Version 0.9 beta
~~~~~~~~~~~~~~~~
First version.
Version 0.91 beta
~~~~~~~~~~~~~~~~~
Removed all non-virus bootblocks from the brainfile upon request from
Erik Loevendahl Soerensen. Now you will only be alerted if the bootblock
contains a virus, anti-virus, or any other suspicious resident program.
This is for speed and so that the user won't be bothered with messages
like 'This bootblock is the MegaSuperDemoLoader 32.84' all the time.
The GetBBBFInfo() function is changed accordingly.
I have tried to clean up this doc a bit too. There were a few obvious
mistakes that I guess you spotted.
BBBF now knows 171 original viruses, and a vast number of clones.
Version 0.92 beta (15.10.92)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
V 0.91 didn't recognize the Chameleon (little Sven) virus correctly.
Instead of adding a short piece of code to deal with that, I rewrote
the complete brainfile-system, so it will be easier to add new viruses
to the brainfile from now on. As a result of that, the Bootblock structure
has changed a bit. Also, ReadBBBF() and CheckBoot() are a little bit slower,
and the brainfile is 656 bytes bigger......but a lot safer!
BBBF now knows 164 original viruses, and a vast number + 7 clones.
Version 0.93 beta (05.11.92)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bug fix: If the brainfile-reading was interrupted due to lack of memory,
the already allocated memory would not be freed correctly.
Version 1.0 (11.11.92)
~~~~~~~~~~~~~~~~~~~~~~
New function - ReadBoot().
I also optimized the library down to 2876 bytes!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, that's all for now!
Please, I need your opinions! Even if you have no complaints nor ideas
it's nice just to hear that it works... 8-)
Send new viruses, ideas, threats and harddrives to:
Johan Eliasson Phone: +46 11 169138
BΣckgatan 6
60358 Norrk÷ping
SWEDEN
Thanks goes to Magnus Holmgren and Tommy Hallgren for helping out with my
C troubles, Tommy Hallgren and Mats Erlandsson for testing!
Erik Loevendahl Soerensen at SHI for all his support.
John Lohmeyer, whose Interpret.library I used as a model when designing
this library. Thanks guys!
END OF DOC.